3

/etc/xl2tpd/xl2tpd.conf:

redial = yes
redial timeout = 1
autodial = yes

Version of xl2tpd default, latest Ubuntu 14.04 ( Trusty ):

xl2tpd  1.3.6+dfsg-1 amd64  layer 2 tunneling protocol implementation

I'm always pinging some host like Google, default DNS - 8.8.8.8.

From time to time I'm losing the connection, ping is silent and xl2tpd doesn't reconnect.

Seems like xl2tpd doesn't know that the connection is broken.

Is there any option to keep an internet connection alive, to keep xl2tpd redial automatically?

Now, I use a raw and dirty bash script wrapper around ping and also service xl2tpd restart to redial xl2tpd.

Is there a more program (xl2tpd) friendly way?

polym
  • 10,672
  • 9
  • 41
  • 65
unixlinuxuser
  • 141
  • 1
  • 1
  • 6

1 Answers1

1

A couple of things to try. I would set the max redial to a high number so that it will attempt to redial for more tries. Perhaps it's exhausting redial attempts and no longer trying. Also I'd set the redial timeout to something like 2.

excerpt from the xl2tpd man page

  • redial - If set to yes, xl2tpd will attempts to redial if the call get disconected.
  • redial timeout - Wait X seconds before redial. The redial option must be set to yes to use this option.
  • max redial - Will give up redial tries after X attempts.

Also you might want to take a look at this example script here in this Gist titled: vpn_dorm.sh. It might shed some light on alternatives.

slm
  • 363,520
  • 117
  • 767
  • 871