0

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.

2
  • 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: 111.222.144.1) and possibly set up a (Interface 4: 111.222.144.2 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

1

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 50.50.50.1/24 for R1 and 50.50.50.2/24 for R2.

Next, you need the following routes:

R1: 222.222.111.0/24 -> 50.50.50.2

R2: 111.222.111.0/24 -> 50.50.50.1

0

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:

3.3.3.0/24 R1 -> 1.1.1.1/24 <-- (1.1.1.0/24 shared network ) --> 1.1.1.2/24 R2 4.4.4.0/24

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

Cheers,

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