How to configure xl2tpd in linux servers :
1 Install XL2TPD
yum install xl2tpd -y
2 Configure L2TP
Modify /etc/xl2tpd/xl2tpd.conf, enter the following into the file:
[global]
listen-addr = 10.5.1.2 #server internal IP
ipsec saref = no
auth file = /etc/ppp/chap-secrets #use the user/pwd in the ppp
port = 1701
[lns default]
ip range = 10.5.1.100-10.5.1.120 #vpn client IP range
local ip = 10.5.1.2 #local server internal ip
require chap = yes
refuse pap = yes
require authentication = yes
name = xiaoclouding.com
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
3 Modify, create if not exist, /etc/ppp/option.xl2tpd, enter the following configuration equire-mschap-v2
ipcp-accept-local
ipcp-accept-remote
ms-dns 10.5.1.2 #enter your server as dns
ms-dns 10.5.1.1 #enter your router as dns
ms-dns 8.8.4.4
ms-dns 8.8.8.8
noccp
auth
crtscts
idle 1800
mtu 1410
mru 1410
nodefaultroute
lock
proxyarp
connect-delay 5000
4 Create a new login username and password in /etc/ppp/chap-secrets
5 Configure firewall iptables /etc/sysconfig/iptables
Add following rules to the file
-A INPUT -p udp -m state --state NEW -m udp --dport 1701 -j ACCEPT
-A FORWARD -s 10.5.1.0/24 -j ACCEPT
-A POSTROUTING -s 10.5.1.0/24 -o em1 -j MASQUERADE
6 Restart firewall
/sbin/service iptables restart
7 Start xl2tpd
/sbin/service xl2tpd start
start xl2tpd in debug mode
xl2tpd -D
8 Monitor the log
/var/log/secure
/var/log/pluto.log
Finally njoy !!!