Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question
3  
What is the IP of the interface? Is it static or what? When your ISP gave you the static, didn't they also give you the gateway? You need the gateway address. Using the device name as a route target mostly only works on serial links. –  Zoredache Jan 24 '13 at 17:20
    
Zoredache: you're right and you have enlightened me and my understanding of network configuration. Wish I could promote your comment as answer, as it really was what I was looking for. Now I have found the gateway address and can use it a 'via' parameter. Works like a charm. –  alci Jan 25 '13 at 8:18
add comment

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.