Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 am trying to figure out how to get all traffic to 10.8.78.* to connect using interface ppp0 when available how would I properly handle this (centos) and can I fall back on eth0 when pp0 is not up?

/sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface UH    0      0        0 ppp0   U     0      0        0 eth0     U     0      0        0 eth0         UG    0      0        0 eth0
share|improve this question
up vote 0 down vote accepted
route add -net netmask gw ppp0 metric 1
route add -net netmask gw eth0 metric 10

I think this should work

you may need to change the metric for the network to like 20

share|improve this answer
he should be able to leave the default route alone, the routing engine will take the most specific path... so i there was a 10.8/16 route and a 10.8.78/24 route it will take the latter. – SpacemanSpiff Dec 30 '10 at 6:23
I tried to set that and got ppp0: Unknown host – user65053 Dec 30 '10 at 21:55
sounds like a syntax error. Check your add route syntax. – Ablue Dec 30 '10 at 22:14
OK so I got route add gw ppp0 to work but how would I set it to use ppp0 if I dont know the IP ppp0 is dialup and the IP changes... – user65053 Dec 31 '10 at 0:40
Now that is another question altogether :) The documentation shows gw uses the interface name So I am unsure why you need to specify an IP. Maybe your OS differs with the use of this command? – Ablue Dec 31 '10 at 0:44

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.