Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
attempting to get an alternative ppp route [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 453

PostPosted: Wed Dec 05, 2012 8:15 pm    Post subject: attempting to get an alternative ppp route [solved] Reply with quote

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
loopback localhost 255.0.0.0 UG 0 0 0 lo
192.168.1.0 * 255.255.255.0 U 0 0 0 ethm
192.168.4.0 * 255.255.255.0 U 0 0 0 br0


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"
plugins_ppp1="pppoe"
pppd_ppp1="debug defaultroute usepeerdns lcp-echo-failure 8 lcp-echo-interval 15"
username_ppp1='my-vdsl-loginname'
metric_ppp1="2"


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
1.53-242-81.ads * 255.255.255.255 UH 0 0 0 ppp1
loopback localhost 255.0.0.0 UG 0 0 0 lo
192.168.1.0 * 255.255.255.0 U 0 0 0 ethm
192.168.4.0 * 255.255.255.0 U 0 0 0 br0


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
Back to top
View user's profile Send private message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 453

PostPosted: Sun Dec 09, 2012 12:12 pm    Post subject: Reply with quote

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
# with the following parameters:
# $1 = interface name (e.g. ppp0)
# $2 = tty device
# $3 = speed
# $4 = local IP address
# $5 = remote IP address
# $6 = ipparam (user specified parameter, see man pppd)

logger -t pppd $0: adding route for interface $1 on tty device $2 with speed $3: local IP=$4 : remote IP=$5 : ipparam=$6

METRIC=${$6#metric=}
[ -z "$METRIC" ] || METRIC="metric $METRIC"

ip route add default via $5 $METRIC

# end of /etc/ppp/ip-up.d/90-updateroute.sh


/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"

# use ipparam to pass the metric to the scripts
pppd_ppp1="debug defaultroute usepeerdns lcp-echo-failure 8 lcp-echo-interval 15 ipparam metric=$metric_ppp1"

Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum