PPTP要求互联网络为IP网络。L2TP只要求隧道媒介提供面向数据包的点对点的连接。L2TP可以在IP(使用UDP),帧中继永久虚拟电路(PVCs),X.25虚拟电路(VCs)或ATM VCs网络上使用。
PPTP只能在两端点间建立单一隧道。L2TP支持在两端点间使用多隧道。使用L2TP,用户可以针对不同的服务质量创建不同的隧道。
L2TP可以提供包头压缩。当压缩包头时,系统开销(overhead)占用4个字节,而PPTP协议下要占用6个字节。
L2TP可以提供隧道验证,而PPTP则不支持隧道验证。但是当L2TP或PPTP与IPSEC共同使用时,可以由IPSEC提供隧道验证,不需要在第2层协议上验证隧道
L2TP访问集中器(L2TP Access Concentrator,LAC)是一种附属在网络上的具有PPP端系统和L2Tpv2协议处理能力的设备,它一般就是一个网络接入服务器软件,在远程客户端完成网络接入服务的功能。
L2TP网络服务器(L2TP Network Server,LNS)是用于处理L2TP协议服务器端的软件。
#安装epel源
rpm -ivh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
#关闭防火墙
service iptables stop
#关闭SELinux
setenforce 0
#开启数据包转发
sysctl -w net.ipv4.ip_forward=1
yum install xl2tpd -y
[lns default]
ip range = 10.8.0.100-200 #VPN客户的分配的IP地址
local ip = 10.8.0.1 #L2TP VPN服务器的地址
require chap = yes
refuse pap = yes
require authentication = yes
name = L2TPVPNserver
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes
ipcp-accept-local
ipcp-accept-remote
ms-dns 114.114.114.114
# ms-dns 192.168.1.1
# ms-dns 192.168.1.3
# ms-wins 192.168.1.2
# ms-wins 192.168.1.4
noccp
auth
crtscts
idle 1800
mtu 1410
mru 1410
nodefaultroute
debug
lock
proxyarp
connect-delay 5000
logfile /var/log/xl2tpd.log
# Secrets for authentication using CHAP
# client server secret IP addresses
vpn * 123456 *
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
service xl2tpd start
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1026/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1114/master
tcp 0 52 192.168.1.10:22 192.168.1.36:62256 ESTABLISHED 1733/sshd
udp 0 0 0.0.0.0:1701 0.0.0.0:* 2378/xl2tpd