# Connect to windows L2TP/Ipsec server from gentoo laptop

## alabarym

hello!

Once in a while my boss allowed to use linux as the second system on my work laptop. Great.

I need to connect to main office network through L2TP/IPSEC VPN using PSK and of course my username and pass.

I have emerged the following packets:

ppp

openswan

xl2tpd

ipsec.conf

version 2

config setup

    interfaces="ipsec0=wlan0"

    klipsdebug=all

    plutodebug=all

    nat_traversal=yes

conn %default

    authby=secret

    type=transport

    keyingtries=1

conn its

        type=tunnel

        keyexchange=ike

        left=%any

        right='server ip'

        auth=esp

        authby=secret

        auto=start

        righttprotoport=17/1701

        leftprotoport=17/%any

x2ltpd.conf

[global]

access control = yes

[lac its]

lns = 'static server ip'

redial = yes

redial timeout = 10

require chap = yes

require authentication = yes

name = 'my username'

ppp debug = yes

pppoptfile = /etc/ppp/options.l2tp

autodial = yes

/etc/ppp/options.l2tp

name its

remotename 'static server ip'

ipparam 'static server ip'

connect /bin/true

persist

maxfail 0

nopcomp

noaccomp

mru 1460

mtu 1460

user 'username'

password 'password'

ipcp-accept-local

ipcp-accept-remote

noauth

nodefaultroute

debug

nodeflate

nobsdcomp

nomppe

/etc/ppp/chap.secrets

# Secrets for authentication using CHAP

# client        server  secret                  IP addresses

'username     'server ip'      "password"    *

log output

ipsec log:

Nov 19 20:10:48 hikari ipsec__plutorun: 021 no connection named "its"

Nov 19 20:10:48 hikari ipsec__plutorun: ...could not route conn "its"

Nov 19 20:10:48 hikari pluto[9501]: |

Nov 19 20:10:48 hikari pluto[9501]: | *received whack message

Nov 19 20:10:48 hikari pluto[9501]: | next event EVENT_PENDING_PHASE2 in 120 seconds

Nov 19 20:10:48 hikari ipsec__plutorun: 021 no connection named "its"

xl2tpd log:

Nov 19 20:10:53 hikari xl2tpd[9278]: Unable to deliver closing message for tunnel 24568. Destroying anyway.

Nov 19 20:10:53 hikari xl2tpd[9278]: Will redial in 10 seconds

Nov 19 20:11:03 hikari xl2tpd[9278]: Connecting to host 'server ip', port 1701

Nov 19 20:11:08 hikari xl2tpd[9278]: Maximum retries exceeded for tunnel 60266.  Closing.

Nov 19 20:11:08 hikari xl2tpd[9278]: Connection 0 closed to 'server ip', port 1701 (Timeout)

Nov 19 20:11:13 hikari xl2tpd[9278]: Unable to deliver closing message for tunnel 60266. Destroying anyway.

Nov 19 20:11:13 hikari xl2tpd[9278]: Will redial in 10 seconds

Nov 19 20:11:23 hikari xl2tpd[9278]: Connecting to host 'server ip', port 1701

Nov 19 20:11:28 hikari xl2tpd[9278]: Maximum retries exceeded for tunnel 58805.  Closing.

Nov 19 20:11:28 hikari xl2tpd[9278]: Connection 0 closed to 'server ip', port 1701 (Timeout)

Nov 19 20:11:33 hikari xl2tpd[9278]: Unable to deliver closing message for tunnel 58805. Destroying anyway.

Nov 19 20:11:33 hikari xl2tpd[9278]: Will redial in 10 seconds

Please help to configure linux for connection to L2TP IPSEC VPN on windows server

thanks!!!

----------

## nivw

https://forums.gentoo.org/viewtopic-t-857417.html

----------

