centos8 l2tp客户端拨号

参考链接:
https://blog.kelu.org/tech/2021/05/23/linux-l2tp-client.html
https://www.cnblogs.com/th-lyc/p/11226464.html

1.安装

yum -y install xl2tpd ppp

2.修改配置文件,默认的全部删除,新建下面的

cat >>/etc/xl2tpd/xl2tpd.conf<<EOF
[global]

[lac testvpn]
name = user1
lns = 1.1.1.10
pppoptfile = /etc/ppp/peers/testvpn.l2tpd
ppp debug = yes

EOF

3.用户配置文件

cat >>/etc/ppp/peers/testvpn.l2tpd <<EOF
remotename testvpn
user "user3"
password "123456"
unit 0
nodeflate
nobsdcomp
noauth
persist
nopcomp
noaccomp
maxfail 5
debu
EOF

4.启动

systemctl start xl2tpd
systemctl enable xl2tpd

5.开始拨号

echo 'c testvpn' > /var/run/xl2tpd/l2tp-control

6.拨号成功查看接口

ifconfig ppp0

7.断开拨号

echo 'd testvpn' > /var/run/xl2tpd/l2tp-control

posted @ 2025-03-04 21:54  KuangZhuMing2  阅读(43)  评论(0)    收藏  举报