Networking in Linux : Routing Table and much more …….

Network Routing: Network routing is the process of selecting a path across one or more networks. The principles of routing can apply to any type of network, from telephone networks to public transportation. In packet-switching networks, such as the Internet, routing selects the paths for IP packets to travel from their origin to their destination. These Internet routing decisions are made by specialized pieces of network hardware called routers.

Routing Table: routing table is a set of rules, often viewed in table format, that is used to determine where data packets traveling over an Internet Protocol (IP) network will be directed. All IP-enabled devices, including routers and switches, use routing tables.

Network Gateway: A gateway is a network node that forms a passage between two networks operating with different transmission protocols. Gateways serve as an entry and exit point for a network as all data must pass through or communicate with the gateway prior to being routed. In most IP-based networks, the only traffic that does not go through at least one gateway is traffic flowing among nodes on the same local area network (LAN) segment.

Now, we know the basic terminologies, let’s create something interesting now……….

A Setup so that can ping google but not able to ping Facebook from same system

Let’s take this down step by step:

  1. Use the command ifconfig enp0s3to see your system’s IP and use the command route -n to see the routing table of your system.

[ Note: Here, enp0s3 is my Network Interface Card(NIC) ]

2. Now use the command nslookup www.google.com to see the address of google server and use command ping {IP of Google server} .

3. Similarly, execute the command nslookup www.facebook.com to see the address of Facebook server and ping {IP of Facebook server} to check connectivity.

4. We will delete an entry from the routing table. Use command route -n to check the internet gateway in the table. Now, for deleting the entry, use the command route del -net 0.0.0.0/0 .

5. Now, try to ping both Google and Facebook servers again.

6. Now, we have to add an entry in the routing table such that the internet gateway will only ping Google not Facebook and for that we use the command route add -net 142.250.76.0/24 gw 192.168.43.1 enp0s3 . Here, 192.168.43.1 is my internet gateway and 142.250.76.0/24 is the IPs of Google servers.

7. Now, lastly ping both Google server and Facebook server. You will see that the system is able to ping to Google but not Facebook.

And the setup is finally done………………

I will discuss some technologies in the further blogs, till then have a read at this.

Signing off

Link for my LinkedIn profile:

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Credit Card Validation in Javascript, Ruby, and C

Guide: How to set up your AIOZ Network node with Linux

ProBit Global x Fairface Telegram AMA Session — Win 10,000 FAF tokens

PID Controller Basics Using XOD and Arduino

Managing Users in SaaS Applications

Python Class /Object and Constructor :

Fighting Fragility With Property-Based Testing

Speedrun progress — entry one

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Divyaansh Jain

Divyaansh Jain

More from Medium

[Linux Internals] My notes about : Static and Dynamic/Shared libraries

The Fundamentals Of Kubernetes.

Schema Validation Using Postman and Newman

RARACHUTE — Red Hat’s internship parachute