Ubuntu builds vpn, PPTP

Build environment: ubuntu 14.04

1. After root account login

2. Install PPTPD
apt-get install pptpd

3. Edit pptpd.conf file, vi /etc/pptpd.conf
uncomment the following three lines
option /etc/ppp/pptpd- options
localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245 4. Add a



login account, vi /etc/ppp/chap-secrets
# client server secret IP addresses
username pptpd password space or tab separated. The asterisk (*) means that the ip allowed to access can be any ip. Multiple accounts can be added. 5. Set DNS, find ms-dns in vi /etc/ppp/pptpd-options , uncomment it, and modify the DNS address 6. Enable forwarding, uncomment the following in vi /etc/sysctl.conf to enable internal and ip forwarding: net.ipv4.ip_forward=1 7. Install iptables apt-get install iptables and set:















iptables -t nat -I POSTROUTING -j MASQUERADE
iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356
iptables -A FORWARD -s 192.168.0.0/24 -p tcp -m tcp - -tcp-flags SYN, RST SYN -j TCPMSS --set-mss 1200

Use iptables-save to save the rules: iptables-save > /etc/iptables-rules


8. Restart the service
/etc/init.d/pptpd restart The

installation is complete , connect to the vpn test.


Reprinted by Jiangsu Sanai Network

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326443789&siteId=291194637
VPN