Closed rwb196884 closed 2 years ago
If I'm reading things correctly, both the client and server seem to be on the same 192.168.1.0/24
subnet, consequently the routing for the VPN connection is most likely totally screwed up.
They are: it's the home wifi. And over that network I want to make an IPSec/L2TP tunnel between a client (Win10) and the router (Debian 10) and send all traffic between then through the tunnel instead of over the normal network.
Both machines are connected via ethernet. The server is 192.168.1.31 and the client is 192.16.1.11.
# cat /etc/ipsec.conf
# ipsec.conf - strongSwan IPsec configuration file
# basic configuration
config setup
charondebug="all"
# Connections
conn wep-ap
type=transport
authby=secret
pfs=no
rekey=no
keyingtries=1
left=192.168.0.31
leftid=%any
leftprotoport=17/1701
right=%any
rightprotoport=17/%any
rightsubnet=vhost:%priv,%no
auto=add
ike=aes128-sha1-sha1-modp1024,3des-sha1-sha1-modp1024
leftnexthop=%defaultroute
rightnexthop=%defaultroute
# grep "^[^;]" /etc/xl2tpd/xl2tpd.conf
[global] ; Global parameters:
port = 1701 ; * Bind to port 1701
listen-addr = 192.168.1.31
debug avp = yes
debug network = yes
debug packet = yes
debug state = yes
debug tunnel = yes
auth file = /etc/xl2tpd/l2tp-secrets
max retries = 5
access control = no
[lns default] ; Our fallthrough LNS definition
ip range = 192.168.4.100-192.168.4.254 ; * Allocate from this IP range
local ip = 192.168.4.31 ; * Our local IP to use
length bit = yes ; * Use length bit in payload?
name = mini31 ; * Report this as our hostname
pppoptfile = /etc/ppp/options.xl2tpd
ppp debug = yes
require authentication = yes
require chap = yes
refuse pap = yes
I now have an identical configuration working on a Rasberry Pi.
Debian:
# uname -a
Linux mini31 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64 GNU/Linux
# dpkg -l | grep xl2tpd
ii xl2tpd 1.3.12-1.1 amd64 layer 2 tunneling protocol implementation
Raspberry:
$ uname -a
Linux raspberrypi 5.15.32+ #1538 Thu Mar 31 19:37:58 BST 2022 armv6l GNU/Linux
$ sudo dpkg -l | grep xl2tpd
ii xl2tpd 1.3.12-1.1 armhf layer 2 tunneling protocol implementation
The syslogs are different when charon
completes and xl2tpd
starts:
Debian:
...
Aug 8 11:02:05 mini31 charon: 10[IKE] CHILD_SA wep-ap{9} established with SPIs ccb74d8c_i 0705192f_o and TS 192.168.0.31/32[udp/l2f] === 192.168.0.7/32[udp/59134]
Aug 8 11:02:05 mini31 xl2tpd[20596]: network_thread: recv packet from 192.168.0.7, size = 68, tunnel = 0, call = 0 ref=0 refhim=0
Aug 8 11:02:05 mini31 xl2tpd[20596]: get_call: allocating new tunnel for host 192.168.0.7, port 59134.
Aug 8 11:02:05 mini31 xl2tpd[20596]: message_type_avp: message type 1 (Start-Control-Connection-Request)
Aug 8 11:02:05 mini31 xl2tpd[20596]: protocol_version_avp: peer is using version 1, revision 0.
Aug 8 11:02:05 mini31 xl2tpd[20596]: framing_caps_avp: supported peer frames: async sync
Aug 8 11:02:05 mini31 xl2tpd[20596]: hostname_avp: peer reports hostname 'macbook'
Aug 8 11:02:05 mini31 xl2tpd[20596]: assigned_tunnel_avp: using peer's tunnel 49
Aug 8 11:02:05 mini31 xl2tpd[20596]: receive_window_size_avp: peer wants RWS of 4. Will use flow control.
Aug 8 11:02:05 mini31 xl2tpd[20596]: control_finish: message type is Start-Control-Connection-Request(1). Tunnel is 49, call is 0.
Aug 8 11:02:05 mini31 xl2tpd[20596]: control_finish: sending SCCRP
Aug 8 11:02:05 mini31 xl2tpd[20596]: network_thread: recv packet from 192.168.0.7, size = 68, tunnel = 0, call = 0 ref=0 refhim=0
Aug 8 11:02:05 mini31 xl2tpd[20596]: get_call: allocating new tunnel for host 192.168.0.7, port 59134.
...
Raspberry:
...
Aug 8 11:02:11 raspberrypi charon: 10[IKE] CHILD_SA wep-ap{3} established with SPIs c2896df1_i 0a636fb2_o and TS 192.168.0.141/32[udp/l2f] === 192.168.0.7/32[udp/61036]
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: network_thread: recv packet from 192.168.0.7, size = 68, tunnel = 0, call = 0 ref=0 refhim=0
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: get_call: allocating new tunnel for host 192.168.0.7, port 61036.
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: message_type_avp: message type 1 (Start-Control-Connection-Request)
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: protocol_version_avp: peer is using version 1, revision 0.
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: framing_caps_avp: supported peer frames: async sync
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: hostname_avp: peer reports hostname 'macbook'
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: assigned_tunnel_avp: using peer's tunnel 48
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: receive_window_size_avp: peer wants RWS of 4. Will use flow control.
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: control_finish: message type is Start-Control-Connection-Request(1). Tunnel is 48, call is 0.
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: control_finish: sending SCCRP
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: network_thread: recv packet from 192.168.0.7, size = 20, tunnel = 19058, call = 0 ref=0 refhim=0
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: message_type_avp: message type 3 (Start-Control-Connection-Connected)
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: control_finish: message type is Start-Control-Connection-Connected(3). Tunnel is 48, call is 0.
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: Connection established to 192.168.0.7, 61036. Local: 19058, Remote: 48 (ref=0/0). LNS session is 'default'
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: network_thread: recv packet from 192.168.0.7, size = 38, tunnel = 19058, call = 0 ref=0 refhim=0
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: message_type_avp: message type 10 (Incoming-Call-Request)
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: message_type_avp: new incoming call
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: assigned_call_avp: using peer's call 4451
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: call_serno_avp: serial number is 1
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: control_finish: message type is Incoming-Call-Request(10). Tunnel is 48, call is 0.
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: control_finish: Sending ICRP
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: network_thread: recv packet from 192.168.0.7, size = 40, tunnel = 19058, call = 32279 ref=0 refhim=0
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: message_type_avp: message type 12 (Incoming-Call-Connected)
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: tx_speed_avp: transmit baud rate is 1000000
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: frame_type_avp: peer uses: async frames
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: control_finish: message type is Incoming-Call-Connected(12). Tunnel is 48, call is 4451.
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: start_pppd: I'm running:
Aug 8 11:02:12 raspberrypi xl2tpd[8176]: "/usr/sbin/pppd"
...
So it looks like Debian isn't starting PPP.
On debian /etc/strongswan.d/charon
was empty. I coped the files form the Raspberry
Are you using kernel mode L2TP for both Debian and Raspberry PI? As you are using completely different kernel versions with major version number difference, the L2TP kernel modules would be different.
I can't see from the log snippets if they have something like xl2tpd[456]: This binary does not support kernel L2TP
or xl2tpd[789]: Using l2tp kernel support
Not sure if the apparmor="DENIED"
errors for strongswan in your original post on Debian are an issue.
I appreciate that this may be a configuration problem, but I've been unable to find any help anywhere else so here we are...
Trying to connect an L2TP/IPSec VPN from Win10 and from MacOS X 10.7 to Debian 10. Both clients have the same problem: IPSec connection is made but then xl2tpd doesn't work. Here is
syslog
:I'm reading this as IPSec starts and authenticates but then there is some problem with
xl2tpd
? But I don't understand what that problem is or what to do about it. Any ideas?!