I am sure this is a simple networking issue, but I am not really
I have two networks: 192.168.0.0 and 192.168.2.0. Each network is
connected to the Internet through a modem/router. The modem/router for
the 192.168.0.0 network has an internal IP address 192.168.0.1, whereas
for the 192.168.2.0 modem/router the internal IP address is 192.168.2.1.
In both networks I have a bunch of Linux boxes, with addresses
192.168.0.2, 192.168.0.3, etc. and 192.168.2.2, 192.168.2.3, etc.,
respectively. Each of these machines is connected to its network through
a switch. I have two switches, A for the 192.168.0.0 network and and B
for the 192.168.2.0 network.
I have a machine M with two NICs. One is connected to the
192.168.0.0 network through switch A, with IP address 192.168.0.254,
whereas the other is connected to the 192.168.2.0 network through switch
B, with IP address 192.168.2.254.
What I would like to be able to do is for all machines in the
192.168.0.0 network (except for the modem/router) to have access to all
the machines in the 192.168.2.0 network, and vice-versa. I guess this can
be done by routing packets through M, but I don't know how to do this.
Once this is done, would it be possible for a machine in the
192.168.0.0 network to have Internet access through the modem/router in
the 192.168.2.0 network, just as it is through the modem/router in its
own (the 192.168.0.0) network?