Network Topology
In this article, we will create a Network Topology in which System A can be able to ping to two Systems → System B and System C, but both these Sytems System B and System C are not able to ping each other, without using any security rule e.g firewall, etc.
Before moving onto the practical refer to some of the basics of networking from my previous article here 👇
Let’s do the practical,
For this practical, I'm using 3 Redhat VM’s which are connected to switch in the same system.
For this practical in every VM settings → in the network → select as ‘Host-Only Adapter’.
We are using the same network so that every system connected to the same switch.
Now start the systems and do the below steps:
System A
In system A, I have changed into private IP by using this command:
# ifconfig enp0s3 192.168.50.1/24
enp0s3 → network card name and IP is set to 192.168.50.1 with netmask → 255.255.255.0
create a new routing rule in System A by using this command
# route add -net 192.168.50.0/30 enp0s3
with this rule, system A will only create packets for the IP’s 192.168.50.0, 192.168.50.1, 192.168.50.2, 192.168.50.3
To check the routing table use the below command
# route -n
System B
In system B, I have changed into private IP by using this command:
# ifconfig enp0s3 192.168.50.2/24
Create a new routing rule in System B using this command
# route add -net 192.168.50.0/31 enp0s3
By this rule, only 2 IP’s are allowed 192.168.50.0 and 192.168.50.1 as the netmask is set to 255.255.255.254
System C
In system C, I have changed into private IP by using this command:
# ifconfig enp0s3 192.168.50.3/24
Create a new routing rule in System C using this command
# route add -net 192.168.50.0/31 enp0s3
By this rule, only 2 IP’s are allowed 192.168.50.0 and 192.168.50.1 as the netmask is set to 255.255.255.254
Now,
Let’s ping, here this is System A
As you can see System A can ping System B and System C
Here is System B
As you can see System B can ping System A but not to System C
Here is System C
As you can see System C can ping system A but not to System B
This how we can create this kind of Network Topology without stoping any firewall rule or other security rule.
For any queries, you can ask me here in the comments.
Thank You 😇