服务端 /var/log/messages 中会出现类似的日志
代码语言:javascript复制Aug 25 00:26:02 pptp-server pptpd[10177]: CTRL: Client 103.240.124.15 control connection started
Aug 25 00:26:02 pptp-server pptpd[10177]: CTRL: Starting call (launching pppd, opening GRE)
Aug 25 00:26:02 pptp-server pppd[10178]: Plugin /usr/lib64/pptpd/pptpd-logwtmp.so loaded.
Aug 25 00:26:02 pptp-server pppd[10178]: pppd 2.4.5 started by root, uid 0
Aug 25 00:26:02 pptp-server pppd[10178]: Using interface ppp0
Aug 25 00:26:02 pptp-server pppd[10178]: Connect: ppp0 <--> /dev/pts/1
Aug 25 00:26:05 pptp-server pppd[10178]: peer from calling number 103.240.124.15 authorized
Aug 25 00:26:05 pptp-server pppd[10178]: MPPE 128-bit stateless compression enabled
Aug 25 00:26:07 pptp-server pppd[10178]: Cannot determine ethernet address for proxy ARP
Aug 25 00:26:07 pptp-server pppd[10178]: local IP address 192.168.123.1
Aug 25 00:26:07 pptp-server pppd[10178]: remote IP address 192.168.123.101
Tip: pptpd 和 pppd的日志默认会写到 /var/log/messages 中
如果这个时候 CheckIP 会发自己已经穿越到了另一个地方
如果断开连接,服务端会出现下列日志
代码语言:javascript复制Aug 25 00:40:35 pptp-server pppd[10178]: LCP terminated by peer (nM-,<=^@<M-Mt^@^@^@^@)
Aug 25 00:40:35 pptp-server pppd[10178]: Connect time 14.5 minutes.
Aug 25 00:40:35 pptp-server pppd[10178]: Sent 3146618 bytes, received 469485 bytes.
Aug 25 00:40:35 pptp-server pppd[10178]: Modem hangup
Aug 25 00:40:35 pptp-server pppd[10178]: Connection terminated.
Aug 25 00:40:35 pptp-server pppd[10178]: Exit.
Aug 25 00:40:35 pptp-server pptpd[10177]: CTRL: Client 103.240.124.15 control connection finished
所有客户端都断开后 服务端的ppp0 也会消失
命令汇总
yum install ppp
yum list all | grep -i pptp
yum -y install pptpd.x86_64
sysctl -a | grep forward
vim /etc/sysctl.conf
grep forward /etc/sysctl.conf
sysctl -p
sysctl -a | grep forward
grep -v "^#" /etc/pptpd.conf | cat -s
cat /etc/resolv.conf
grep -v "^#" /etc/ppp/options.pptpd | cat -s
iptables --flush POSTROUTING --table nat
iptables --flush FORWARD
iptables -A INPUT -p gre -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.123.0/24 -o eth0 -j MASQUERADE
/etc/init.d/iptables save
vim /etc/sysconfig/iptables
/etc/init.d/iptables reload
iptables -L -nv
iptables -L -nv -t nat
cat /etc/ppp/chap-secrets
/etc/init.d/iptables restart
/etc/init.d/pptpd start
chkconfig --list | grep -E "(pptp|iptables)"
chkconfig iptables on
chkconfig pptpd on
ip a
原文地址