I took a little peak inside RT-AC68U during WAN dhcp requests, my WAN SSH connection to the router
got dropped almost every 5 minutes when I received a UDP packet from the ISP provider
(when I have dynamic port forwarding). I monitored DHCP requests using the counts in iptable
with spt:67 dpt:68.
I noticed a few extra arguments to the udhcpc process handling this request.
/sbin/udhcpc -i eth0 -p /var/run/udhcpc0.pid -s
/tmp/udhcpc -O33 -O249
/tmp/udhcpc is actually a symbolic link to /sbin/rc
the process udhcpc is handling incoming DHCP request, then runs a linux command
/sbin/rc -O33 -O249
googling source code I found, this code snippet, this is outside my expertise I think routes are possibly being affected partially
during DHCP requests. this event does not disconnect my WAN SSH connection with no tunneling,
just SSH connection with at least Dynamic tunneling sometimes known as SOCKS proxy.
notice the same -O33 and -O249 numbers in the code snippet below
https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/rc/udhcpc.c
/* 0: disable, 1: MS routes, 2: RFC routes, 3: Both */
dr_enable = nvram_get_int("dr_enable_x");
if (dr_enable != 0) {
dhcp_argv[index++] = "-O33";/* routes */
if (dr_enable & (1 << 0))
dhcp_argv[index++] = "-O249";/* "msstaticroutes" */
if (dr_enable & (1 << 1))
dhcp_argv[index++] = "-O121";/* "staticroutes" */
}
I'll have to experiment with this new clue,
I manually killed the udhcpc process so the "/sbin/rc" would not run indirectly anymore,
seems my SSH with dynamic tunneling seems stable.
I'll have to also try running udhcpc with different arguments (minus the /sbin/rc ...) and setting up routes myself,
since my routes are the same every day, I can also try the nvram setting as well, "dr_enable_x" is set to 1
for WAN connection type configured as Dynamic.