Static route without knowing the nexthop (linux)
I have an eth3 interface in a linux router, with an adsl modem. This adsl modem is in bridged mode, so the public IP is assigned to eth3 (say 11.22.33.44), and the modem is just not seen by my server.
I want to define a static route to a specific IP (88.191.250.176) through eth3, but I don't have a nexthop to set:
ip route add 88.191.250.176 dev eth3
is accepted but does not work (packets never make their way out).
ip route add 88.191.250.176 via 11.22.33.44 dev eth3
Does not work either.
If I set the modem in router mode, then I have a NATed address for the linux server (192.168.1.2), and IP address for the Adsl router (192.168.1.1), and I can do:
ip route add 88.191.250.176 via 192.168.1.1 dev eth3
Does work.
Is it possible to define a static route through my adsl modem in bridged mode (first case), without having an explicit nexthop to give ?
Solution 1:
The traffic has to go via your ISP's gateway. If eth3 has been assigned your public IP, then the default gateway address should be listed in your routing table:
ip route show table main
You then need to issue
ip route add 88.191.250.176 via <gatewayip> dev eth3
It should then work.