|
1. Software dkms、kernel_ppp_mppe、pptpd TwoDownloadSoftware wget http://sourceforge.net/projects/poptop/files/mppe%20module%20builder/dkms-2.0.10-1/dkms-2.0.10-1.noarch.rpm/download wget http://sourceforge.net/projects/poptop/files/mppe%20module%20builder/kernel_ppp_mppe-1.0.2%20dkms-2.0.6/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm/download wget ftp://rpmfind.net/linux/epel/6/x86_64/pptpd-1.4.0-3.el6.x86_64.rpm 3. Installation 1. Install GCC yum -install gcc 2. Install DKMS rpm –ivh dkms-2.0.10-1.noarch.rpm 3. Install kernel_ppp_mppe rpm –ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm 4. Install PPTPD rpm –ivh pptpd-1.4.0-3.el6.x86_64.rpm 4. Configure the VPN server 1. Configure the master profile vim /etc/pptpd.conf at the end: debug ppp/usr/sbin/pppd option/etc/ppp/options.pptpd localip118.193.75.110 remoteip 192.168.0.2-4 Note: localip is the IP address of the local network. remoteip is the IP address range assigned to the VPN client that you are connected to. 2. Configure the account file vim /etc/ppp/chap-secrets The edit content is (* in IP represents all): # Secrets for authentication using CHAP # client server secret IP addresses Username pptpd password * Username pptpd password 192.168.0.3 Username pptpd password 192.168.0.4 3. Start the service service pptpd start 4. Check the port: netstat -ntpl The 1723 port used by PPTP listens 5. Set up NAT and turn it onLinuxKernel routing capabilities Run the following command in turn: iptables -t nat -F iptables -t nat -A POSTROUTING -s 192.168.0.2/24 -j SNAT --to 118.193.75.110 echo 1 > /proc/sys/net/ipv4/ip_forward 6. Configure VPN to start automatically Execute the command: ntsysv 7. Set iptables to allow VPN connections (or disable firewalls) Execute the command in turn: iptables-I INPUT -p tcp --dport 1723 -j ACCEPT iptables-I INPUT -p tcp --dport 47 -j ACCEPT iptables -I INPUT -p gre -j ACCEPT 8. 5. Use a VPN client to access The server IP address is 118.193.75.110 as we configured above, and the account number and password are also set in the configuration file
|