I did something like this in the past. The router (not a switch) here as a USB port which supports USB/Ethernet.
I’ve setup the MOD: disabled dnsmasq (the DHCP server) via systemctl, edited /etc/network/interfaces changed the static IP to the LAN. Then I’ve configured the router to accept that static IP on the USB interface and route it.
That worked fine, the MOD was reachable from all devices on the LAN/WIFI… until the next MOD update reset things.
No dice.The problem is that the MOD does not set a default gateway for outbound traffic.
I tried something like this:
myDesktop/other device in LAN <–> LAN/WAN router <–WIFI–> dedicated MOD-Router/RPi <–USB–> MOD
MOD-Router/RPi public interface gets an IP in the LAN/WAN from the LAN/WAN router.
MOD-Router/RPi USB interface gets an IP from the MOD in the 192.168.51.0/24 subnet
LAN/WAN router has a static route to 192.168.51.0/24 via MOD-Router/RPi
MOD-Router/RPI is configure to route echo 1 > /proc/sys/net/ipv4/ip_forward
So far so good. All devices from the LAN can reach the MOD, but only one way! The MOD won’t send anything back.
Solution: figure out the IP that the MOD assigns to the MOD-Router/RPi (here 192.168.51.106)
ssh into the mod (from the RPi), /sbin/route add default gw 192.168.51.106 and after that it works.
So the MOD needs to be reconfigured, in which case one might just as well re-configure it to be part of the LAN/WAN directly.
PS. one way to make it work is to change your LAN/WAN to also use 192.168.51.0/24 and exclude the range which the MOD uses 192.168.51.50,192.168.51.150 and reserve 192.168.51.1. – but really I’d be a lot nice if one could configure persistent settings on the MOD which survive updates.