歡迎您光臨本站 註冊首頁

vpn伺服器工作正常,但是pptpd 調用的pppd不能正常退出?

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

vpn伺服器工作正常,但是pptpd 調用的pppd不能正常退出?

pptpd 調用的pppd不能正常退出?

我用ppp-2.4.3,pptpd-1.30,kernel-2.4.26(ppp和kernel都打了mppc/mppe補丁)配置了vpn 伺服器,一切運行正常,
但是當客戶端(windows)連接斷開后,pptpd為該連接建立的子進程不能退出,為此連接建立的ppp介面也不能釋放?
(該問題在配置pppoe-server也是一樣)

---------------------------------------------------------------------------------------------------------------
配置文件/etc/ppp/option.pptpd(該配置文件工作正常,使用壓縮和128bit加密)
name pptpd

refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2

注意一下關於加密和壓縮的設置(詳見http://mppe-mppc.alphacron.de/的說明)
#force 128bit encryption
+mppe no40
+mppe no56

#force compress
+mppc

lock
nobsdcomp
novj
novjccomp
nologfd

# setup vpn server : client IP address
192.168.2.1:192.168.2.100

# support multilink
multilink
mp

logfile /var/log/pppd.log

nodefaultroute
---------------------------------------------------------------------------------------------------------------
連接成功后的 ps -aux輸出
08:25          0:00 pptpd
08:26          0:00 pptpd
08:26          0:00 /usr/local/sbin/pppd local file /etc/ppp/options.pptpd 115200 ipparam 10.0.0.10

連接成功后的 /var/log/pppd.log
Starting negotiation on /dev/pts/1
Using interface ppp0
New bundle ppp0 created
MPPC/MPPE 128-bit stateful compression enabled
local  IP address 192.168.2.1
remote IP address 192.168.2.100


連接成功后的 /var/log/messages
pppd: pppd 2.4.3 started by root, uid 0
pppd: Starting negotiation on /dev/pts/1
pptpd: CTRL: Ignored a SET LINK INFO packet with real ACCMs!
pppd: Using interface ppp0
pppd: New bundle ppp0 created
pppd: MPPC/MPPE 128-bit stateful compression enabled
pppd: local  IP address 192.168.2.1
pppd: remote IP address 192.168.2.100
---------------------------------------------------------------------------------------------------------------

當客戶端斷開后新產生的pptpd不能自動退出

連接斷開后的 ps -aux輸出
08:25          0:00 pptpd
08:26          0:00 pptpd
08:26          0:00 /usr/local/sbin/pppd local file /etc/ppp/options.pptpd 115200 ipparam 10.0.0.10

連接斷開后的 /var/log/pppd.log 新增
LCP terminated by peer (CqS~^@<M-Mt^@^@^@^@)
Modem hangup
Link terminated.

連接斷開后的 /var/log/messages新增
pppd: LCP terminated by peer (CqS~^@<M-Mt^@^@^@^@)
pppd: Modem hangup
pppd: Link terminated.
---------------------------------------------------------------------------------------------------------------

必須用kill 殺掉新產生的pppd才可以

強制殺掉pppd后的 ps -aux輸出
08:25          0:00 pptpd

強制殺掉pppd后的 /var/log/pptpd.log

Terminating on signal 15
Connect time 10.9 minutes.
Sent 0 bytes, received 0 bytes.
Connection terminated.

強制殺掉pppd后的 /var/log/messages

pppd: Terminating on signal 15
pppd: Connect time 10.9 minutes.
pppd: Sent 0 bytes, received 0 bytes.
pppd: Connection terminated.
pppd: Exit.
pptpd: CTRL: Client 10.0.0.10 control connection finished

---------------------------------------------------------------------------------------------------------------
但是使用系統自帶的ppp-2.4.1,不使用加密和壓縮屬性,連接成功,客戶端退出后,新產生的pptpd子進程自動關閉
---------------------------------------------------------------------------------------------------------------
ps -aux 輸出
root          1696        0.0  0.0  1432        552 ?             S          08:25          0:00 pptpd
root          1899        0.0  0.0  1464        544 ?             S          08:52          0:00 pptpd
root          1900        0.0  0.0  1908        856 ?             S          08:52          0:00 /usr/sbin/pppd local file /etc/ppp/options.pptpd 115200 ipparam 10.0.0.10

/var/log/pppd.log

Connect:  <--> /dev/pts/1
Using interface ppp0
New bundle ppp0 created
local  IP address 192.168.2.1
remote IP address 192.168.2.100
LCP terminated by peer (UM-X&M-Y^@<M-Mt^@^@^@^@)
Modem hangup
Connection terminated.
Connect time 1.0 minutes.
Sent 109 bytes, received 127 bytes.

/var/log/messages
Dec 28 08:52:57 stus pppd: pppd 2.4.1 started by root, uid 0
Dec 28 08:52:57 stus pppd: Connect:  <--> /dev/pts/1
Dec 28 08:53:00 stus pptpd: CTRL: Ignored a SET LINK INFO packet with real ACCMs!
Dec 28 08:53:00 stus pppd: Using interface ppp0
Dec 28 08:53:00 stus pppd: New bundle ppp0 created
Dec 28 08:53:00 stus pppd: local  IP address 192.168.2.1
Dec 28 08:53:00 stus pppd: remote IP address 192.168.2.100
Dec 28 08:53:57 stus pppd: LCP terminated by peer (UM-X&M-Y^@<M-Mt^@^@^@^@)
Dec 28 08:53:57 stus pppd: Modem hangup
Dec 28 08:53:57 stus pppd: Connection terminated.
Dec 28 08:53:57 stus pppd: Connect time 1.0 minutes.
Dec 28 08:53:57 stus pppd: Sent 109 bytes, received 127 bytes.
Dec 28 08:53:57 stus pppd: Exit.
Dec 28 08:53:57 stus pptpd: CTRL: Client 10.0.0.10 control connection finished

請配置成功的大蝦們看看是何原因?

謝謝

[ 本帖最後由 tth0561 於 2005-12-28 10:24 編輯 ]
《解決方案》

已經找到答案,原來是
/etc/ppp/options.pptpd中的多鏈接的問題
# support multilink
multilink
mp

去掉以上參數,ok
《解決方案》

遇到類似情況,但我的配置文件中本來就沒有這兩條參數

[火星人 ] vpn伺服器工作正常,但是pptpd 調用的pppd不能正常退出?已經有1385次圍觀

http://coctec.com/docs/service/show-post-11602.html