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:

The server’s ip address is:

Router 1's interfaces:

Interface 1:
Interface 2:
Interface 3:
Interface 4: 

Router 1's routing table: over interface 2 over interface 3 over interface 4

Router 2's interfaces:

Interface 1:
Interface 2:
Interface 3:

Router 2's routing table: / 16 over interface 1 over interface 2 over interface 3

With this information I connect the client with router1 interface #1 because is the most similar to the client’s ip, I do the same with router2 interface#1 because 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 (, or 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.

  • Correct me if am wrong, but you can accomplish a whole lot with static routing. But the main problem i see is there are no physical links to one another. But not knowing your whole story , would you be able to connect R1-(Interface 4: and possibly set up a (Interface 4: or .3) on R2 with the same subnet., if not that is there a way you could set up a VPN tunnel?.
    – MtZion
    Nov 12, 2015 at 4:14
  • It is not clear what you are asking. Please edit your question and it will automatically start a reopen vote. You may find our Question Checklist helpful to improve your question. The question does not contain enough detail to allow us to provide an answer.
    – YLearn
    Nov 12, 2015 at 5:48

2 Answers 2


Your explanation is missing an important piece of information: subnet masks for the router (and host) interfaces.

But to answer your question generally, if I assume 24-bit masks:

First, the routers need to have a subnet in common. That means the two interfaces that connect them together will be configured with IP addresses in the same IP subnet. So you will need to change the IP addresses on at least one interface.

Second, you need a route on Router 1 that forwards traffic destined to the server to Router 2's address on their common subnet, and the complement on router 2.

Your routing table is missing a "next hop address," which for R1 will be the address of R2 on the common subnet, and R1's address for R2.

As an example, connect interface 2 of each router together, and change the IP addresses on those interfaces to for R1 and for R2.

Next, you need the following routes:

R1: ->

R2: ->


The short story is that they need to share a subnet between the routers so that they can talk. You can't just just configure a bunch if IPs on one router and totally different IPs on the other without a shared network to bring them together.

eg: R1 -> <-- ( shared network ) --> R2

In this scenario, 3.3.3.x would contact 4.4.4.x via R1's access to


Not the answer you're looking for? Browse other questions tagged or ask your own question.