Create a setup where A can ping to B and C, but B and C are not able to ping each other.

Yash Panchwatkar
4 min readApr 2, 2021

--

To create this setup , you must have some basic knowledge of Networking .

We can create this setup by feeding our mind with some right concept of Routing Table .

Configuring System A

First of all, we must check the IP of System A

IP = 192.168.43.90

So here the IP is 192.168.43.90 , but now I want to set the IP as 192.168.43.1

So , the command to do so is

ifconfig enp0s3 192.168.43.1/24

Here enp0s3 is the network card name and /24 means that the netmask here is 255.255.255.0

The command runs successfully

The IP change to 192.168.43.1

Now ,we need to check the routing table of System A. So, we will use the following command

route -n

The routing table is shown over here

Now we need to add a rule to our routing table in System A using the command —

route add -net 192.168.43.0/30 enp0s3

Its a rule that says IP of System A can connect to IP with the range 192 .168.43.0 to 192.168.43.3. Here we cannot connect to IP 192.168.43.0 because this IP is already reserved, means we get only 2 useable IP address ./30 means that the netmask is 255.255.255.252.

Configuring System B

First of all ,lets check the IP of system B

IP = 192.168.43.232

Now , we need to change to IP of System B to 192.168.43.2

So we will use the following command

ifconfig enp0s3 192.168.43.2/24

The IP changed to 192.168.43.2

Now , let’s check the routing table of System B using the following Command

route -n

Routing Table for System B

We need to add the new rule for routing table using the following command -

route add -net 192.168.43.0/31 enp0s3

Here enp0s3 is the network card ,/31 describes the netmask .It means System B can connect to IP with address 192.168.43.1 i.e the IP of System A.

The rule is successfully added

Configuring System C

First of all ,lets check the IP of system C

IP= 192.168.143.19

Now , we need to change to IP of System B to 192.168.43.3

So we will use the following command

ifconfig enp0s3 192.168.43.3/24

Now , let’s check the routing table of System B using the following Command

route -n

Routing Table of System C

We need to add the new rule for routing table using the following command -

route add -net 192.168.43.0/31 enp0s3

Here enp0s3 is the network card ,/31 describes the netmask i.e 255.255.255.254.It means System B can connect to IP with address 192.168.43.1 i.e the IP of System A.

The rule is successfully added

Now ,we can see that System A is able to ping System B and System C

A pings to B

A pings to C

System B is able to ping to System A but not able to ping to System C

System B is able to ping System A

System B is not able to ping System C

Similarly, we can see that Sysem C is able to ping to System A ,but unaable to ping System C

System C is able o ping System C

System C is not able to ping System B

Hence ,the setup is complete.

Thanks for reading… If any questions please feel free to leave a comment below and Do connect with me on these platforms.

  1. Mail: yashpanchwatkar@gmail.com
  2. LinkedIn: https://www.linkedin.com/in/yash-panchwatkar/

Stay tuned for such awesome stories!

--

--

No responses yet