My machine is connected to a switch (using an ethernet cable). In addition to the modem (with built-in router) this switch is also connected to several other routers. Using a standard netctl profile (Interface=eth0, Connection=ethernet, IP=dhcp), I'm usually connected to the modem/router (192.168.100.1). However, today something went wrong — I got connected to one of the other routers (192.168.0.1).
I'm now wondering about the proper way to set-up a netctl profile to always connect to the 192.168.100.1 modem/router. One option might be to set IP=static and use something like Address=('192.168.100.42/24'),
Gateway='192.168.100.1'. However, when I tried something random like Address=('22.214.171.124/24'), Gateway='126.96.36.199' netctl did not complain. The output of
ip addr also displayed 188.8.131.52/24, even though there is no 184.108.40.206 router connected to the switch.
Basically my question is how to force netctl to connect to a certain router, using either IP=dhcp or IP=static.