OpenVPN client configuration tutorial for OpenVPN in Ubuntu cannot access both the Intranet and the Internet at the same time. http: // www
Ubuntu OpenVPN client configuration tutorial http://www.linuxidc.com/Linux/2013-06/86562.htm
Build OpenVPN http://www.linuxidc.com/Linux/2012-11/74790.htm in Ubuntu 10.04
Ubuntu 13.04 VPN (OpenVPN) configuration and connection cannot simultaneously access the internal and external network problems http://www.linuxidc.com/Linux/2013-07/86899.htm
How to build a secure remote network architecture http://www.linuxidc.com/Linux/2013-11/92646.htm with OpenVPN in Linux
Install pptpd
- $ Sudo apt-get install pptpd
Edit the configuration file:
- $ Sudo vi/etc/pptpd. conf
Find the bottom and modify the ip Address:
- Localip your host ip
- Remoteip 10.100.0.2-10
Ip segment allocated by the second Behavior
Set dns
- $ Sudo vi/etc/ppp/pptpd-options
Modify the following to google dns:
- Ms-dns 8.8.8.8
- Ms-dns 8.8.4.4
Set Account:
- $ Sudo vi/etc/ppp/chap-secrets
Add a line, followed by the user name, service, password, and restricted ip Address:
- "User" pptpd "user "*
Restart the service:
- $ Sudo/etc/init. d/pptpd restart
Configure forwarding:
- $ Sudo vi/etc/sysctl. conf
Remove the comments of this line in the file:
- Net. ipv4.ip _ forward = 1
Make it take effect immediately:
- Sudo sysctl-p
Install iptables:
- Sudo apt-get install iptables
Create a NAT:
- Sudo iptables-t nat-a postrouting-s 10.100.0.0/24-o eth0-j MASQUERADE
Save the rule so that the rule will not be lost after restart:
- Sudo iptables-save>/etc/iptables-rules
If the following message is displayed:-bash:/etc/iptables-rules: Permission denied, you can use the root user command: su-enter the root user to save
Edit the NIC file and automatically load the rules when the NIC is loaded.
- Sudo vi/etc/network/interfaces
Add at the end:
- Pre-up iptables-restore
Set MTU to prevent the package from being too large:
- Sudo iptables-a forward-s 10.100.0.0/24-p tcp-m tcp -- tcp-flags SYN, rst syn-j TCPMSS -- set-mss 1200
If it is set, remember to save:
- Sudo iptables-save>/etc/iptables-rules
Macos can be connected, but there is no problem with sending and receiving packets, that is, you can connect to the VPN and cannot access the Internet: in vpn advanced, select send all traffic
So far.
Kunyu (http://blog.kunyu.li/digitalocean-ubuntu-vps-vpn.html)
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-07/104193.htm