Xen vps (Linux)-install pptpd VPN on Ubuntu/Debian

Source: Internet
Author: User

Now I have changed Ubuntu 9.10, and the previous method is not very useful. Fortunately, I found the VPN introduction written by users who are also Linode Ubuntu 9.10 On the website. It has been tested before.


First, make sure that your vps has been following Getting Started With Linode

This article provides preliminary preparations. For VPN installation, you must set the update source. Edit your/etc/apt/sources. list file and remove the comments of all rows after "# universe repositories" to make the file the same as the following. Of course, this step needs to be completed with sudo or root, and all subsequent commands are like this.

# Main & restricted repositories
Deb http://us.archive.Ubuntu.com/ubuntu/ karmic main restricted
Deb-src http://us.archive.ubuntu.com/ubuntu/ karmic main restricted

Deb http://security.ubuntu.com/ubuntu karmic-security main restricted
The deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted

# Universe repositories
Deb http://us.archive.ubuntu.com/ubuntu/ karmic universe
Deb-src http://us.archive.ubuntu.com/ubuntu/ karmic universe
Deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates universe
Deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates universe

Deb http://security.ubuntu.com/ubuntu karmic-security universe
The deb-src http://security.ubuntu.com/ubuntu karmic-security universe

Run the following command to update your software package database.
Apt-get update

Now we can officially install the VPN server. Here we choose pptp (a vpn protocol), because it is simple, it can be done with one command. The rest is nothing more than some configurations.
Apt-get install pptpd

After pptpd is installed, edit the/etc/pptpd. conf file, remove the comments from the following two lines, or directly add the two lines (at the end of the file ). This step is to configure the IP address range.
Localip 192.168.0.1
Remoteip 192.168.0.234-238,192.168 .0.245

Then, add the vpn user to the/etc/ppp/chap-secrets file, in the following format, one row for each user.
Username pptpd password * to enable your user to resolve the domain name after connecting to the VPN, We need to manually set the DNS. edit/etc/ppp/options, find the ms-dns option, and set your DNS. here I recommend Public DNS recently released by Google because it is easy to remember.


Ms-dns 8.8.8.8
Ms-dns 8.8.4.4

Edit the/etc/sysctl. conf file, find the line "net. ipv4.ip _ forward = 1", and remove the preceding comment.
Net. ipv4.ip _ forward = 1

Run the following command to make the configuration take effect.
Sysctl-p

Restart pptpd
/Etc/init. d/pptpd restart

Enable iptables forwarding
/Sbin/iptables-t nat-a postrouting-s 192.168.0.0/24-o eth0-j MASQUERADE

 

Okay. After the installation is complete, apply the VPN connection ~ VPN in hand ~ Everything is not worrying ~~~

Related Article

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.