Access my modem's GUI when it's in bridged mode

2 posts / 0 new
Last post
sreggy
sreggy's picture
Access my modem's GUI when it's in bridged mode

Hi all,

I've my router (192.168.0.1) configured with PPPoE, and I want reach modem (192.168.1.1) GUI, modem is configured in bridged mode.

I've tried some configuration scripts reported following

#!/bin/sh
route add -net 192.168.1.1 netmask 255.255.255.255 gw 192.168.0.1
ip route flush cache

#!/bin/sh
ip addr add 192.168.1.10/24 dev $(nvram get wan_ifname) brd +
sleep 5
iptables -I POSTROUTING -t nat -o $(nvram get wan_ifname) -d 192.168.1.0/24 -j MASQUERADE

#!/bin/sh
ifconfig $(nvram get wan_ifname):1 192.168.1.10 netmask 255.255.255.0
iptables -t nat -I POSTROUTING -o $(nvram get wan_ifname) -d 192.168.1.0/24 -j MASQUERADE

but they don't work, could anyone help me?

Thanks in advance, regards

Stefano

sreggy
sreggy's picture
... and finally after some

... and finally after some test and headache here the solution ...
first of all, my firmware Voxel v. 1.0.2.76.1SF (really thanks to Voxel ), than configuration:

add secondary IP to wan interface:
ip addr add 192.168.1.10/24 dev $(nvram get wan_ifname) brd + I've added it to post-mount.sh located in  /mnt/sda1/autorun/scripts

add iptables rule for forwarding
iptables -I INPUT -i $(nvram get wan_ifname) -j ACCEPT
iptables -I OUTPUT -j ACCEPT
iptables -I FORWARD 2 -i $(nvram get wan_ifname) -j ACCEPT
iptables -I FORWARD -i $(nvram get lan_ifname) -o $(nvram get wan_ifname) -j ACCEPT
iptables -I FORWARD -i $(nvram get wan_ifname) -o $(nvram get lan_ifname) -j ACCEPT

add iptables rule for NAT to reach modem from also from LAN
iptables -t nat -A POSTROUTING -o $(nvram get wan_ifname) -j MASQUERADE

I've added all iptables rules to a new script firewall-start-modem.sh located in /opt/scripts

so here we are ...
scripts # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=254 time=0.5 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=254 time=0.5 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=254 time=0.5 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=254 time=0.5 ms

Happy if useful for someone ...
-stefano