Customized Networking Part 2!!!

Creating a network Topology Setup in such a way that System A can ping to System B and System C, but both these systems cannot ping each other.

Hey guys. I hope you all are doing well and fine.

This blog is about how we can customize our networking in our system as per our requirement. This is Part 2. You can check out Part 1 in my previous blog.

Here we will have three systems, i.e., System A, B, and C. We will create a network rule so that System A can ping B and C and vice versa, but System B and C won't be able to ping each other. Our finding will be how two systems (B and C) can ping another system(A) and vice versa but can’t ping each other. So let’s get started…

First, we launched 3 systems in our Virtual Machine.

  • System A: 192.168.56.103
  • System B: 192.168.56.104
  • System C: 192.168.56.105

We can see the respective IP in the below picture.

We tried to ping each system, and we can see in the below image that each system can ping each other.

Ping is usually to check if the system is connected with the network or not.

We have ruled in our routing table to connect it with information about the router. It contains information about the gateway to the internet and network mask.

We now deleted the networking rule where we connect within a network by using the command:

route del -net 192.168.56.0 gw 0.0.0.0 netmask 255.255.255.0

We can see in the above images that we cannot ping any system now. None of the systems rules to connect within the same network and the ping command also doesn’t give any output.

We will create a new rule in System B and C to get connected with A but won’t be connected.

We can add the rule in the routing table using the command:

route add -net 192.168.56.103 netmask 255.255.255.255 enp0s3

Here the IP address is System A, and we added it to the routing table of A and B. And the netmask is also 255.255.255.255 means it has the range within that system only, and the enp0s3 is our network card where we are implementing that rule.

After this, we tried to ping System A from both systems, and we can ping it. When we tried to ping each other, it cannot ping because the rule has been added to only connect to System A IP address, as we can see in the below image.

CONCLUSION

I hope I have explained every step properly and made my points clear. If you have any doubt or suggestions, I would really appreciate it to ping me on my LinkedIn.

Thank You for your time. Have a Good Day.

I blog about ML, Big Data, Cloud Computing. And improving to be the best.

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