Construction of different network segment PPTP servers in Linux

Source: Internet
Author: User

PPTP server

Intranet ETH0:192.168.0.10/24 (192.168.0.1 is Gateway)

Public network Eth1:xxx.xxx.xxx.xxx

IP:192.168.3.0/24 assigned after client has unplugged PPTP

IP:192.168.5.0/24 used before the user has unplugged PPTP


#yum Install PPP Libcap-devel LIBCAP


#echo 1 >/proc/sys/net/ipv4/ip_forward

#wget http://nchc.dl.sourceforge.net/project/poptop/pptpd/pptpd-1.3.4/pptpd-1.3.4.tar.gz

#tar ZXF pptpd-1.3.4.tar.gz

#cd pptpd-1.3.4

#./configure--prefix=/usr/local/pptpd--enable-bcrelay--with-libwrap

#make && make Install

#cp pptpd-1.3.4/samples/pptpd.conf/etc/ppp/

#cp pptpd-1.3.4/samples/options.pptpd/etc/ppp/

#cp pptpd-1.3.4/samples/chap-secrets/etc/ppp/


#vim pptpd.conf

Ppp/usr/sbin/pppd

Option/etc/ppp/options.pptpd

#debug

# Stimeout 10

# logwtmp

Localip Client to access IP (PPTP server IP)

Remoteip 192.168.3.100-200 (IP assigned by client)

------------------------------------------------

#vim options.pptpd

Name PPTPD

Refuse-pap

Refuse-chap

Refuse-mschap

Require-mschap-v2

require-mppe-128

Ms-dns 114.114.114.114 (DNS assigned to the client)

Proxyarp

#debug

Dump

Lock

Nobsdcomp

Novj

Novjccomp

Nologfd

------------------------------------------------

#vim chap-secrets

# Client Server Secret IP addresses

#username pptpd Password *


Adminpptpdadmin123*

------------------------------------------------


Iptables settings

Iptables-a input-j ACCEPT

Iptables-a forward-j ACCEPT

Iptables-a output-j ACCEPT

Iptables-a Postrouting-j Masquerade (key)

Iptables-a postrouting-s 192.168.3.0/24-j SNAT--to-source public network IP (key)


------------------------------------------------

Routing settings

Eth0 settings

ipaddr=192.168.0.10

netmask=255.255.255.0(intranet without gateway)


eth1 settings

Ipaddr=xxx.xxx.xxx.xxx

Netmask=xxx.xxx.xxx.xxx

Gateway=xxx.xxx.xxx.xxx(default route)



Add route

Route add-net 192.168.5.0/24 GW 192.168.0.1

Route add-net 192.168.3.0/24 GW 192.168.0.1


Construction of different network segment PPTP servers in Linux

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.