yum install libpcap-devel ppp
wget https://www.xelerance.com/software/xl2tpd/xl2tpd-1.2.7.tar.gz
tar zxvf xl2tpd-1.2.7.tar.gz
cd xl2tpd-1.2.7
make && make install
[global]
listen-addr = 192.166.1.2
auth file = /etc/ppp/chap-secrets
debug tunnel = yes
[lns default]
ip range = 192.168.67.3-192.168.67.254
local ip = 192.168.67.2
require chap = yes
refuse pap = yes
require authentication = yes
name = xl2tpserver
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
ipcp-accept-local
ipcp-accept-remote
ms-dns 8.8.8.8
ms-dns 221.7.17.21
noccp
auth
crtscts
idle 1800
mtu 1500
mru 1500
nodefaultroute
debug
lock
logfile /var/log/l2tpd.log
proxyarp
connect-delay 5000
# client server secret IP addresses
"test" * "test" *
# 建立 /etc/init.d/xl2tpd(內容見原文),賦予執行權限
chmod +x /etc/init.d/xl2tpd
# 修正二進制路徑差異
cp /usr/local/sbin/xl2tpd /usr/sbin/
# 加入服務管理
chkconfig --add xl2tpd
chkconfig xl2tpd on
# 啟動
service xl2tpd start
/etc/ipsec.conf 與 /etc/ipsec.secrets 實現 L2TP/IPsec 雙重加密echo 1 > /proc/sys/net/ipv4/ip_forward 並寫入 /etc/sysctl.confWindows/iOS/Android 內建 VPN 客戶端新增 L2TP/IPsec 連線,輸入伺服器 IP、預共享金鑰、用戶名密碼即可撥號成功。