# attempting to get an alternative ppp route [solved]

## javeree

I set up an ethernet interface, which gets an (private 192.168.x.x) ip address from the dhcp server in my vdsl modem. This also sets up a defaultroute through this interface:

route 

 *Quote:*   

> Kernel IP routing table
> 
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 
> default         192.168.1.1     0.0.0.0         UG    2      0        0 ethm
> ...

 

As a next step, I set up a PPPoE connection directly with my ISP over this ethernet connection:

cat etc/conf.d/net.ppp1:

 *Quote:*   

> rc_need="net.ethm"
> 
> config_ppp1="ppp"
> 
> link_ppp1="ethm"
> ...

 

This correctly sets up the ppp1 interface with a public address, but the route it sets up is to the isps ppp1 host only. there is no automatic creation of a default route with a metric "2"

route

 *Quote:*   

> Kernel IP routing table
> 
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 
> default         192.168.1.1     0.0.0.0         UG    2      0        0 ethm
> ...

 

I can manually create it with 

 *Quote:*   

> ip route add default via 81.242.53.1 metric 1

 

end then it all works, but I would expect this to happen automatically. 

I also tried creating a script in /etc/ppp/ip-up.d/90-defaultroute containing 

 *Quote:*   

> ip route add default via $5 metric 1

 

but it looks like that is also not called.

Any suggestion how to set this up ?Last edited by javeree on Sun Dec 09, 2012 12:13 pm; edited 1 time in total

----------

## javeree

I found out that pppd does not create a default route if any default route already exists (even if there are differences like the metric).

That means it has to be done by hand. 

I did this by creating a small script:

 *Quote:*   

> # /etc/ppp/ip-up.d/90-updateroute.sh
> 
> # This script is run by pppd after the link is established.
> 
> # it is called by cat /etc/ppp/ip-up
> ...

 

/etc/conf.d/net.ppp1 contains

 *Quote:*   

> 
> 
> # metric_pppx is gentoo syntax, but only used when a default route can be set up by pppd (so if this is the only defaultroute)
> 
> metric_ppp1="1"
> ...

 

----------

