C
C
Chvalov2014-08-23 02:45:24
ubuntu
Chvalov, 2014-08-23 02:45:24

How to make a PPPoE connection automatically reconnect on disconnect in ubuntu server?

There is a problem, sometimes the PPPoE connection breaks either because of the connection session, or because of the instability of PPPoE.
How to actually make the connection connect automatically back.
And if it is possible to do something so that the remote host also pongs every half hour, and if there is no response from the server, then reconnect.
Well, if possible, then so that the local interface eth0 also pings the local address of the provider's server and if there is no answer, restart the connection interface.

Added on 08/24/2014 at 22:20 "+2"

How would such a script work?
#!/bin/bash

# Пингуем нужный сайт, на всякий случай 3 раза
ping -c3 www.ru &>/dev/null
# Если все три пинга провалились
if [ "$?" -ne "0" ]; then
    # То опускаем все имеющиеся ppp соединения
    poff -a
    # И поднимаем нужное
    pon providername
fi

# Выходим из скрипта
exit 0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2014-08-24
@Chvalov

Add to pppd config:

persist
lcp-echo-interval 10
lcp-echo-failure 3

And if you read man pppd , and find a number of other useful options, you can even do without a crutch with a crown :-)

S
Sergey Petrikov, 2014-08-23
@RicoX

Add a view construct to the crontab
Instead of 8.8.8.8 your pinged host, instead of echo "Restart PPPoE" - the command to raise PPPoE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question