0

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
user65053
  • 5
  • 1

1 Answers1

0
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

Ablue
  • 1,140
  • 1
  • 12
  • 32
  • 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 06: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 00:40
  • Now *that* is another question altogether :) The documentation shows gw uses the interface name http://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 00:44
  • awesome, I am glad to hear it :) – Ablue Dec 31 '10 at 02:05