hwdsl2 / docker-ipsec-vpn-server

Docker image to run an IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
https://hub.docker.com/r/hwdsl2/ipsec-vpn-server
Other
6.43k stars 1.39k forks source link

Can't connect to VPN server #189

Closed ghost closed 4 years ago

ghost commented 4 years ago

I have just created the docker image of the VPN. I am unable to connect via my laptop or my smartphone.

Server info:

Distributor ID: Ubuntu Description: Ubuntu 18.04.4 LTS Release: 18.04 Codename: bionic

Docker Log:

Redirecting to: /etc/init.d/ipsec start Starting pluto IKE daemon for IPsec: . xl2tpd[1]: setsockopt recvref[30]: Protocol not available xl2tpd[1]: This binary does not support kernel L2TP. xl2tpd[1]: xl2tpd version xl2tpd-1.3.6 started on 183da3bce39e PID:1 xl2tpd[1]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc. xl2tpd[1]: Forked by Scott Balmos and David Stipp, (C) 2001 xl2tpd[1]: Inherited by Jeff McAdams, (C) 2002 xl2tpd[1]: Forked again by Xelerance (www.xelerance.com) (C) 2006 xl2tpd[1]: Listening on IP address 0.0.0.0, port 1701

I have opened both ports on the server firewall using ufw.

Any ideas what it could be?

cdoer commented 4 years ago

try it

docker run \
    --name vpn \
    --restart=always \
    -p 500:500/udp \
    -p 4500:4500/udp \
    -p 1701:1701/udp \
    -v "/root/l2tp-server/vpn.env:/opt/src/vpn.env:ro" \
    -d --privileged \
    hwdsl2/ipsec-vpn-server

/root/l2tp-server/vpn.env is you vpn.env file

ghost commented 4 years ago

That didn't work either. End up with:

Redirecting to: /etc/init.d/ipsec start
Starting pluto IKE daemon for IPsec: Initializing NSS database
xl2tpd[1]: Not looking for kernel SAref support.
xl2t[1]: Using l2tp kernel support.
xl2tpd[1]: xl2tpd version xl2tpd-1.3.12 started on 99df409c4089 PID:1
xl2tpd[1]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc.
xl2tpd[1]: Forked by Scott Balmos and David Stipp, (C) 2001
xl2tpd[1]: Inherited by Jeff McAdams, (C) 2002
xl2tpd[1]: Forked again by Xelerance (www.xelerance.com) (C) 2006-2016
xl2tpd[1]: Listening on IP address 0.0.0.0, port 1701
ghost commented 4 years ago

When using IPVoid I can see that the ports are open and accessible from outside.

hwdsl2 commented 4 years ago

@TachyonRSA Hello! Please see [1] for the correct way to use this Docker image. If unable to connect, you may enable and check Libreswan logs [2] for errors. If no new logs appear after trying to connect, then it's most likely a firewall or network issue between your VPN client and server. The two ports UDP 500 and UDP 4500 are required for the IPsec VPN.

[1] https://github.com/hwdsl2/docker-ipsec-vpn-server#how-to-use-this-image [2] https://github.com/hwdsl2/docker-ipsec-vpn-server#enable-libreswan-logs