Accessing the modem through the router

  • This how-to describes the method for accessing the modem connected to your OpenWrt router.
  • It helps to reach the administrative interface of a DSL/DOCSIS modem operating in the bridge mode.
  • The prerequisite is to know the modem's IP address, port/protocol and username/password.
  • Access the modem operating in the bridge mode through the router.

Assuming your modem's IP address is and it is connected to the router's WAN interface.

  1. Navigate to LuCI → Network → Interfaces.
  2. Click Add new interface… and specify:
    • Name: modem
    • Protocol: Static address
    • Interface: @wan
  3. Click Create interface.
  4. On the General Settings tab specify:
    • IPv4 address:
    • IPv4 netmask:
  5. On the Firewall Settings tab specify:
    • Create / Assign firewall-zone: wan
  6. Click Save, then Save & Apply.

At this point the modem should be reachable from any host in the LAN.

Assuming your modem's IP address is and it is connected to the router's WAN interface.

Set up a static WAN alias and assign it to the WAN zone.

# Configure firewall
uci add_list firewall.@zone[1].network="modem"
uci commit firewall
/etc/init.d/firewall restart
# Configure network
uci -q delete network.modem
uci set network.modem="interface"
uci set network.modem.device="@wan"
uci set network.modem.proto="static"
uci set network.modem.ipaddr=""
uci set network.modem.netmask=""
uci commit network
/etc/init.d/network restart

Make sure the modem subnet doesn't overlap with your LAN, otherwise change the LAN subnet.

# Configure network
uci set network.lan.ipaddr=""
uci commit network
/etc/init.d/network restart

If the WAN L2 device doesn't match L3 device like in case of PPPoE, change the modem interface.

# Fetch WAN L2 device
. /lib/functions/
network_find_wan NET_IF
network_get_physdev NET_L2D "${NET_IF}"
# Configure network
uci set network.modem.device="${NET_L2D}"
uci commit network
/etc/init.d/network restart
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2021/09/04 19:36
  • by vgaetera