Creating custom network topology
Overview
Yes you read the title right , till the last you will able to create your own custom need network topology. Throughout this article we will be working on three systems let’s take example A,B and C . Now these systems will be configured in such a way that system A will be able to connect to system B and C both , but system B will only be able to connect A but not C , similarly C will be able to ping A but not B. This whole practical is performed on REHL8 linux OS.
Initially
System A
System B
System C
Configuring new IP’s for these systems
The new ip can be set to a system by #ifconfig [n/w card name ] [new_IP]/[netmask]. Command to show the routing table #route -n
System A
System B
System C
So basically system A has given IP192.168.1.1/30 which means that it is in the network 192.168.1.0 and /30 denotes this network is having 4 IP’s only 192.168.1.0, 192.168.1.1, 192.168.1.2 and 192.168.1.3.
System B is in the same network as A and IP assigned to it as 192.168.1.2.
Now the system C has assigned IP as 192.168.1.6/30 that means it’s network name is 192.168.1.4 as well as first IP and other three are following 192.168.1.5 , 192.168.1.6 and 192.168.1.7.
For establishing connection ,creating our own custom routing rules
The new rule can be added with the help of #route add -net command as shown:-
System A
For the system A we are adding two rules 1. to establishing connection in it’s own network and 2. for connecting system C present in other network.
System B
For system B only one rule is added for connecting to system present in its own network. So that it can’t be able to connect to system C.
System C
For System C two rules are added 1. to connect to system present in its own network and 2. to connect to system A . Now system C will only be able to connect to system A having IP 192.168.1.1. The genmask 255.255.255.254 denotes that only first two ip of network 192.168.1.0 will be able to connect.
Final testing
System A
System B
System C
Hurray!! the required network topology is successfully achieved.