We use multiple providers, one of them to create connection uses pppoe through pppd daemon on ubuntu 14.04.

Early without multiple providers pppd manages default route by itself (creating it when connection is established and remove it when pppoe is down). But now I banned it with following options in peers/rt


Because I need more complex ip rules for the running scheme with multiple providers.

I researched pppd scripts ip-up, ip-down, ip-up.d, ip-down.d but does not found removing default route.

So I assumed that it does it in their code.

I can add post-down directive in the provider configuration /etc/network/interfaces file as is:

ip route add default dev ppp60 table default

As a trick.

I planned to manage default route in separate init script.

Is there are a workaround for prevent pppd to manage (remove) a default route ?


I want to forbid pppd to remove default route default dev ppp60 scope link, when connections is reinitiating or go down.

I use interfaces(pppd is managed by ifup and ifdown commands) and standart debian/ubuntu network subsystem configuration tools, as is:

auto rt
iface rt inet ppp
provider rt
pre-up /sbin/ifconfig ethtop up
post-up until ip a | grep -q ppp60; do sleep 1 > /dev/null; done
post-up ip route add default via "$( ip -4 a show dev "ppp60" |   grep -E '\<peer\>' | sed -r 's/.*peer ([^ /]*).*/\1/' )" table isc-rt
post-up ip rule add pref 30001 fwmark "0x$( gethostip -x "$(ip -4 a show dev "ppp60" | grep -E '\<inet\>' | sed -r 's/.*inet ([^ /]*).*/\1/')" )" lookup isc-rt
post-up ip rule add pref 30002 from "$( ip -4 a show dev "ppp60" | grep -E '\<inet\>' | sed -r 's/.*inet ([^ /]*).*/\1/' )" lookup isc-rt
post-up ip rule add pref 30003 to "$( ip -4 a show dev "ppp60" | grep -E '\<peer\>' | sed -r 's/.*peer ([^ ]*).*/\1/'  )" lookup isc-rt
post-up /etc/init.d/fw restart
post-down ip route flush table isc-rt
post-down ip rule del pref 30001
post-down ip rule del pref 30002
post-down ip rule del pref 30003
post-down /etc/init.d/fw restart

That's my main routes:

root@gate:/etc/ppp# ip route list
default dev ppp60  scope link dev lxcbr0  proto kernel  scope link  src via dev br-eth0 
83.Y.Y.196 dev ppp60  proto kernel  scope link  src 93.Y.Y.67 
95.X.X.0/24 dev ethmiddle  proto kernel  scope link  src 95.X.X.40 dev br-eth0  proto kernel  scope link  src 

Also I have tables for each provider with it's default gateway

That's my pppd options:

root@gate:/etc/ppp# awk '!/^ *#/ && NF' /etc/ppp/options 
asyncmap 0
lcp-echo-interval 30
lcp-echo-failure 4

That's my current provider peer config:

user "gsdf6sg84"
unit 60
lcp-echo-interval 20
lcp-echo-failure 3
mtu 1492
maxfail 0
plugin rp-pppoe.so ethtop
  • Could you please edit the question and make clear what are you trying to achieve and what happens? ip route list output wouldn't also hurt. Is pppd run by root, from startup script, or by unprivileged user? What's in /etc/ppp/options? – sam_pan_mariusz Aug 29 '15 at 13:51
  • As noted in the answer it is a kernel which removes the route when the device goes down. You can have a look at pppd demand option as it should create/keep networking devices even without establishing a link and check if it can be of any help in your case. – Tomek Aug 1 '18 at 6:27

The kernel (not pppd) automatically removes all related routes when corresponding interfaces are being removed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.