Setting up a Static IP Tunnel on Linux (xl2tpd) Print

  • 0

Note: This depends on the Linux xl2tpd package which may or may not be in your distribution's repositories.

  1. Ensure the following kernel options are set or the corresponding modules are available:
    1. CONFIG_PPPOL2TP
    2. CONFIG_L2TP
  2. Install xl2tpd on your Linux box. On Ubuntu and Debian, you can use sudo apt-get install xl2tpd.
  3. Edit /etc/xl2tpd/xl2tpd.conf to contain the following (adjust to suit):
    [lac fourplex]
    lns = nyc.vpn.fourplex.net
    require authentication = no
    pppoptfile = /etc/ppp/options.fourplex
  4. Create /etc/ppp/options.fourplex containing the following (obviously change the name and password to match your L2TP login details):
    +ipv6
    ipv6cp-use-ipaddr
    name username
    password password
    noauth

    Replace username and password with your L2TP username and password
  5. Start the xl2tpd service:
    systemctl start xl2tpd
  6. Tell the daemon to connect to Fourplex:
    echo "c fourplex" > /var/run/xl2tpd/l2tp-control

Note: if systemctl doesn't start xl2tpd, you can try manually:

xl2tpd -D

and then restart step 6.

To make it permanent edit /etc/crontab and add the following:

@reboot root bash -c "xl2tpd -D &"
@reboot root bash -c "sleep 5 && echo 'c fourplex' > /var/run/xl2tpd/l2tp-control" 


Was this answer helpful?

« Back