In Linux, pptp performs nat to connect to another network.

Source: Internet
Author: User
Article Title: in Linux, pptp performs nat to connect to another network persistently. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Since the PPTP protocol has some minor problems when it passes through the NAT protocol, it is impossible for multiple clients to dial a vpn server at the same time under the nat, so I thought of this method, dialed a link, and then performed nat

Install pptp and pptpconfig respectively

Rpm-ivh http://pptpclient.sourceforge.net/yum/stable/rhel5/i386/pptp-release-4-2.rhel5.noarch.rpm

Yum -- enablerepo = pptp-stable install pptpconfig

Establish dialing
Pptpsetup -- create myvpn -- server 202.96.69.40 -- username myvpnuser -- password mypasswd -- encrypt -- start

Route entry added to the VPN Network
Route add-net 192.168.0.0/24 gw 192.168.0.206

Enable IP Forwarding
Sysctl-w net. ipv4.ip _ forward = 1

Enable NAT
Iptables-t nat-a postrouting-o ppp0-j MASQUERADE

In this way, the company's network and remote private network are directly connected together. You can make a policy on the firewall to only allow specific clients to pass through.

 

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.