L2TP技术

L2TP技术

1、安装l2tp软件包:
[root@dp ~]# yum install xl2tpd -y

2、修改配置:
[root@dp ~]# vim /etc/xl2tpd/xl2tpd.conf           #分为LAC和LNS两种,我们这里是LNS

[lns default]
ip range = 172.18.1.100-172.18.1.200   ;分配给用户的虚拟ip
local ip = 172.18.1.254           ;本地ppp接口地址
;require chap = yes                ;这里我注释,并在控制文件中设置
;refuse pap = yes                  ;如上
;require authentication = yes      ;如上
name = LinuxVPNserver
ppp debug = yes
pppoptfile = /etc/ppp/options.xl2tpd   ;控制文件,可自定义
length bit = yes

[root@dp ~]# vim /etc/ppp/options.xl2tpd          #添加认证策略,验证文件

ipcp-accept-local
ipcp-accept-remote
ms-dns  8.8.8.8   #dns
# 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           
#refuse-pap         #拒绝pap
#require-chap       #允许chap
require-mschap-v2   #只允许微软的mschap-v2认证

idle 1800
mtu 1500
mru 1500
nodefaultroute     #默认路由
debug
#lock
proxyarp
connect-delay 5000

3、添加用户及密码:
[root@dp ~]# vim /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
  user1         *        123456                 *
  user2         *        123456                 *
  user3         *        123456                 172.18.1.199  #分配指定地址

4、启动服务,查看状态并连接测试:

[root@dp ~]# systemctl start xl2tpd
[root@dp ~]# netstat -anupl | grep xl2tpd
udp        0      0 0.0.0.0:1701            0.0.0.0:*                           4354/xl2tpd         
[root@dp ~]# 
[root@dp ~]# firewall-cmd --zone=public --add-port=1701/udp  --permanent
success
[root@dp ~]# firewall-cmd --reload
success
[root@dp ~]# 

在这里插入图片描述
在这里插入图片描述
拨号成功后就会有对应的接口地址:

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1400
        inet 172.18.1.254  netmask 255.255.255.255  destination 172.18.1.100
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 8  bytes 248 (248.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 70 (70.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@dp ~]# 
[root@dp ~]# 

IPSEC安全配置:

centos端配置参考:https://blog.csdn.net/zdl244/article/details/103163256

windwos客户端配置:
在这里插入图片描述
-------------------------------------------------------------------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zdl244

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值