Linux Virtual Private network experiment for PPTP VPN

Source: Internet
Author: User
Tags iptables firewall linux

The English full name of the VPN is "virtual private network", translation comes from "The fictitious specialized network". As the name suggests, virtual private network we can understand it as a virtual out of the enterprise internal line. It can establish a proprietary communication line between two or more corporate intranets that are connected to the Internet in different places via a special encrypted communication protocol, like a dedicated line, but it does not need to actually lay out physical wiring such as optical cables. This is like going to the Telecommunications Bureau to apply for a special line, but not the cost of laying the line, and do not buy routers and other hardware equipment. The core of VPN is to use public network to establish virtual private network.

Experimental environment: A Linux server (equipped with a firewall), a Windows client.

Linux System for Enterprise version 4

1. Software Installation

Install the RPM package. Note: The RPM packages are installed in sequence. With kernel installation last.

The order in which the RPM packages are installed is:

(1). dkms-2.0.5-1.noarch.rpm

(2). pptpd-1.3.0-0.i386.rpm

(3). ppp-2.4.3-5.rhel4.i386.rpm

(4). kernel_ppp_mppe-0.0.5-2dkms.noarch.rpm

Installation command: First with RPM–IVH installation, if the prompts do not, and then use RPM–UVH to install

Because, some of the packages are already in the system, with-U is the upgrade package.

2, first edit the file:/etc/pptpd.conf just add two lines at the end of the file:

IP address of the Localip +linux server

REMOTEIP + IP Address segment that allows dial-in through VPN. Note Format: Example: 192.168.0.1-250

Create a user.

#vi/etc/ppp/chap-secrets

In which to add: "User" pptpd "passwd" "*"

The username created by user, passwd the password for the user name created.

3, start the service: #service pptpd restart

4, testing

Create a connection over a VPN connection on the Windows computer. Log in with the user name and password you created.

Problem: Often VPN to do the network close, the network closes and has the firewall, how lets the firewall allow VPN to pass?

Add: (Input chain default drop,output chain default Accept, if output drop repeat input chain do)

/sbin/modprobe Ip_gre

/sbin/iptables-a input-p tcp-m multiport--dport 1723,500,47-i $INET _dev-j ACCEPT

/sbin/iptables-a input-p gre-j ACCEPT

/sbin/iptables-a input-d 127.0.0.1-j ACCEPT

($INET _dev for firewalls connected to the Internet)

Note: Be sure to add loopback interface, user and password authentication required.

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.