My home network is setup in a fairly standard way: a bunch of machines on a LAN connected to an (OpenWRT) WRTSL54GS Linksys router doing a PPPoE connection over a DSL line via a DSL modem.
Now, my DSL modem provides some useful web pages to get DSL statistics and configuration and I'd like to be able to access it from any machine on the LAN.
So let's say my LAN uses 192.168.1.NN addresses and I've setup my DSL modem to use IP address 192.168.2.3 (it's on another network, obviously, connected to the WAN port of the router).
On the router I did "ifconfig eth1 192.168.2.4" which gives an IP address to my WAN connection and sets up a route, so I can now connect to my modem from my router. This works fine.
But when trying to connect from other machines on my LAN, this doesn't work: presumably the packets do go to the router (thanks to the defaultrule) and then from there to modem, but the modem doesn't know how to reply to 192.168.1.XX. Maybe I could try and setup a route on my modem to access the 192.168.1.XX network via my router, but I'm not sure how I could do that (sadly this DSL box isn't running OpenWRT), so another option is to use NAT.
I tried "iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 192.168.2.4" but it doesn't seem to do what I want. Could someone help me out?