I'm tracing a problem that has me quite perplexed and I'm hoping that someone may have some insight into it.
I have an EdgeRouter X 5-port connecting through a VPN to a Sonicwall 220. The VPN looks to be up and running, has been for quite a while. Network communications between the two networks is stable, file transfers, applications, web sites, authentication, etc. All as expected.
Except for long running connections. They disconnect every 20 minutes, consistently. If I have an ssh session connected to a server located on the other side of the VPN, it'll disconnect every 20 minutes. Here's a simple shell script that shows the problem:
#! /bin/sh while [ 1 ]; do ssh -n 192.168.3.4 "sleep 28800" date done
The output looks like:
Fri, Jul 01, 2016 8:12:10 AM
Connection reset by 192.168.3.4 port 22
Fri, Jul 01, 2016 8:32:15 AM
Connection reset by 192.168.3.4 port 22
Fri, Jul 01, 2016 8:52:18 AM
Connection reset by 192.168.3.4 port 22
Fri, Jul 01, 2016 9:12:21 AM
Connection reset by 192.168.3.4 port 22
Fri, Jul 01, 2016 9:32:24 AM
Connection reset by 192.168.3.4 port 22
Fri, Jul 01, 2016 9:52:30 AM
Connection reset by 192.168.3.4 port 22
Fri, Jul 01, 2016 10:12:33 AM
Connection reset by 192.168.3.4 port 22
Fri, Jul 01, 2016 10:32:35 AM
Here's the vpn log from the edgerouter:
Jun 30 17:11:08 13[KNL] creating rekey job for ESP CHILD_SA with SPI 693290a4 and reqid {8}
Jun 30 17:11:08 15[IKE] <peer-NN.N.NNN.NN-tunnel-1|130> CHILD_SA peer-NN.N.NNN.NN-tunnel-1{8} established with SPIs c7512791_i a83410a4_o and TS 192.168.3.0/24 === 192.168.1.0/24
Jun 30 17:11:18 05[IKE] <peer-NN.N.NNN.NN-tunnel-1|130> closing CHILD_SA peer-NN.N.NNN.NN-tunnel-1{8} with SPIs c64c4359_i (140524843 bytes) 693290a4_o (41307360 bytes) and TS 192.168.3.0/24 === 192.168.1.0/24
Jun 30 17:17:58 15[IKE] <peer-NN.N.NNN.NN-tunnel-1|130> reauthenticating IKE_SA peer-NN.N.NNN.NN-tunnel-1[130]
Jun 30 17:17:58 15[IKE] <peer-NN.N.NNN.NN-tunnel-1|130> initiating Main Mode IKE_SA peer-NN.N.NNN.NN-tunnel-1[131] to NN.N.NNN.NN
Jun 30 17:17:58 05[IKE] <peer-NN.N.NNN.NN-tunnel-1|131> IKE_SA peer-NN.N.NNN.NN-tunnel-1[131] established between 170.178.140.81[170.178.140.81]...NN.N.NNN.NN[NN.N.NNN.NN]
Jul 1 00:54:08 11[KNL] creating rekey job for ESP CHILD_SA with SPI a83410a4 and reqid {8}
Jul 1 00:54:08 15[IKE] <peer-NN.N.NNN.NN-tunnel-1|131> CHILD_SA peer-NN.N.NNN.NN-tunnel-1{8} established with SPIs c0d83b8e_i 133290a4_o and TS 192.168.3.0/24 === 192.168.1.0/24
Jul 1 00:54:18 05[IKE] <peer-NN.N.NNN.NN-tunnel-1|131> closing CHILD_SA peer-NN.N.NNN.NN-tunnel-1{8} with SPIs c7512791_i (60881089 bytes) a83410a4_o (35359060 bytes) and TS 192.168.3.0/24 === 192.168.1.0/24
Jul 1 01:05:40 10[IKE] <peer-NN.N.NNN.NN-tunnel-1|131> reauthenticating IKE_SA peer-NN.N.NNN.NN-tunnel-1[131]
Jul 1 01:05:40 10[IKE] <peer-NN.N.NNN.NN-tunnel-1|131> initiating Main Mode IKE_SA peer-NN.N.NNN.NN-tunnel-1[134] to NN.N.NNN.NN
Jul 1 01:05:40 13[IKE] <peer-NN.N.NNN.NN-tunnel-1|134> IKE_SA peer-NN.N.NNN.NN-tunnel-1[134] established between 170.178.140.81[170.178.140.81]...NN.N.NNN.NN[NN.N.NNN.NN]
Jul 1 08:37:54 12[KNL] creating rekey job for ESP CHILD_SA with SPI c0d83b8e and reqid {8}
Jul 1 08:37:54 05[IKE] <peer-NN.N.NNN.NN-tunnel-1|134> CHILD_SA peer-NN.N.NNN.NN-tunnel-1{8} established with SPIs cb1552e2_i 44ef10a4_o and TS 192.168.3.0/24 === 192.168.1.0/24
Jul 1 08:38:05 06[IKE] <peer-NN.N.NNN.NN-tunnel-1|134> closing CHILD_SA peer-NN.N.NNN.NN-tunnel-1{8} with SPIs c0d83b8e_i (76787290 bytes) 133290a4_o (29201212 bytes) and TS 192.168.3.0/24 === 192.168.1.0/24
Jul 1 08:53:37 08[IKE] <peer-NN.N.NNN.NN-tunnel-1|134> reauthenticating IKE_SA peer-NN.N.NNN.NN-tunnel-1[134]
Jul 1 08:53:37 08[IKE] <peer-NN.N.NNN.NN-tunnel-1|134> initiating Main Mode IKE_SA peer-NN.N.NNN.NN-tunnel-1[135] to NN.N.NNN.NN
Jul 1 08:53:38 06[IKE] <peer-NN.N.NNN.NN-tunnel-1|135> IKE_SA peer-NN.N.NNN.NN-tunnel-1[135] established between 170.178.140.81[170.178.140.81]...NN.N.NNN.NN[NN.N.NNN.NN]
Here's the edgerouter configuration:
firewall { all-ping enable broadcast-ping disable ipv6-receive-redirects disable ipv6-src-route disable ip-src-route disable log-martians enable name WAN_IN { default-action drop description "WAN to internal" rule 10 { action accept description "Allow established/related" state { established enable related enable } } rule 20 { action drop description "Drop invalid state" state { invalid enable } } } name WAN_LOCAL { default-action drop description "WAN to router" rule 10 { action accept description "Allow established/related" state { established enable related enable } } rule 20 { action drop description "Drop invalid state" state { invalid enable } } } options { mss-clamp { mss 1412 } } receive-redirects disable send-redirects enable source-validation disable syn-cookies enable } interfaces { ethernet eth0 { description "Internet (PPPoE)" duplex auto pppoe 0 { default-route auto firewall { in { name WAN_IN } local { name WAN_LOCAL } } mtu 1492 name-server auto password **************** user-id someuser } speed auto } ethernet eth1 { address 192.168.203.1/24 description wifi duplex auto speed auto } ethernet eth2 { description Local duplex auto speed auto } ethernet eth3 { description Local duplex auto speed auto } ethernet eth4 { description Local duplex auto speed auto } loopback lo { } switch switch0 { address 192.168.3.1/24 description Local mtu 1500 switch-port { interface eth2 interface eth3 interface eth4 } } } port-forward { auto-firewall enable hairpin-nat enable lan-interface switch0 rule 1 { description "ssh into n-monitor" forward-to { address 192.168.3.7 port 22 } original-port 2222 protocol tcp_udp } wan-interface pppoe0 } service { dhcp-server { disabled false hostfile-update disable shared-network-name network3 { authoritative disable subnet 192.168.3.0/24 { default-router 192.168.3.1 dns-server 192.168.3.7 dns-server 192.168.1.2 domain-name ourdomain lease 86400 start 192.168.3.200 { stop 192.168.3.249 } static-mapping NASF5D537a { ip-address 192.168.3.4 mac-address 00:08:9b:f5:d5:37 } static-mapping ReganWhd-PC { ip-address 192.168.3.103 mac-address 38:60:77:13:55:b7 } static-mapping mp161 { ip-address 192.168.3.110 mac-address 00:00:74:e4:3f:64 } static-mapping n-c1 { ip-address 192.168.3.101 mac-address 64:00:6a:6e:e3:64 } static-mapping n-c2 { ip-address 192.168.3.102 mac-address 64:00:6a:6e:a4:2e } static-mapping n-c4 { ip-address 192.168.3.104 mac-address 64:00:6a:6e:a5:c4 } static-mapping n-monitor { ip-address 192.168.3.7 mac-address 52:54:00:a3:b8:57 } static-mapping n-storageb { ip-address 192.168.3.5 mac-address 00:08:9b:f5:d5:3a } static-mapping switch { ip-address 192.168.3.2 mac-address 44:d9:e7:06:cd:69 } } } shared-network-name network203 { authoritative disable subnet 192.168.203.0/24 { default-router 192.168.203.1 dns-server 8.8.8.8 dns-server 8.8.4.4 domain-name ourdomain lease 86400 start 192.168.203.200 { stop 192.168.203.249 } static-mapping workshop { ip-address 192.168.203.2 mac-address 44:d9:e7:48:2b:38 } } } } dns { forwarding { cache-size 150 listen-on eth1 listen-on switch0 } } gui { https-port 443 } nat { rule 5010 { outbound-interface pppoe0 type masquerade } } snmp { community public { authorization ro } contact Peter location "Newark Workshop" } ssh { port 22 protocol-version v2 } } system { domain-name ourdomain host-name n-gw-01 login { user admin { authentication { encrypted-password **************** plaintext-password **************** public-keys peterk@n-c2 { key **************** type ssh-rsa } public-keys peterk@neptune { key **************** type ssh-rsa } } full-name Admin level admin } } name-server 192.168.1.2 ntp { server 0.ubnt.pool.ntp.org { } server 1.ubnt.pool.ntp.org { } server 2.ubnt.pool.ntp.org { } server 3.ubnt.pool.ntp.org { } } syslog { global { facility all { level notice } facility protocols { level debug } } host 192.168.3.4 { facility all { level info } } } time-zone America/Los_Angeles } vpn { ipsec { auto-firewall-nat-exclude enable disable-uniqreqids esp-group espgroup1 { compression disable lifetime 28800 mode tunnel pfs disable proposal 1 { encryption aes128 hash sha1 } } ike-group ikegroup1 { ikev2-reauth no key-exchange ikev1 lifetime 28800 proposal 1 { dh-group 2 encryption aes128 hash sha1 } } ipsec-interfaces { interface eth0 interface pppoe0 } logging { log-level 0 log-modes dmn log-modes mgr log-modes ike log-modes cfg log-modes net } nat-networks { allowed-network 0.0.0.0/0 { } } nat-traversal enable site-to-site { peer NNN.NNN.NNN.NNN { authentication { mode pre-shared-secret pre-shared-secret **************** } connection-type initiate default-esp-group espgroup1 ike-group ikegroup1 ikev2-reauth inherit local-address NNN.NNN.NNN.NNN tunnel 1 { allow-nat-networks disable allow-public-networks disable esp-group espgroup1 local { prefix 192.168.3.0/24 } remote { prefix 192.168.1.0/24 } } } } } }
I'm at a loss as to the cause. Thoughts?