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

So with a little help I figured out how to setup these routes and I can set them in rc.local

route add -net netmask dev ppp0 metric 1

route add -net netmask dev eth0 metric 10

my question is being that the first route is ppp0 as soon as I disconnect the modem the route is dropped how do I maintain the route or make it permanent so that next time the modem connects it will follow the route.

Currently after ppp0 disconnects the route is dropped

netstat -r Kernel IP routing table

Destination Gateway

Genmask Flags MSS Window irtt Iface * UH 0 0 0 ppp0 * U 0 0 0 eth0 * U 0 0 0 eth0 * U 0 0 0 eth0

default UG 0 0 0 eth0

share|improve this question
How are you establishing the modem connection? That's going to determine what you hook into to re-establish your routes. – jgoldschrafe Dec 31 '10 at 4:17
wvdial &[Modem0] Modem = /dev/ttyS0 Baud = 115200 SetVolume = 1 Dial Command = ATDT Init1 = ATZ Init3 = ATM1L1 FlowControl = CRTSCTS [Dialer Defaults] Modem = /dev/ttyS0 Baud = 115200 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ISDN = 0 Modem Type = Analog Modem Phone = 2090177 Username = user Password = pass – user65053 Dec 31 '10 at 4:34
Do I just add the route to /etp/ppp/ip-up/ – user65053 Dec 31 '10 at 4:39
up vote 0 down vote accepted

Create executable script in /etc/ppp/ip-up.d/ for example - setroute


route add -net netmask dev ppp0 metric 1

share|improve this answer
Thanks got it, I was adding it to ip-up.local but it wasn't executable, Thanks! – user65053 Dec 31 '10 at 6:08

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.