A Network Topology Setup

Hitesh
5 min readSep 7, 2022

ARTH — Task 14

Task Description:

🔰 14.1 Create 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.

🔰 14.2 Further in ARTH — Task 10 have to create an
Ansible playbook that will retrieve newContainer IP
and update the inventory. So that further Configuration
of Webserver could be done inside that Container.

🔰 14.3 Create an Ansible Playbook which will dynamically
load the variable file named same as OS_name and just by
using the variable names we can Configure our target node.
(Note: No need to use when keyword here.)

What Is Network Topology?

Network topology refers to how various nodes, devices, and connections on your network are physically or logically arranged in relation to each other. Think of your network as a city, and the topology as the road map. Just as there are many ways to arrange and maintain a city — such as making sure the avenues and boulevards can facilitate passage between the parts of town getting the most traffic — there are several ways to arrange a network. Each has advantages and disadvantages and depending on the needs of your company, certain arrangements can give you a greater degree of connectivity and security.

There are two approaches to network topology: physical and logical. Physical network topology, as the name suggests, refers to the physical connections and interconnections between nodes and the network — the wires, cables, and so forth. Logical network topology is a little more abstract and strategic, referring to the conceptual understanding of how and why the network is arranged the way it is, and how data moves through it.

Why Is Network Topology Important?

The layout of your network is important for several reasons. Above all, it plays an essential role in how and how well your network functions. Choosing the right topology for your company’s operational model can increase performance while making it easier to locate faults, troubleshoot errors, and more effectively allocate resources across the network to ensure optimal network health. A streamlined and properly managed network topology can increase energy and data efficiency, which can in turn help to reduce operational and maintenance costs.

The design and structure of a network are usually shown and manipulated in a software-created network topology diagram. These diagrams are essential for a few reasons, but especially for how they can provide visual representations of both physical and logical layouts, allowing administrators to see the connections between devices when troubleshooting.

What’s the Most Common Type of Network Topology?

Building a local area network (LAN) topology can be make-or-break for your business, as you want to set up a resilient, secure, and easy-to-maintain topology. There are several different types of network topology and all are suitable for different purposes, depending on the overall network size and your objectives.

As with most things, there’s no “right” or one-size-fits-all option. With this in mind, I’ll walk you through the most common network topology definitions to give you a feel for the advantages and disadvantages of each.

Now, let’s jump to the task

Our Requirement: A and B can connect to each other, A and C can connect to each other but B and C can’t connect to each other

We will achieve our desired result by manipulation of IP addresses and netmask.

We don’t need to configure anything in System A

Let’s jump to System B

STEP 1:

Go to System B and delete the 0.0.0.0 rule:

$ route del -net 0.0.0.0

STEP 2:

Add System A’s IP address along with netmask in the routing table

$ route add -net <ip> netmask 255.255.255.255 gw 192.168.0.1 enp0s3

Here, enp0s3 is thenetwork card name and 192.168.0.1 is my gateway name

STEP 3:

Delete the range of your System C’s IP

$ route del -net 192.168.0.0/24 enp0s3

To view the route table :

$ route -n

We are done configuring system B now lets move to system C.

SYSTEM C:

Follow the same steps as System B

STEP1:

in System C, delete the 0.0.0.0 rule

$ route del -net 0.0.0.0

STEP 2:

Add System A’s IP in the routing table

route add -net <ip> netmask 255.255.255.255 gw 192.168.0.1 enp0s3

Here, enp0s3 the network card name and 192.168.0.1 is the gateway name.

STEP 3:

Delete the range of your System B’s IP

$ route del -net 192.168.0.0/24 enp0s3

To view the route table:

$ route -n

Finally let’s test our setup by pinging.

System B to C and System B to A:

$ ping <ip_address>

As we can see System B to System C is unreachable whereas we can ping from System B to System A.

System C to System B and System C to System A:

$ ping <ip_address>

As we can see System C to System B is unreachable whereas we can successfully ping from System C to System A.

We can also check with System A too:

$ ping <ip_address>

Both systems can be connected successfully.

Hence, we have created a network topology such that System A is able to ping both System B and C and vice-versa, but System B and System C cannot ping each other.

Additionally, we can also change the IP address using the command,

$ ifconfig enp0s3 <IP>

We check the IP using the command:

$ ifconfig

137

--

--