-0.4 C
New York
Saturday, February 22, 2025

Why is MS-CHAP authentication failing connecting to Draytek L2TP/IPSec VPN from Linux?


I am making an attempt to hook up with an L2TP/IPSec VPN offered by a Draytek router from a headless Ubuntu Linux AWS EC2 occasion. It is a headless server, so I’m setting it up manually (quite than utilizing community supervisor). I am utilizing strongswan for the IPSec connection. The IPSec connection is efficiently established, however the connection fails on the level of MS-CHAP authentication, particularly the log appears like this:

Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: Connecting to host , port 1701
Feb 14 00:03:04 ip-172-31-46-6 sudo[176939]: pam_unix(sudo:session): session closed for person root
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: Connection established to , 1701.  Native: 24268, Distant: 11 (ref=0/0).
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: Calling on tunnel 24268
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: Name established with , Native: 61356, Distant: 46, Serial: 3 (ref=0/0)
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: start_pppd: I am working:
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: "/usr/sbin/pppd"
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: "/dev/pts/6"
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: "passive"
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: "nodetach"
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: ":"
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: "debug"
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: "file"
Feb 14 00:03:04 ip-172-31-46-6 xl2tpd[176607]: "/and many others/ppp/choices.myconn"
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: pppd 2.4.9 began by root, uid 0
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: utilizing channel 19
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: Utilizing interface ppp0
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: Join: ppp0 <--> /dev/pts/6
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [LCP ConfReq id=0x1   ]
Feb 14 00:03:04 ip-172-31-46-6 systemd-udevd[176943]: Utilizing default interface naming scheme 'v249'.
Feb 14 00:03:04 ip-172-31-46-6 networkd-dispatcher[406]: WARNING:Unknown index 124 seen, reloading interface listing
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [LCP ConfReq id=0x0  ]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [LCP ConfAck id=0x0  ]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [LCP ConfRej id=0x1 ]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [LCP ConfReq id=0x2  ]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [LCP ConfNak id=0x2 ]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [LCP ConfReq id=0x3  ]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [LCP ConfAck id=0x3  ]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [LCP EchoReq id=0x0 magic=0xb15c4f6c]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [CHAP Challenge id=0x1 <91ed63fc4d8f5bbd454c577a44147602>, name = ""]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: added response cache entry 0
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [CHAP Response id=0x1 <977c6456c814fbe8007087cad5cc7f750000000000000000cf0b49568e90469ef4948b18a45b7d1819038cf72f3a3c2400>, name = ""]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [LCP EchoRep id=0x0 magic=0x1]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [CHAP Failure id=0x1 "E=691 R=1 C=91ED63FC4D8F5BBD454C577A44147602 V=0 M=Good luck!"]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: MS-CHAP authentication failed: Good luck!
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: CHAP authentication failed
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [LCP TermReq id=0x4 "Failed to authenticate ourselves to peer"]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [LCP TermReq id=0x1]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: despatched [LCP TermAck id=0x1]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: rcvd [LCP TermAck id=0x4]
Feb 14 00:03:04 ip-172-31-46-6 pppd[176942]: Connection terminated.

Up to now my configuration appears like this:

/and many others/ipsec.conf

config setup
    # Allow debugging if wanted (alter as desired)
    charondebug="ike 2, knl 2, cfg 2, enc 2"

conn myconn
    authby=secret
    auto=begin    
    keyexchange=ikev1
    ike=aes256-sha1-modp2048!
    esp=aes256-sha1!

    # Native settings
    left=%defaultroute
    leftid=

    # Distant settings
    proper=
    rightid=
    # Set the group title because the identifier with out the '@'

    kind=transport
    dpdaction=clear
    dpddelay=35s
    dpdtimeout=200s

/and many others/ipsec.secrets and techniques

# Use the group title and distant gateway to establish the PSK
%any  : PSK ""

/and many others/xl2tpd/xl2tpd.conf

[lac myconn]
lns = 
ppp debug = sure
pppoptfile = /and many others/ppp/choices.myconn
size bit = sure

/and many others/ppp/choices.myconn

ipcp-accept-local
ipcp-accept-remote
refuse-eap
refuse-chap 
require-mschap-v2
nopcomp
noaccomp
noauth
mtu 1410
mru 1410
nodefaultroute
ipparam myconn
debug
title 
password 

I need to perceive why I get the message “MS-CHAP authentication failed: Good luck!”. I am fairly sure there isn’t any difficulty with the username and password being incorrect. These have been examined within the Draytek SmartVPN home windows consumer and efficiently related. So why is authentication failing on Linux, or how at the least can I debug this additional?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles