Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a network where I have the host A, the host B (both Linux) and the gateway C. I am trying to reach the host Z.

The traffic, by default does:

A -> C -> Z

For some internal needs, I need the traffic to do:

A -> B -> C -> Z

In order to do so, I just add a route. So in A I execute something like:

route add A gw B

if I ping, I can see how the traffic does:

A -> B -> C -> Z

Which is good. However, as the time progresses, you can see how it comes back to (checked with mtr)

A -> C -> Z

and the routing table stills existing (route -n)

Any ideas to solve this issue ?

share|improve this question
Does B become unavailable at any point in time? Are getting an ICMP redirects from B? – Zoredache Aug 24 '12 at 0:18
Did you try setting B as default route with route add A default gw B ? I think it may have something in common of mac addresses in common network segment. Moreover it may have something in common with ICMP redirects (is B a windows machine ? ?:) ) – wojciechz Aug 24 '12 at 0:20
It sounds like B is sending inappropriate ICMP redirects. – David Schwartz Aug 24 '12 at 0:29
Mac address are different, but I will check the ICMP redirects. – Tk421 Aug 24 '12 at 3:40
Following (this post)[… I disabled to accept ICMP redirects and same results. This is virtualized host based using Xen. Might it have anything to do ? – Tk421 Aug 24 '12 at 3:44

If this is what you have Current

And this is what you want Desired

On A, you need to set B as your default gateway; via /etc/sysconfig/network-scripts/ifcfg-eht0 or /etc/sysconfig/network

This way, on reboot, the settings don't get lost.

On C, you should configure a static route for A to go through B. Not always necessary, but consistent if you want B to route all A's traffic to Z and vice versa.

Note if you build static routes on the boxes, you may need to write scripts to load on boot-up to re-add the routes. If you added the default gateway via terminal instead of the network-scripts, then this would be a good place to put the commands, so the default gateway gets readded on boot-up.

share|improve this answer

Your Answer


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.