OpenWrt Forum Archive

Topic: Access modem GUI from LAN

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Below is a UCI config file and a init script. With this you can access the modem GUI connected on the WAN port of the router.

However the stop_service() function does not work for me, I can still reach the modem GUI. If you now how to fix this let me know...

/etc/config/modemroute

config modemroute
        option modem_ip '192.168.100.1'

/etc/init.d/modemroute

#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org

START=52

include /lib/network
scan_interfaces
config_get wan_ifname  wan ifname
config_get lan_ipaddr  lan ipaddr
config_get lan_netmask lan netmask

start_service() {
        local section "$1"
        config_get modem_ip "$section" modem_ip

        ifconfig $wan_ifname:1 $lan_ipaddr netmask $lan_netmask
        route add -host $modem_ip dev "$wan_ifname:1"
}

stop_service() {
        local section "$1"
        config_get modem_ip "$section" modem_ip

        route del -host $modem_ip
        ifconfig "$wan_ifname:1" down
}

start() {
        config_load modemroute
        config_foreach start_service modemroute
}

stop() {
        config_load modemroute
        config_foreach stop_service modemroute
}

(Last edited by forum2006 on 14 Nov 2007, 12:29)

I don't know about anyone else, but i've always been able to access my modem's IP from the lan side of my network without any extra configuration

Does not work for me on ASUS wl-500g deluxe, wan_interface is set to ppp0 and that for sure won't work.

But even if I set everything manually according to the script using interface eth0.1, i can only access the modem from the routers console, not from the network.

Already tried other hints from the web, but nothing works. sad

The discussion might have continued from here.