如何在CentOS上快速部署l2tp服务

在CentOS上快速部署l2tp服务


1. 安装必要的工具

yum install vim net-tools wget unzip -y

2. 下载安装脚本,下载地址是http://files.cnblogs.com/files/think8848/StackScript.zip

wget -O StackScript.zip http://files.cnblogs.com/files/think8848/StackScript.zip

3. 解压文件

unzip StackScript.zip

4. 执行安装文件

chmod +x StackScript

./StackScript

要说Linux有什么好,那就是在768M的内存上,居然还能跑的唰唰的,这要是Windows Server,估计会卡出来翔!

稍等片刻,安装完成

5. 用Windows 10测试一下连接,这里要提前大家,一定要按照教程配置客户端。

6. 然而这个安装脚本是从Linode上拔下来的,PSK、用户名和密码都让人很难受,现在要换成我们自已想要的

a. 先修改PSK,将PSK后面的字符替换掉

vim /etc/ipsec.secrets

b. 修改用户名和密码 ,将用户名和密码修改为自已想要的字符

vim /etc/ppp/chap-secrets

c. 重启IPsec和xl2tpd服务

systemctl restart ipsec xl2tpd

d. 将客户端的PSK、用户名、密码换成新的再连,应该就能上了。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
可以按照以下步骤在 CentOS快速部署 L2TP 服务: 1. 安装 L2TP 和 PPTP 服务 ``` yum install xl2tpd ppp pptpd ``` 2. 配置 xl2tpd 编辑 `/etc/xl2tpd/xl2tpd.conf` 文件,将以下内容添加到文件末尾: ``` [global] ipsec saref = no [lns default] ip range = 192.168.42.10-192.168.42.20 local ip = 192.168.42.1 require chap = yes refuse pap = yes require authentication = yes name = l2tpd ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes ``` 3. 配置 ppp 创建 `/etc/ppp/options.xl2tpd` 文件,并将以下内容添加到文件中: ``` require-mschap-v2 ms-dns 8.8.8.8 ms-dns 8.8.4.4 proxyarp mtu 1400 mru 1400 auth name l2tpd password l2tpdpassword ``` 注意将 `l2tpdpassword` 改为你自己的密码。 4. 配置 pptpd 编辑 `/etc/pptpd.conf` 文件,将以下内容添加到文件末尾: ``` localip 192.168.42.1 remoteip 192.168.42.100-200 ``` 5. 配置 chap-secrets 编辑 `/etc/ppp/chap-secrets` 文件,将以下内容添加到文件末尾: ``` username l2tpd password * ``` 注意将 `l2tpd` 和 `password` 改为你自己的用户名和密码。 6. 启动服务 ``` systemctl start pptpd systemctl start xl2tpd ``` 7. 配置防火墙规则 ``` iptables -A INPUT -p udp --dport 1701 -j ACCEPT iptables -A INPUT -p udp --dport 500 -j ACCEPT iptables -A INPUT -p udp --dport 4500 -j ACCEPT iptables -A INPUT -p gre -j ACCEPT iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu ``` 完成以上步骤后,即可在 CentOS快速部署 L2TP 服务

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值