1

I am trying to configure my OpenWRT router to connect to a remote VPN server. The credentials that I have are correct, but for some reason the connection is failing to authenticate on the router. Here are my configs

/etc/ipsec.conf

conn l2tpconn
  keyexchange=ikev1
  authby=xauthpsk
  xauth=client
  left=%defaultroute
  leftsourceip=%config
  leftfirewall=yes
  leftauth=psk
  leftauth2=xauth
  leftid=user
  right=<server_ip>
  rightsubnet=0.0.0.0/0
  rightauth=psk
  rightauth2=xauth
  auto=add

/etc/ipsec.secrets

%any <server_ip> : PSK 'secret'
'user' : XAUTH 'password'

Logs

initiating Main Mode IKE_SA l2tpconn[39] to <server_ip>
generating ID_PROT request 0 [ SA V V V V ] 
sending packet: from 192.168.1.18[500] to <server_ip>[500] (224 bytes)
received packet: from <server_ip>[500] to 192.168.1.18[500] (156 bytes)
parsed ID_PROT response 0 [ SA V V V V ] 
received DPD vendor ID
received FRAGMENTATION vendor ID
received XAuth vendor ID
received NAT-T (RFC 3947) vendor ID
generating ID_PROT request 0 [ KE No NAT-D NAT-D ]
sending packet: from 192.168.1.18[500] to <server_ip>[500] (372 bytes)
received packet: from <server_ip>[500] to 192.168.1.18[500] (372 bytes)
parsed ID_PROT response 0 [ KE No NAT-D NAT-D ]
local host is behind NAT, sending keep alives
remote host is behind NAT 
generating ID_PROT request 0 [ ID HASH N(INITIAL_CONTACT) ]
sending packet: from 192.168.1.18[4500] to <server_ip>[4500] (92 bytes)
received packet: from <server_ip>[4500] to 192.168.1.18[4500] (76 bytes)
parsed ID_PROT response 0 [ ID HASH ]
received packet: from <server_ip>[4500] to 192.168.1.18[4500] (76 bytes)
parsed TRANSACTION request 2614881849 [ HASH CPRQ(X_USER X_PWD) ]
generating TRANSACTION response 2614881849 [ HASH CPRP(X_USER X_PWD) ]
sending packet: from 192.168.1.18[4500] to <server_ip>[4500] (108 bytes)
received packet: from <server_ip>[4500] to 192.168.1.18[4500] (76 bytes)
parsed TRANSACTION request 645236074 [ HASH CPS(X_STATUS) ]
XAuth authentication of 'user' (myself) failed
generating TRANSACTION response 645236074 [ HASH CPA(X_STATUS) ]
sending packet: from 192.168.1.18[4500] to <server_ip>[4500] (76 bytes)                                                                                                                                                                                                                                                                                                 
establishing connection 'l2tpconn' failed

Maybe it's something simple and I am missing it, but if you all have any suggestions that'd be very helpful. Thanks.

Max00355
  • 133
  • 7
  • 1
    You have to check the server's log, but from here it seems that either the username or the password is incorrect. Also, remove _authby_ and _rightauth2_. – ecdsa Aug 02 '17 at 15:53

1 Answers1

0

So, I figured out what my issue was, and it was a combination of different things.

  1. I didn't realize that the server was logging the XAUTH requests to /var/log/auth.log I thought it was in /var/log/syslog

  2. After reading the logs I had noticed that it was checking for credentials in /etc/ipsec.d/passwd instead of /etc/ppp/chap-secrets like I had thought, for whatever reason.

I then added my username and hashed password (openssl passwd -1 "password") to /etc/ipconf.d/passwd and it worked.

Max00355
  • 133
  • 7