How to configure VPN under UbuntuVPS

Source: Internet
Author: User
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

  1. $ Sudo apt-get install pptpd

Edit the configuration file:

  1. $ Sudo vi/etc/pptpd. conf

Find the bottom and modify the ip Address:

  1. Localip your host ip
  2. Remoteip 10.100.0.2-10

Ip segment allocated by the second Behavior

Set dns

  1. $ Sudo vi/etc/ppp/pptpd-options

Modify the following to google dns:

  1. Ms-dns 8.8.8.8
  2. Ms-dns 8.8.4.4

Set Account:

  1. $ Sudo vi/etc/ppp/chap-secrets

Add a line, followed by the user name, service, password, and restricted ip Address:

  1. "User" pptpd "user "*

Restart the service:

  1. $ Sudo/etc/init. d/pptpd restart

Configure forwarding:

  1. $ Sudo vi/etc/sysctl. conf

Remove the comments of this line in the file:

  1. Net. ipv4.ip _ forward = 1

Make it take effect immediately:

  1. Sudo sysctl-p

Install iptables:

  1. Sudo apt-get install iptables

Create a NAT:

  1. 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:

  1. 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.

  1. Sudo vi/etc/network/interfaces

Add at the end:

  1. Pre-up iptables-restore

Set MTU to prevent the package from being too large:

  1. 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:

  1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.