Sure ??? ? Can we quickly complete the pptp VPNServer rack? : Ppp -??? C? F (Point-to-PointProtocol) pptpd -??? C Channel? F (Point-to-PointTunnelingProtocol) iptables -? Fixed packets ???? T? Step? 1. sentence? Available ppp: $ cat/dev/pppcat:/dev/ppp: N
Sure ??? ? Can the VPN Server rack of pptp be quickly completed? :
Ppp -??? C? F (Point-to-Point Protocol)
Pptpd -??? C Channel? F (Point-to-Point Tunneling Protocol)
Iptables -? Fixed packets ???? T
Ann? Step?
1. sentence? Availability of ppp:
$ cat /dev/pppcat: /dev/ppp: No such device or address
If? With the above one? Scratching? Information "No such device or address", No ?? Module? @ Indicates that ppp is available and can be mounted normally? Pptp. If? "Permission denied" indicates what is ppp ?? You can skip the following steps.
2. question? Ppp? Iptables
$ yum -y install ppp iptables$ cp -rpf /etc/sysconfig/iptables /etc/sysconfig/iptables.pptpsave$ cd /usr/src
3 .? According to your system ?? Context ?? Integrated pptp Suite:
# for CentOS 6.x 32bit$ wget http://poptop.sourceforge.net/yum/stable/rhel6/i386/pptpd-1.3.4-2.el6.i686.rpm# for CentOS 6.x x64$ wget http://poptop.sourceforge.net/yum/stable/rhel6/x86_64/pptpd-1.3.4-2.el6.x86_64.rpm# for CentOS 5.x 32bit$ wget http://poptop.sourceforge.net/yum/stable/rhel5/i386/pptpd-1.3.4-2.rhel5.i386.rpm# for CentOS 6.x x64$ wget http://poptop.sourceforge.net/yum/stable/rhel5/x86_64/pptpd-1.3.4-2.rhel5.x86_64.rpm
Above? Some ?? If it fails, it may be that the version is updated ,? Go to poptop? Station ?, Or? Power d ?.
4. Question Mark? Last ?? Step? Under? Pptp Suite:
$ rpm -ivh pptpd-1.3.4-2.el6.i686.rpm
5 .?? "/Etc/sysctl. conf", find:
net.ipv4.ip_forward = 0
? ⑨ Defaults 0 to 1
6. all the following commands? It goes down:
sysctl -pecho "localip 192.168.240.1" >> /etc/pptpd.confecho "remoteip 192.168.240.101-200" >> /etc/pptpd.confecho "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpdecho "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpdiptables --flush POSTROUTING --table natiptables --flush FORWARDiptables -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPTiptables -A INPUT -p gre -j ACCEPTiptables -t nat -A POSTROUTING -s 192.168.240.0/24 -o eth0 -j MASQUERADEservice iptables saveservice pptpd restartservice iptables restartchkconfig pptpd onchkconfig iptables on
Above? Some commands ??? Create one ?? 192.168.240? Section ?? Upper? Why is vpn used? Too many tasks? K transparent? Eth0 on Server? Send? Packet (Forward ).
?? Are you sure you want to play the game? And ??? What do you want to add to the VPN ??? Why ?.
Join VPN? Why?
?? "/Etc/ppp/chap-secrets" to join the VPN? Why ?, 1 ??? Why? A row in the format ??
? Why? Name?PptpdPassword?*
For example, I want to add one ??? Why ?? "Vpn", password ?? "Test123 ",? T you only need to add a line in "/etc/ppp/chap-secrets:
vpn pptpd test123 *
After joining, don't try again ?? Pptpd, you can use pptp on the Client side? F depends on VPN ?? To? Server.
??? Y?
?? After success, can you? Go to ip.calm9.com to check whether you are using the IP address of the VPN Server ?.
Below ???? D's ???? I used linode? Use? Why? The created VPS is located in "Japan ":
Iptables ?? T? Ming
? Step? In? 3? L Command is the most important iptables ?? T:
iptables -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPTiptables -A INPUT -p gre -j ACCEPTiptables -t nat -A POSTROUTING -s 192.168.240.0/24 -o eth0 -j MASQUERADE
Because? Is pptp a GRE (Generic Routing Encapsulation) packet? Port 1723? OK? Why ?,? K and? Yes? Set the VPN? Where is the segment ??? Router interface? Send? ν Badam ?? /P> ??? Management
In? Vpn? R, if? 807 ??, Or another one is in ??? Why? Password? Before? ??, If? Not yourself ?? ???, You can ?? /Etc/sysconfig/iptables, View ??? L ?? T is positive? Outbound? In? N case? Surface:
-A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT-A INPUT -p gre -j ACCEPT
? K and ??? L ?? T cannot be in any "-a input-j REJECT ?? T. If yes ?? Situation ,? Move it above "-a input-j reject.
? Grandma? Yun? Too many ?? Iptables:
service iptables restart