Official website of Pptpclient
Pptpclient official http://pptpclient.sourceforge.net/howto-diagnosis.phtml#pppd_options
1. use yum to install ppp and pptp packages
Yum-y install ppp
Yum-y install pptp
If yum does not have pptp, go to the http://pptpclient.sourceforge.net to download the installation, here we recommend using rpm package.
I installed using: http://sourceforge.net/projects/pptpclient/files/pptp/pptp-1.7.2/pptp-1.7.2-3.rhel5.i386.rpm/download
Rpm-ivh./pptp-1.7.2-3.rhel5.i386.rpm
2. configure pptp
Pptpsetup -- create vpn connection name (custom) -- server VPN server IP -- username VPN user name -- password VPN password
After the execution is complete, the file/etc/ppp/peers/vpn connection name will be generated (custom)
Edit the file:
Vi/etc/ppp/peers/vpn connection name (custom)
Modify and complete the file as follows:
# Written by pptpsetup
Pty "pptp VPN server IP -- nolaunchpppd"
Lock
# Noauth
Nobsdcomp
Nodeflate
Name VPN user name
Remotename vpn connection name (custom)
Ip address of the ipparam server
Require-mppe-128
Refuse-pap
Refuse-chap
Refuse-eap
Refuse-mschap
Edit the/etc/ppp/chap-secrets file
Vi/etc/ppp/chap-secrets
The content is as follows:
# Secrets for authentication using CHAP
# Client server secret IP addresses
VPN username vpn connection name (custom) "VPN password "*
3. copy commands
Cp/usr/share/doc/ppp-2.4.4/scripts/pon/usr/sbin/
Cp/usr/share/doc/ppp-2.4.4/scripts/poff/usr/sbin/
Chmod + x/usr/sbin/pon/usr/sbin/poff
4. dial vpn
Pon vpn connection name (custom)
5. check whether the connection is successful.
Ifconfig
-------------------------------------
Ppp0 Link encap: Point-to-Point Protocol
Inet addr: 192.168.2.20.p-t-P: 192.168.2.200 Mask: 255.255.255.255
Up pointopoint running noarp multicast mtu: 1396 Metric: 1
RX packets: 8 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 8 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 3
RX bytes: 80 (80.0 B) TX bytes: 80 (80.0 B)
-------------------------------------
6. Disconnect
Poff vpn connection name (custom)
So far, the installation is complete.
Vi/etc/ppp/options.ppt pd
Remove the following two parameters "#"
Debug \ open debugging. you can see the debugging result in/var/log/message.
Dump
Or
Logfile/var/log/pptpd. log \ specifies the log file
Detailed source reference: http://www.jb51.net/article/23478.htm
1. after the connection is complete, you must add a route to access the Internet.
For example:
Sudo route add default dev ppp0
Solution
Pptpclient-based official description http://pptpclient.sourceforge.net/routing.phtml#all-to-tunnel, when the PPP port is enabled,/etc/ppp/ip-up will be executed by pppd, there is run-parts to run the script in/etc/ppp/ip-up.d, the passed parameter is
# This script is called with the following arguments:
# Arg Name
#$1 Interface name
#$2 The tty
#$3 The link speed
#$4 Local IP number
#$5 Peer IP number
#$6 Optional ''ipparam'' value foo
$1 is the default device name.
If you add a script with the default route, you can write it like this.
Route add default dev $1
Note that this script cannot have a. sh suffix. after actual tests, it cannot run any suffix. It may be related to run-parts.
2. by default, the VPN established by Windows 2003 cannot be connected.
Using interface ppp0
Connect: ppp0 <-->/dev/pts/5
LCP terminated by peer (% M-O ^] k ^ @ garbled .....
Connection terminated.
Modem hangup
The solution is as follows:
3. in CentOS, this package is not in pptp-linux but under pptp-setup.
Pon, plog script in the default
/Usr/share/doc/ppp-*/scripts/
Below
Cd/usr/share/doc/ppp-2.4.4/scripts
Cp pon/usr/local/bin/
Cp poff/usr/local/bin/
Cp plog/usr/local/bin/
Chmod + x/usr/local/bin/p *
Nano/usr/local/bin/plog
# Modify/var/log/syslog to/var/log/messages # (if needed)
Configuration Document parsing:
Save the password in
/Etc/ppp/chap-secrets
The content and format are the same as http://ihipop.info/2010/06/1265.html#chap-secrets. Refer to settings.
Host settings are saved in
/Etc/ppp/peers/
You can further set this.
For example, if the original PPTP connection to win2003 fails, the authentication method is incorrect.
Nano/etc/ppp/peers/vpnname
Add a row
Refuse-eap
You can ()
# Written by pptpsetup
Pty "pptp ip -- nolaunchpppd"
Lock
Noauth
Nobsdcomp
Nodeflate
Name ihipop
Remotename vpn160
Ipparam vpn160
Require-mppe-128
Refuse-eap
# Written by pptpsetup
Pty "pptp serverIP -- nolaunchpppd"
Lock
# Noauth
Nobsdcomp
Nodeflate
Name username
Remotename myvpn
Ipparam myvpn
Require-mppe-128
Refuse-pap
Refuse-chap
Refuse-eap
Refuse-mschap
These files reminds me of the ADSL dialing configured in pppoeconf. The following two parameters are available in/etc/ppp/peers/dsl-provider:
Demand
Idle 300
Here, demand indicates automatic on-demand dial-up, and idle indicates the number of seconds after idle.
Persist indicates that the connection is always maintained.