I'm have a big question regarding IP forwarding. The current situation is like this:
I want to send a packet from the client to the server, between them I have two routers, Router1 and Router 2. Where Router1 is the router that is closest to the client and Router2 is the router that is closest to the server. The client’s ip address is: 111.222.111.222
The server’s ip address is: 222.222.111.111
Router 1's interfaces:
Interface 1: 111.222.111.1
Interface 2: 111.222.122.1
Interface 3: 111.222.133.1
Interface 4: 111.222.144.1
Router 1's routing table:
222.222.0.0/16 over interface 2
222.222.192.0/18 over interface 3
222.222.0.0/18 over interface 4
Router 2's interfaces:
Interface 1: 222.222.111.1
Interface 2: 222.222.122.1
Interface 3: 222.222.133.1
Router 2's routing table:
111.222.0.0 / 16 over interface 1
111.222.192.0/18 over interface 2
222.222.111.0/24 over interface 3
With this information I connect the client with router1 interface #1 because 111.222.111.1 is the most similar to the client’s ip, I do the same with router2 interface#1 because 222.222.111.1 is the most similar to the server’s ip, is that right?
But now to the tricky part. How do I connect the routers with each other? If I look at router1 routing table, the only place where (222.222.111.1, 222.222.122.1 or 222.222.133.1) can exist is in interface 2. But how do I know which interface in router2 I should connect to? I have been trying to solve this problem the whole day without any progress. I would REALLY appreciate any help with this, so I really can learn IP forwarding and routers routing tables.