# Problem with xl2tpd VPN



## Ali3n0id (Feb 1, 2014)

Hi all,

I've got a RasPi here and trying to use it as a VPN server to my home network.

I've opened ports and all the config seems to be A okay.

But xl2tpd produces:


```
systemctl status xl2tpd -l
â xl2tpd.service - Level 2 Tunnel Protocol Daemon (L2TP)
   Loaded: loaded (/usr/lib/systemd/system/xl2tpd.service; enabled)
    Active: failed (Result: exit-code) since Thu 1970-01-01 01:00:33 BST;  44 year                                                                  s 7 months ago
  Process: 433 ExecStart=/usr/bin/xl2tpd -D (code=exited, status=1/FAILURE)
 Main PID: 433 (code=exited, status=1/FAILURE)

Jan 01 01:00:33 0ri0n systemd[1]: Started Level 2 Tunnel Protocol Daemon (L2TP).
Jan 01 01:00:33 0ri0n systemd[1]: xl2tpd.service: main process exited, code=exited, status=1/FAILURE
Jan 01 01:00:33 0ri0n systemd[1]: Unit xl2tpd.service entered failed state.
Jan 01 01:00:34 0ri0n xl2tpd[433]: xl2tpd[433]: Enabling IPsec SAref processing for L2TP transport mode SAs
Jan  01 01:00:34 0ri0n xl2tpd[433]: xl2tpd[433]: IPsec SAref does not work  with L2TP kernel mode yet, enabling force userspace=yes
Jan 01  01:00:34 0ri0n xl2tpd[433]: xl2tpd[433]: init_network: Unable to bind  socket: Cannot assign requested address. Terminating.
```

netstat -an | grep LISTEN produces:


```
netstat -an | grep LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
unix  2      [ ACC ]     SEQPACKET  LISTENING     3073     /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     3077     /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     3080     /run/systemd/journal/stdout
unix  2      [ ACC ]     STREAM     LISTENING     6435     @/tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     6436     /tmp/.X11-unix/X0
unix  2      [ ACC ]     STREAM     LISTENING     4910     /var/run/avahi-daemon/socket
unix  2      [ ACC ]     STREAM     LISTENING     4913     /run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     7747     /run/user/0/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     6787     /var/run/pluto/pluto.ctl
unix  2      [ ACC ]     STREAM     LISTENING     161180   /run/user/1000/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     3043     /run/systemd/private
[ro[email protected] ~]#
```
Any ideas on this one?


----------



## hal8000 (Dec 23, 2006)

Have a look at this tutorial:

How to setup L2TP VPN server on Raspberry Pi? | Linux.Tips

This will be for the Rasbian image on the Pi, you have to open certain ports on your firewall.
From linux mint 17, install nmap, sudo apt-get install nmap

Then run a scan from your linux Mint 17 to your Raspberry Pi and then router:

Use the command below replacing 192.168.1.1 with the correct static IP for your RPi.
This is what I see running Raspmc

nmap 192.168.1.1

Starting Nmap 6.40 ( Nmap - Free Security Scanner For Network Exploration & Security Audits. ) at 2014-08-14 22:35 BST
Nmap scan report for RPi (192.168.1.1)
Host is up (0.034s latency).
Not shown: 996 closed ports
PORT STATE SERVICE
21/tcp open ftp
111/tcp open rpcbind
8001/tcp open vcom-tunnel
9090/tcp open zeus-admin

Nmap done: 1 IP address (1 host up) scanned in 1.89 seconds

You can install zenmap which is a frontend to nmap and makes life a little easier
You can verify your router has UDP 4500 and UDP500 open running intense scan with
UDP against your router.


----------



## Ali3n0id (Feb 1, 2014)

Thanks for your help, I've ran nmap against the Pi with the VPN


```
Starting Nmap 6.00 ( http://nmap.org ) at 2014-08-15 21:52 BST
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 1 undergoing ARP Ping Scan
ARP Ping Scan Timing: About 100.00% done; ETC: 21:52 (0:00:00 remaining)
Nmap scan report for 0ri0n (192.168.0.14)
Host is up (0.0014s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: B8:27:EB:C4:31:50 (Raspberry Pi Foundation)

Nmap done: 1 IP address (1 host up) scanned in 2.03 seconds
```
I have temporarily opened all ports inbound and outbound for the Pi.

In regards to the link you posted with the guide - that is one of the tutorials I used to set it up but I am using Arch Linux in this install so changed it slightly.

It has been suggested that 


```
Jan 01 01:00:34 0ri0n xl2tpd[433]: xl2tpd[433]: init_network:  Unable to bind socket: Cannot assign requested address. Terminating.
```
This needs to be sorted out to enable it to work :facepalm:


----------

