Now there is one more thing about the PPPoE connection I would like to setup - I want to have it established at boot time. As far
as I know I need to have the following files:
1) /etc/sysconfig/network-devices/ifconfig.eth0/pppoe:
ONBOOT="yes"
SERVICE="pppoe"
2) /etc/sysconfig/network-devices/services/pppoe:
#!/bin/sh
. /etc/sysconfig/rc
. $rc_functions
case "$2" in
up)
boot_mesg "Bringing up the PPPoE interface..."
ip link set <ethN> up
pppd call <peername>
evaluate_retval
;;
down)
boot_mesg "Bringing down the PPPoE interface..."
killall pppd
evaluate_retval
;;
*)
echo "Usage: $0 {up|down}"
exit 1
;;
esac
The question is how do I know the value of N in <ethN>.
ethN is passed as the argument to the bootscript and, thus, is accessible as
${1}.
Probably (untested, I have a custom script not using the service model) you can
do the following:
1) Don't specify the network interface name in /etc/ppp/peers/pppoe
2) In the "up" part, run this:
ip link set ${1} up
loadproc -p /var/run/ppp-${1}.pid pppd call pppoe nic-${1} updetach linkname
${1}
No need to evaluate_retval
(the "nic-" prefix is needed so that it works even with network interfaces renamed to "realtek" or something like that. "updetach"
is needed so that you can be 100% sure that pppd doesn't go into background until establishing the connection, so that e.g. ntpd
could start correctly. "linkname" is for a predictable pid file name)
3) In the "down" part, it is better to do this:
killproc -p /var/run/ppp-${1}.pid pppd
Again, no need to evaluate_retval
Please report if this works for you with or without modifications.
Yes, it works without modifications. Here's the relevant output:
Bringing up the eth0 interface...
Plugin ip-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
Using interface ppp0
Connect ppp0 <--> eth0
Couldn't increase MTU to 1500
Couldn't increase MTU to 1500
Couldn't increase MTU to 1500
PAP authentication succeeded
peer calling from number [MAC] authorized
local IP address [...]
remote IP address [...]
primary DNS address [...]
secondary DNS address [...]
Is the "Couldn't increase MTU to 1500" message harmless? If not, how can I avoid it (I already tried adding "mru 1280" and "mtu
1280" to the /etc/ppp/peers/pppoe file)?
How can I specify which PPPoE server I want to connect to when more than one is
available?
It seems that /etc/ppp/ip-up does not get called; how do I inform bind where to
forward DNS queries?
The other thing I want is to have the PPPoE connection reestablished if it breaks. Is this automatically handled or do I need to
setup smth?
You have to add the following options to /etc/ppp/peers/pppoe:
persist
holdoff 15
lcp-echo-interval 30
lcp-echo-failure 3
This way, pppd will retry in 15 seconds after it knows that the connection broke. Also, it will send echo requests to the peer
every 30 seconds, and failure to answer 3 requests counts as link failure.
I have not tested this yet, but I guess it would work just fine.
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page