Creating a Network Topology such that A can connect to B and C but B and C can only connect to A

Here we have 3 VMs which have connectivity with each other at the start. But we want to configure it such that the mn1 can ping to mn2 and mn3 but mn2 and mn3 can ping only to mn1 and not to each other.

Below are the IPs for the ens224 adapter.

Now first let us clean the route tables existing in the VMs previously. Doing this will make the VM completely isolated. Then we can add the required routes to the route tables of the nodes.

we can clean the route table with the below command

ip route flush table main

Now for the mn1, create a new route that will allow all the packets from IPs of network name 192.168.226.0/24 (netmask: 255.255.255.0) so that mn1 can ping mn2 and mn3

route add -net 192.168.226.0 netmask 255.255.255.0 ens224

Now coming to the mn2 and mn3, we need to add only the IP of the mn1. so the route table rule will be 192.168.226.132/32 (netmask: 255.255.255.255)

route add -net 192.168.226.132 netmask 255.255.255.255 ens224

Now we will test the results

MN1

MN2

MN3

From the results, we can say that mn2 and mn3 can ping to mn1 but not to each other and mn1 can ping to mn2 and mn3.

Hope you liked the article and found it useful. 😃

--

--

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