L2TP/IPSec CentOS6 一键安装脚本

为了IOS系统还是要准备一下l2tp的科学上网方式,毕竟有时并不方便在一些不常用的机器用SS.
支持l2tp的机器是有要求的,我用的是搬瓦工的KVM,LA的CN优化机房,速度不错.下面列举安装代码,CentOS6 32bit测试功能正常:

cat /dev/net/tun
如果返回信息为:cat: /dev/net/tun: File descriptor in bad state 说明正常
cat /dev/ppp
如果返回信息为:cat: /dev/ppp: No such device or address 说明正常
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/across/master/l2tp.sh
chmod +x l2tp.sh
./l2tp.sh
l2tp -a 新增用户
l2tp -d 删除用户
l2tp -m 修改现有的用户的密码
l2tp -l 列出所有用户名和密码
l2tp -h 列出帮助信息
ipsec status (查看 IPSec 运行状态)
ipsec verify (查看 IPSec 检查结果)
/etc/init.d/ipsec start|stop|restart|status (CentOS6 下使用)
/etc/init.d/xl2tpd start|stop|restart (CentOS6 下使用)
systemctl start|stop|restart|status ipsec (CentOS7 下使用)
systemctl start|stop|restart xl2tpd (CentOS7 下使用)
service ipsec start|stop|restart|status (Debian/Ubuntu 下使用)
service xl2tpd start|stop|restart (Debian/Ubuntu 下使用)

 

发表评论