Create a Network Topology Setup in such a way so that System A can ping to two Systems System B…

Create a Network Topology Setup in such a way so that System A can ping to two Systems System B…

January 1, 20234 min readSri VishnuvardhanSri Vishnuvardhan

Concepts used: Routing tables and Netmask

In this practical, we are going to use three Redhat Enterprise Linux Virtual Machines which are hosted by Oracle VirtualBox.

I already explained these concepts in my previous blog, if you want to know these basic concepts then please refer this

Note: Before starting these VMs, make sure it is connected in Host-only adapter mode and the adapter name should be the same in all three VMs.

Environment Setup

System A

First step is to change the IP and set the Netmask by running the following command.

ifconfig enp0s3 162.168.1.1/29

Second step is to create the route rule by running the following command.

route add -net 162.168.1.0 netmask 255.255.255.248 enp0s3

System B

First step is to change the IP and set the Netmask by running the following command.

ifconfig enp0s3 162.168.1.2/31

Second step is to create the route rule by running the following command.

route add -net 162.168.1.0 netmask 255.255.255.254 enp0s3

System C

First step is to change the IP and set the Netmask by running the following command.

ifconfig enp0s3 162.168.1.4/31

Second step is to create the route rule by running the following command.

route add -net 162.168.1.0 netmask 255.255.255.254 enp0s3

Ping Checking

We completed the environment setup. Now we can run the ping command in order to check the status of Network connectivity.

Pinging System B from System A

Pinging System A from System B

Pinging System C from System A

Pinging System C from System A

Pinging System B from System C

Pinging System C from System B

How is this Possible?

In simple words, it is happened because of routing tables that use Netmask for the IP range.

Let's take a look at the routing rule in System A

route add -net 162.168.1.0 netmask 255.255.255.248 enp0s3

In this, Netmask 255.255.255.248 denotes the IP range which have the connection between them.

If you convert to binary form means, it looks like this.

11111111 11111111 11111111 11111000

For the last three places(where the zeros located), we can accommodate 8 combinations. So it decided the number of IPs (IP range) that can connect each other.

The range of IPs are that can connect each other is 162.168.1.0–162.168.1.7.

So in this way, System A can ping to System B (162.168.1.2) and System C (162.168.1.4).

Then if you look at the routing rule in System B

route add -net 162.168.1.0 netmask 255.255.255.254 enp0s3

The netmask is specified as 255.255.255.254

If you convert to binary form means, it looks like this.

11111111 11111111 11111111 11111110

For the last one place(where the zero located), we can accommodate 2 combinations. So it decided the number of IPs (IP range) that can connect each other.

So the range of IPs that are connected to each other are two in numbers namely 168.162.1.0 and 162.168.1.1.

In this way System B can ping to System A. It is noted that IP of System C (162.168.1.4) is not in range, that's the reason for not ping.

Finally, if you take a look on routing rule in System C.

route add -net 162.168.1.0 netmask 255.255.255.254 enp0s3

Here, the Netmask specified is 255.255.255.254. So the last one place(where the zero located), we can accommodate 2 combinations. So it decided the number of IPs (IP range) that can connect each other.

So the range of IPs that are connected to each other are two in numbers namely 168.162.1.0 and 162.168.1.1.

In this way, System C can ping to System A. It is noted that IP of B(162.168.1.2) is not in range, that’s the reason for not ping.


Thank you for your reads. Stay tuned for my next article.

Sri Vishnuvardhan

Written by

Sri Vishnuvardhan

Building production-grade geospatial platforms that combine GIS, remote sensing, cloud infrastructure, AI, and platform engineering to transform spatial data into scalable, real-world intelligence.

Enjoyed this article?

Subscribe to get notified when new articles on DevOps, Cloud, and platform engineering are published.

You'll receive a welcome email with a confirmation link. No spam — unsubscribe anytime.

Have a project in mind?

I work on cloud-native platforms, DevOps automation, and geospatial intelligence systems. Let's talk.

Get in touch
Create a Network Topology Setup in such a way so that System A can ping to two Systems System B… — Sri Vishnuvardhan A