Creating a Network Topology Setup

System A can connect B and C but No connectivity between B and C

In this article, we are going to set up a new topology where System A can connect B and C but No connectivity between B and C.

The only prerequisite is you should know the basic concepts of the routing table and how to works. For this, you can refer to the below article.

By default, all system in a network has network connectivity over same LAN or same Network. This is possible because of the rules written in the routing table.

NOTE:

If you don't understand this line please go through the above article. In that article, I have explained all terms in-network and how a routing table is one of the most important factor in network connectivity. If you understood the above article this article is a piece of cake for you😄

Let’s get started.

Here I have started three Virtual machines for the demo. When we start the VM comes with a network card with some random IP.

#ifconfig <network-card>
ifconfig enp0s8

Before we set up our topology let's first check, is there network connectivity between serverb and serversc. As you can see we can ping c from b and vise versa.

OLDER IP

The first step is to change the IP address.

ifconfig enp0s8 <new ip address>/<netmask/genmask>

here I have set the following IP

servera: 192.168.43.2/24

serverb: 192.168.43.4/24

serverc: 192.168.43.5/24

CHANGED IP

The Next Step is to add custom routing rules in the routing table. When we ping to another system it generates a packet and to generate a packet operating system first checks the route table rules.

So we need to add rules in such a way that.

  1. B system route table rule range contains only A system IP and not the C
route add -net 192.168.43.0/30

i.e 32–30 = 2 and 2²=4 i.e 4 IP are present in this rule from 0–3

2. similarly, we add a rule in C such that only A operating system IP comes in its range.

route add -net 192.168.43.0/30

3. We want network connectivity between A to B and A to C. For this, we add a custom rule.

route add -net 192.168.43.0/29

i.e 32–39 = 2 and 2³=8 i.e 8IP are present in this rule from 0–7

and both the IP of B and C come in this range so we can ping to B and C.

The new topology has been created now let's test it.

As shown above, System A can connect B and C but there is no connectivity between B and C

That’s all for this article.😇

Thank you for reading.

Follow me for the more interesting and technology-related articles.

Aspiring Cloud DevOps Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store