Network Topology: A Can Ping To B & C But Both B & C can not ping Each Other

Monil Goyal
4 min readMar 26, 2021

Routing Table:

A routing table is a set of rules that is used to determine where data packets travelling over an Internet Protocol (IP) network will be directed. It consists of the network range, gateway and Netmasks.

Network Range

The Range of IPs to which a system can connect is known as network range.

Gateway

A gateway is a device that helps to connect two different networks.

Netmasks and Subnets

The process of dividing a network into smaller network sections is called subnetting. This can be useful for many different purposes and helps isolate groups of hosts together and deal with them easily. Genmask or Netmask help us to create subnets and identify the network name e.g. the first IP of a network or subnet.

CIDR Notation

we could express the idea that the IP address 192.168.0.15 is associated with the netmask 255.255.255.0 by using the CIDR notation of 192.168.0.15/24. This means that the first 24 bits of the IP address given are considered significant for the network routing .

How Netmask helps in determining the Network Range

Here, 192.168.43.0 is the network name and 255.255.255.0 is the netmask.

To determine any IP belongs to the same network or not, netmask perform ‘AND’ operation on each octet of IP with respective octet of netmask in binary form. If that gives the same network name i.e. destination IP then they belong to the same network.

let’s say IP is 192.168.43.45 then and operation of this IP with 255.255.255.0 will give 192.168.43.0 that means it belongs to the network of 192.168.43.0

How to Create Subnets

We can create subnets in any network by increasing the number of significant bits in the netmask

Example: In 192.168.43.0/24If we change the netmask to 25 significant bit value then 192.168.43.0/25 (192.168.43.0–192.168.43.127) is a subnet of 192.168.43.0/24(192.168.43.0–192.168.43.255)

Description:

Creating a network Topology Setup in such a way so that System A can ping to two Systems, System B and System C but both these systems should not be pinging each other without using any security rule e.g firewall etc.

A is able to ping both the systems B & C and B & C are also able to ping each other.

In order to create the setup such that A can ping to two Systems, System B and System C but both these systems should not be pinging each other, we have to edit the routing table in both B and C.

Use the following command to see the routing table in the Linux system.

route -n

I have the rule for 0.0.0.0/0 which means all the systems can connect to B & C if they have physical connectivity with them.

B and C are running in my same system so they have connectivity between them that's why I have to delete both rules i.e. 0.0.0.0/0 and 192.168.43.0/24.

route del -net 0.0.0.0    route del -net 192.168.43.0/24

But now A is also not able to ping B & C, so we have to add the rule for A in both B & C system.

route add -net 192.168.43.176/30 enp0s3
System B
System C

Now, You can see A is able to ping both B & C (green border in system A)and B & C (green border in system B & C) are also able to ping A but B & C are not able to ping each other (red border)

Thanks, for reading…

Keep Learning Keep Sharing !!!

--

--