Elk-M1 doesn't connect

I’m successfully using the Elk-M1 integration via a dedicated RPi running ser2net. I need this as I connected a USB-Serial adapter that connects to the Elk-M1 box.

To free up this RPi for another project - a rare commodity at the moment :slight_smile: I’m migrating the RPi to a KVM VM (HA also runs on a KVM VM). The VM is running ser2net, I can ping the HA host from ser2net VM and vice versa but I can’t connect.

The log shows this (debug enabled)

2022-12-10 12:15:07.169 INFO (MainThread) [elkm1_lib.connection] Connecting to ElkM1 at elk://192.168.2.95:3001
2022-12-10 12:15:07.170 WARNING (MainThread) [elkm1_lib.connection] Could not connect to ElkM1 ([Errno 113] Connect call failed ('192.168.2.95', 3001)). Retrying in 1 seconds
2022-12-10 12:15:08.173 INFO (MainThread) [elkm1_lib.connection] Connecting to ElkM1 at elk://192.168.2.95:3001
2022-12-10 12:15:08.177 WARNING (MainThread) [elkm1_lib.connection] Could not connect to ElkM1 ([Errno 113] Connect call failed ('192.168.2.95', 3001)). Retrying in 2 seconds
2022-12-10 12:15:10.179 INFO (MainThread) [elkm1_lib.connection] Connecting to ElkM1 at elk://192.168.2.95:3001
2022-12-10 12:15:10.182 WARNING (MainThread) [elkm1_lib.connection] Could not connect to ElkM1 ([Errno 113] Connect call failed ('192.168.2.95', 3001)). Retrying in 4 seconds
2022-12-10 12:15:14.184 INFO (MainThread) [elkm1_lib.connection] Connecting to ElkM1 at elk://192.168.2.95:3001
2022-12-10 12:15:14.188 WARNING (MainThread) [elkm1_lib.connection] Could not connect to ElkM1 ([Errno 113] Connect call failed ('192.168.2.95', 3001)). Retrying in 8 seconds
2022-12-10 12:15:22.190 INFO (MainThread) [elkm1_lib.connection] Connecting to ElkM1 at elk://192.168.2.95:3001
2022-12-10 12:15:22.194 WARNING (MainThread) [elkm1_lib.connection] Could not connect to ElkM1 ([Errno 113] Connect call failed ('192.168.2.95', 3001)). Retrying in 16 seconds

Doing a tcpdump from the ser2net VM (I have configured port 3001 in ser2net) shows the following

[root@ser2net ~]# tcpdump -i any port 3001 -n -v
tcpdump: data link type LINUX_SLL2
dropped privs to tcpdump
tcpdump: listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
12:37:07.313086 enp1s0 In  IP (tos 0x0, ttl 64, id 49700, offset 0, flags [DF], proto TCP (6), length 60)
    192.168.2.98.47960 > 192.168.2.95.origo-native: Flags [S], cksum 0xf3bc (correct), seq 2611956557, win 64240, options [mss 1460,sackOK,TS val 1549256922 ecr 0,nop,wscale 7], length 0
12:37:08.317544 enp1s0 In  IP (tos 0x0, ttl 64, id 5958, offset 0, flags [DF], proto TCP (6), length 60)
    192.168.2.98.47974 > 192.168.2.95.origo-native: Flags [S], cksum 0x76db (correct), seq 2072437853, win 64240, options [mss 1460,sackOK,TS val 1549257926 ecr 0,nop,wscale 7], length 0
12:37:10.322439 enp1s0 In  IP (tos 0x0, ttl 64, id 60436, offset 0, flags [DF], proto TCP (6), length 60)
    192.168.2.98.49678 > 192.168.2.95.origo-native: Flags [S], cksum 0xcaf9 (correct), seq 3664650970, win 64240, options [mss 1460,sackOK,TS val 1549259931 ecr 0,nop,wscale 7], length 0
^C
3 packets captured
8 packets received by filter
0 packets dropped by kernel
[root@ser2net ~]#

Firstly is there a way to get more log info on Elk-M1 why the connection is failing.

Secondly are we able to get more info from the tcpdump output? Tried to do some research and it looks like length is the TCP payload so a value of 0 sure can’t be good.

This is definitely a network issue but I’m stuck to troubleshoot this.

-s 0 (full packet) -w to write to a file for tcpdump. Then open in wireshark.

Ok here’s the output in Wireshark from tcpdump -i any port 3001 -n -v -s 0 -w elkm1.log

Again the integration on the HA instance 2.98 is trying to connect to 2.95 which runs ser2net