centos7-pptp安装脚本,防火墙为默认的firewall
2017-09-05 11:56
501 查看
#!/bin/bash yum -y update yum -y install epel-release yum -y install firewalld net-tools ppp pptpd # 开启内核转发 echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf sysctl -p #添加pptp的登录账号密码,账号是admin 密码admin888 echo 'admin * admin888 *' >> /etc/ppp/chap-secrets #开启虚拟IP分配 cat >>/etc/pptpd.conf <<END localip 192.168.2.1 remoteip 192.168.2.10-100 END #添加 pptp 的DNS解析服务器 格式:ms-dns 8.8.8.8 ,ip改为你自己的可以了 cat >>/etc/ppp/options.pptpd <<END # ms-dns 202.12.27.33 ms-dns 8.8.8.8 ms-dns 8.8.4.4 END # Firewall 通过防火墙规则 ens=$(ls /etc/sysconfig/network-scripts/ | grep 'ifcfg-e.*[0-9]' | cut -d- -f2) systemctl restart firewalld.service systemctl enable firewalld.service firewall-cmd --set-default-zone=public firewall-cmd --add-interface=m=$ens firewall-cmd --add-port=1723/tcp --permanent firewall-cmd --add-masquerade --permanent firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i $ens -p gre -j ACCEPT firewall-cmd --reload # cat > /etc/ppp/ip-up.local << END /sbin/ifconfig $1 mtu 1400 END chmod +x /etc/ppp/ip-up.local systemctl restart pptpd.service systemctl enable pptpd.service
相关文章推荐
- centos7 pptp安装脚本,防火墙使用firewall
- centos7最小化安装优化脚本(使用firewall防火墙)
- centos7 关闭firewall防火墙指令以及更换安装iptables并配置
- centos7 关闭firewall防火墙指令以及更换安装iptables并配置
- Ubuntu默认防火墙安装、启用、配置、端口、查看状态相关信息
- CentOS7安装iptables防火墙
- ubuntu 默认防火墙安装、启用、查看状态
- CentOS7安装iptables防火墙
- centos7 yum 安装 mongodb 脚本
- centos7 关闭firewall安装iptables并配置
- CentOS7系统中关闭firewall,并使用iptables管理防火墙
- CentOS之——CentOS7安装iptables防火墙
- CentOS 7 下 安装Webmin 启动防火墙失败----Applying firewall rules:iptables-restore:line 2 failed
- ubuntu 默认防火墙安装、启用、查看状态
- CentOS7安装iptables防火墙
- CentOS7安装iptables防火墙