2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

EdgeRouter X で l2tp-client 接続を行うときにCHAP認証不正で処理が完了しない

Last updated at Posted at 2021-07-23

 EdgeRouter X を利用してL2TP/IPsec 接続を実施したところバグと思われる挙動で接続ができなかった。回避方法などの備忘用。

*EdgeRouter X を L2TPクライアントとして動作させている点に注意(通常、ルーターがL2TPクライアントとして利用されるシーンは少ない)

#####1. 前提環境

  • EdgeRouter X で l2tp-client 機能を利用している
  • この挙動を確認したファーム Version: v2.0.9-hotfix.2
  • l2tp-client 機能に対応しているすべての Version が該当している可能性がある
  • L2TPの認証方式として CHAP/MS-CHAP/MS-CHAPv2を利用している

#####2. バグ内容

  • L2TP接続が完了しない
  • 接続処理の実行時、以下のログが出力される
Jul 23 07:19:17 ubnt pppd[16462]: Connect: l2tpc0 <-->                                                                    
Jul 23 07:19:17 ubnt pppd[16462]: Overriding mtu 1500 to 1400                                                             
Jul 23 07:19:17 ubnt pppd[16462]: Overriding mru 1500 to mtu value 1400                                                   
Jul 23 07:19:17 ubnt systemd-udevd[16464]: link_config: could not get ethtool features for ppp0                           
Jul 23 07:19:17 ubnt systemd-udevd[16464]: Could not set offload features of ppp0: No such device                         
Jul 23 07:19:17 ubnt pppd[16462]: Overriding mtu 1792 to 1400                                                             
Jul 23 07:19:17 ubnt pppd[16462]: No CHAP secret found for authenticating us to <接続先サーバー>                             
Jul 23 07:19:17 ubnt pppd[16462]: MS-CHAP authentication failed: Authentication failed.                                   
Jul 23 07:19:17 ubnt pppd[16462]: CHAP authentication failed     

#####3. 原因

  • l2tp-clientに関する設定を行った場合に自動生成されるchap-secretsファイルに接続先サーバーとして不要な文字列 ( xl2tpd ) が指定されている
  • L2TPの認証シーケンスでCHAP認証に利用するユーザー/パスワードをサーチするときに接続先サーバーでマッチするものがないため該当行を無視してしまう
/etc/ppp/chap-secrets
### Vyatta L2TP Client l2tpc0 Begin ###                                         
L2TP-userXXX       xl2tpd       "L2TP-passwordYYY"      descriptionZZZ
### Vyatta L2TP Client l2tpc0 End ###                                           

#####4. 回避方法

  • l2tp-client機能で所定の設定を行ったあとに、/etc/ppp/chap-secrets をの接続先サーバーをワイルドカード指定する
  • l2tp-clientの設定をメンテナンスする都度、内容がリセットされてしまうので注意
/etc/ppp/chap-secrets
-L2TP-userXXX       xl2tpd       "L2TP-passwordYYY"      descriptionZZZ
+L2TP-userXXX       *       "L2TP-passwordYYY"      descriptionZZZ
  • 編集後、xl2tpdのリスタートを行う
ubnt@ubnt:~$ sudo systemctl restart xl2tpd       
  • 問題がなければL2TP接続が完了する
Jul 23 07:22:44 ubnt pppd[17241]: Connect: l2tpc0 <-->                                                                    
Jul 23 07:22:44 ubnt pppd[17241]: Overriding mtu 1500 to 1400                                                             
Jul 23 07:22:44 ubnt pppd[17241]: Overriding mru 1500 to mtu value 1400                                                   
Jul 23 07:22:44 ubnt systemd-udevd[17243]: link_config: could not get ethtool features for ppp0                           
Jul 23 07:22:44 ubnt systemd-udevd[17243]: Could not set offload features of ppp0: No such device                         
Jul 23 07:22:44 ubnt pppd[17241]: Overriding mtu 1792 to 1400                                                             
Jul 23 07:22:44 ubnt pppd[17241]: CHAP authentication succeeded
  
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?