centos 快速部署L2TP服务
在CentOS上快速部署l2tp服务
- 安装必要的工具
yum install vim net-tools wget unzip -y - 下载安装脚本,下载地址是http://files.cnblogs.com/files/think8848/StackScript.zip
wget -O StackScript.zip http://files.cnblogs.com/files/think8848/StackScript.zip - 解压文件
unzip StackScript.zip - 执行安装文件
chmod +x StackScript
./StackScript
脚本运行完,会显示密钥,用户名和密码以及服务器ip地址。这些都是笔者在里面写好的,可以根据自己的需求修改。
a. 先修改PSK,将PSK后面的字符替换掉
vim /etc/ipsec.secrets
b. 修改用户名和密码 ,将用户名和密码修改为自已想要的字符
vim /etc/ppp/chap-secrets
c. 重启IPsec和xl2tpd服务
systemctl restart ipsec xl2tpd
d. 将客户端的PSK、用户名、密码换成新的再连,应该就能上了。
注意如果开启了防火墙,需要在防火墙里面放行l2tp端口。
iptables -I INPUT -p tcp --dport 500 -j ACCEPT
iptables -I INPUT -p tcp --dport 4500 -j ACCEPT
iptables -I INPUT -p tcp --dport 1701 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart
如若脚本地址有变化,可以编辑如下脚本运行即可
部署脚本
#!/bin/bash
#<UDF name="×××_IPSEC_PSK" Label="IPsec Pre-Shared Key" />
#<UDF name="×××_USER" Label="××× Username" />
#<UDF name="×××_PASSWORD" Label="××× Password" />
if [ -f /etc/apt/sources.list ]; then
url=setup
apt-get -y update
apt-get -y install wget
elif [ -f /etc/yum.conf ]; then
url=setup-centos
yum -y install wget
else
echo "Your distribution is not supported by this StackScript"
exit 1
fi
wget "https://git.io/$url" -O /tmp/.sh && sh /tmp/.sh && rm -f /tmp/***.sh
#Fix xl2tpd on CentOS 7 for Linode VMs, because kernel module
#l2tp_ppp is not available in the default Linode kernel
if grep -qs "release 7" /etc/redhat-release; then
if [ -f /usr/lib/systemd/system/xl2tpd.service ]; then
sed -i '/ExecStartPre/s/^/#/' /usr/lib/systemd/system/xl2tpd.service
systemctl daemon-reload
systemctl restart xl2tpd
fi
fi
- centos快速部署ftp服务带用户验证
- 使用Kickstart安装脚本全自动快速部署CentOS 6.0
- 在Ubuntu上部署L2TP服务
- centos 6.9 快速部署lnmp网站
- CentOS 7使用ceph-deploy(1.5.37)部署快速ceph(10.2.6)
- Centos下Svn服务部署方案
- 【转】Rancher部署Træfik实现微服务的快速发现
- 快速在centos下用yum搭建svn服务
- 快速部署远程同步服务Rsync
- centos 使用sshfs快速搭建文件共享服务
- centos6.5部署openldap信息存储主机快速登录
- CentOS 6.3下nginx、php-fpm、drupal快速部署
- zookeeper3.4.6分布式数据一致性服务集群在CentOS6.5上部署(何志雄)
- 云服务灵活、可靠、高扩展性、支持开源、按需付费体系、快速部署、独有的混合云模式是其优势所在
- linux(centos6.5)下部署springboot jar包用 *.sh 文件启动项目并将项目做成开机自启动服务
- Centos 6 常用服务部署命令说明