Multiple home routers

gatewayrouterroutingtcpip

Suppose I have the following configuration:

  • Router A: WAN port connected to the Internet, LAN = 192.168.1.0/24
  • Computer A: Connected to router A as 192.168.1.101
  • Router B: WAN port connected to router A as 192.168.1.102, LAN = 192.168.2.0/24
  • Computer B: Connected to router B as 192.168.2.101

Now I want computer A to communicate with computer B seamlessly (e.g. can establish a TCP connection by running nc 192.168.2.101 <port>) by means of routing, rather than merging the two networks into one (which can be easily accomplished using router B as a switch).

Most routers are shipped with NAT turned on, of which I definitely need to turn off in router B. But what other steps do I need to take so that packets from computer A to computer B would go through router B?

I could manually add a routing table entry in computer A so that all packets targeted to 192.168.2.0/24 go through gateway 192.168.1.102, but I would prefer an automatic way if it exist.

Best Answer

In this case static routing is probably the best option. If You looking for more general solution it think this could be good starting point: http://en.wikipedia.org/wiki/Routing_Information_Protocol.

For 100% automatic configuration You should have two routers with some routing protocol enabled by default but I think You should configure them anyway fore example fore security reasons. Also You probably want to use rip v2 because rip v1 doesn't support VLSM

Related Question