DEV Community

Rajit Paul
Rajit Paul

Posted on

Linux Routing - Basic Terminologies, Adding and deleting routes

Alt Text


Network routing is the process of choosing a path across one or more networks. The principles of a network are the same and apply to any type of network from telephone networks to any transportation.

Route Tables:

Routers or gateways refer to the internal routing tables to make decisions on how to route the network packets along the network paths. A routing table has all the paths that the network packets might take to reach the destination.


A gateway is also known as a router, acts as the key stopping point for data on its way to or from other networks. The gateway acts as an entry or exit point for the network as all data must pass through or communicate with the gateway before being routed. Traffic flowing among the same local network is the only traffic that doesn't flow through the gateway.
Alt Text

IP address

The IP address is a number used to label devices connected to a network where the medium of communication is Internet Protocol. There are two versions of IP addresses: IPv4 and Ipv6. IPv4 is 32 bits long, whereas IPv6 is 128 bits long.


A netmask is a 32-bit binary mask that is used to divide an IP address into subnets and specify the available hosts in the network. Netmasks are used for defining networking rules in firewalls and routers.
Alt Text

Network Interface Card

NIC is a hardware component that helps a computer connect to a network. This card is a circuit board installed on a computer that provides a dedicated network connection to the computer. It is also known as Network Interface Controller, Network Adapter, or LAN Adapter.
Alt Text

Let's look into a simple use-case

We need to create a network topology such that System A can ping to both system B and system C but B & C cannot ping to each other
Alt Text

Deleting all the routes from System B and C only adding a route for system A -

Alt Text

ip route del via dev enp0s3 - Quad Route

ip route del via dev enp0s3 - LAN Route

route add -net netmask dev enp0s3 - Add Route to System A

Alt Text

We are able to ping from System A to System B & C as visible with the fping command but as we have only one route in System B and System C to System A, they won't be able to ping to one another.

⚡ Thanks for Reading ⚡

Top comments (0)