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.
Btw, how do I query the status of the PPPoE connection?
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page