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 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
69.19.219.69    0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
10.0.1.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         10.0.1.1        0.0.0.0         UG    0      0        0 eth0
share|improve this question
add comment

1 Answer

up vote 0 down vote accepted
route add -net 10.8.78.0 netmask 255.255.255.0 gw ppp0 metric 1
route add -net 10.8.78.0 netmask 255.255.255.0 gw eth0 metric 10

I think this should work

you may need to change the metric for the 0.0.0.0/0 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 208.82.236.208 gw 69.19.219.46 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 linux.about.com/od/commands/l/blcmdl8_route.htm 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
show 2 more comments

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.