Auto Re-Connect to DSL pppoe in Linux
Firstly you will need to configure the pppoe client
sudo pppoeconf
To connect you use
sudo pon dsl-provider
and disconnect using
sudo poff -a
PPPD does not always terminate immediately after, creating a killpppd script and placed in /usr/local/sbin/.
#!/bin/sh
#kill pppd brutally
for i in `ps -eaf | grep "pppd" | tr -s " " | cut -f2 -d " "`
do
sudo kill -9 ${i}
done
You need to make it executable, so sudo chmod +x killpppd
Making sure things are disconnected and ready for a reconnect, creating another little script dcon can handle that.
#!/bin/sh
sudo poff -a
sudo killpppd
sudo poff -a
Then make it executable. This script first tries to disconnect gracefully and tries to kill pppd if that was not successful.
Now to create a connect script that only connects if the connection has been lost and does nothing if it has not. Create connect
#!/bin/sh
IFACE=ppp0
