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