The Linux + centos7.2 environment

Tip: first make sure your server is out or expeditionary

Plan 1

1. Direct bosses script. Wget raw.githubusercontent.com/hwdsl2/setu…

2. Open and edit the previous three configuration items #vi vpnsetup_centos.sh

YOUR_IPSEC_PSK = ‘/ / key

YOUR_USERNAME = ‘/ / key

YOUR_PASSWORD= “// Account and password

3. Run./vpnsetup_centos.sh. If permission problems occur, #chmod +x vpnsetup_centos.sh is displayed

4. Configure the firewall

#vi /etc/sysconfig/iptables see if 192.168.0.1 or 192.168.42.1 corresponds to the following command

If yes, configure the dynamic IP address for the NAT table.

#iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

#iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -m policy –dir out –pol none -j MASQUERADE

VPN connection configuration tutorial:

Github.com/hwdsl2/setu…

Refer to the tutorial www.jianshu.com/p/12f7b66d1…