Access from Green network to GUI ADSL modem/router in bridge PPPOE mode

Hello,

I use ipfire behind a modem/router ADSL TP-Link WD-9970 in Bridge mode (My ISP is Orange France)
The Modem GUI is accessible under 192.168.1.1

The PPOE connection of the red interface does not allow me to access the GUI of my modem from Green network

I have to do that to manually add an IP address to the red interface.
For that I added in /etc/sysconfig/rc.local the order:

# Adding Red Address for Modem Access
ip addr add 192.168.1.2/24 dev red0

In this way I access my modem/router under http://192.168.1.1/

Its work, the only problem is that if I have an ADSL disconnect/reconnect I lose this address and must manually restart the order ip addr add 192.168.1.2/24 dev red0 or restart my ipfire

Is it possible to add via the setup or the pppsetup.cgi page this IP address so that it can reassign it with each connection?

Thanks.

You may write a script that checks for the ip assignment and cycle that script with cron.

I’m using the firewall.local script in /etc/sysconfig/ for accessing my modem (Draytek Vigor 165).

Within the start section just fill in:

ip addr add 192.168.1.2/24 dev red0 brd +
iptables -I POSTROUTING -t nat -o red0 -d 192.168.1.0/24 -j MASQUERADE
iptables -A CUSTOMINPUT -i red0 -p udp -s 192.168.1.1/32 --dport 123 -j ACCEPT

The first line adds the IP for the red0 interface just the way you did including the broadcast address (192.168.1.255) for red0. Masquerading is needed to access the device from IPFire’s local net(s). The last line is useful for remote logging on IPFire.

For the stop section just use the following lines and you’re done:

ip addr del 192.168.1.2/24 dev red0

4 Likes

Thanks @breathewave!

I didn’t know that firewall.local was running on every connection.
unlike rc.local.

I did not understand the last command,

The UDP 123 port is used for NTP, no ?

Sorry for this, your’re right, of course this is the ntp port :slight_smile: