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=('220.127.116.11/24'), Gateway='18.104.22.168' netctl did not complain. The output of
ip addr also displayed 22.214.171.124/24, even though there is no 126.96.36.199 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.