Cable Modem
(with 4-port switch)
|
/ \
/ \
/ \
Router1 Router2
| |
LAN |
| |
(multiple PC's) |
| /
\ /
\ /
[eth0 eth1]
[ my PC ]
Router1 and Router2 run Arch Linux. Both are set up identically. Router1 is live / production. Router2 is a test/development unit. Router2 serves as a cold standby (a spare that normally gets connected only if Router1 goes down or needs repairs.)
The cable modem is a DHCP server. Both Router1 and Router2 will be assigned IP addresses on their WAN ports by the cable modem. Both routers run dnsmasq as the DHCP server and, being set up identically, both dispense identical IP address ranges to their DHCP clients.
While my PC is connected to the LAN via eth0 (IP 192.168.0.10) I need to connect to Router2 temporarily to perform some testing. In the past, I have always done this work outside of business hours. The procedure was to connect Router2, disconnect my PC from the LAN and connect it directly to Router2, then perform my work. However, this is very inconvenient.
I have eth1 (2nd physical NIC) on my PC. (My PC runs Arch Linux too.) I would like to be able to work on Router2 while connected to the LAN via eth0 and during business hours. Once connected, I will need to ssh into Router2 and do my work, then shut Router2 down and disconnect it from the cable modem.
By default, the LAN ports on Router1 and Router2 are both 192.168.0.1 and gateway is 192.168.0.255.
How can I accomplish my goal? I assume I might have to change some network settings on Router2, but I would like to keep such changes to a minimum because it is supposed to replicate Router1 exactly.
What might actually let you access Router2 while making the fewest changes to the router setup would be to create a virtual machine on your PC. You can then assign eth1 to just that VM and work through whatever VM host software you want to use. That way you don't have to change anything about the router or mess with routing tables on your PC.
I like LostWander's answer, but if this is just something you want to set up on an ad-hoc basis, you could just add a route to your PC's routing table using something like:
where a.b.c.d is the IP address of Router2. NOTE: You will be unable to communicate with anything on the network attached to eth0 that has the same IP address as Router2 until you remove this route.