l2tp+chap+linux_client問題
問題是這樣的:
公司的vpn使用的是l2tp+chap模式的。windows下的撥號方式如下
1. 啟動註冊表編輯器 (開始-->運行-->Regedit.exe)。
2. 找到並單擊下面的註冊表項:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Rasman\Parameters
3. 在編輯菜單上,單擊添加數值。
4. 在值名稱框中鍵入 prohibitipsec,在數據類型框中單擊REG_DWORD,然後單擊確定。
5. 在數據框中,鍵入 1,然後單擊確定。
右擊新建立的VPN連接--->屬性--->安全措施--->高級(自定義設置)--->設置--->
勾選"質詢握手身份驗證協議(CHAP)",其它的都不勾選--->確定--->是--->確定
我想用linux來建立客戶端。於是我安裝了ppp和xl2tpd
xl2tpd的配置文件
localhost ppp # cat /etc/xl2tpd/xl2tpd.conf
port = 1701
auth file = /etc/xl2tpd/l2tp-secrets
lns = xxx.xxx.xxx.xxx
redial = yes
redial timeout = 5
max redials = 3
hidden bit = no
require pap = no
require chap = yes
refuse chap = no
require authentication = yes
name = MyName
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd
call rws = 10
tunnel rws = 4
flow bit = yes
challenge = yes
localhost ppp # cat /etc/xl2tpd/l2tp-secrets
# Secrets for authenticating l2tp tunnels
# us them secret
MyName * MyPassword *
ppp的配置文件
localhost ppp # cat /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
MyName * MyPassword *
localhost ppp # cat /etc/ppp/options.l2tpd
lock
proxyarp
defaultroute
日誌文件
xl2tpd: handle_challenge: no secret found for us='localhost' and them='netA'
xl2tpd: control_finish: No secret key for authenticating 'netA'
xl2tpd: Connection 1588 closed to xxx.xxx.xxx.xxx, port 1701 (No secret key on our side)
xl2tpd: Will redial in 5 seconds
xl2tpd: magic_lac_dial: maximum retries exceeded.
/var/log/message裡面什麼動靜都沒有
請各路朋友幫忙診斷一下。在下不勝感激~
《解決方案》
in chap-secrets:
Myname * password *
* Myname password *
//好像需要一對的,至於其它,我也不清楚。
《解決方案》
多謝樓上的朋友~
昨天幾乎一有空就修改配置文件,總算是根線上有聯繫了。配置文件如下
localhost ~ # cat /etc/xl2tpd/xl2tpd.conf
port = 1701
auth file = /etc/xl2tpd/l2tp-secrets
lns = xxx.xxx.xxx.xxx
redial = yes
redial timeout = 3
max redials = 3
hidden bit = no
require pap = no
require chap = yes
refuse chap = no
require authentication = yes
name = MyName
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd
localhost ~ # cat /etc/ppp/options.l2tpd
lock
noauth
proxyarpl
僅僅是這兩個配置文件的變化,就發生了大逆轉。
我跟線上有聯繫了,並且取得了ip,但是我卻無法訪問線上。
希望有此經驗的朋友留個言。
看來應該還是配置文件的原因
《解決方案》
根據抓包的結果,在windows上面會有一個發自我的vpn的ip到224.0.0.22的igmp的消息。但是linux上vpn撥號成功后沒有這些消息。