Create a setup so that you can ping Google but not able to ping Facebook from same system(In RHEL8).

SUMIT CHATTERJEE
4 min readJun 2, 2021

--

As soon as , you connect your system(local host) with any Gateway, by default you can ping all server whether it is Google, Facebook , Twitter or Instagram . Create a setup so that you can ping Google but not able to ping Facebook from same system.’ This is networking Task . In this article, you will learn how Routing Table helps us to solve this Task along with you will learn in detail about Route Table .

We share or receive any information over a network using network packets. Network Packets is so much important to communicate using this Networking Platform. We need a Router to establish a communication between local host and Internet. This Router act as a Gateway. Local host generate packets to communicate with Internet . These all packets goes to the Internet through Router . Router decide that these all packets as much received from Local Host will forward or not towards the internet. This rule is stored inside the Router in one file is known as Routing Table. Meaning that , Router decide using the Route Table, with which system/host you can communicate over the internet. Router contain Routing Table.

✅ To print the Route Table in the Local Host , run this command given below:-

  1. In Linux

route -n

2. In Windows

route PRINT

✅How Routing Table helps us to create this setup?

By default , as soon as you connect your system with any Gateway(Router), you can ping or send any information to all the server using the Router because Routing table contain some by default rule , allow your every network packets and helps to establish a connection between with Every Host and your Local host. but, if you delete this by default rule and add such rule so that Router will help you to establish a communication between your system and Google not with other server. Using this approach you can solve your task. For this , you will have to figure out somehow Network ID of Facebook & Google.

✅Now, follow these steps to create a setup so that you can ping Google but not able to ping Facebook from same system in RHEL8:-

Step 1 :- Make sure , Bridge Adapter must be enable

Step 2:- Run nslookup command

Step 3:- Type www.facebook.com

You can see the IP Address of Facebook Server(67.171.250.35) in the above image. Using this IP address will have to figure out the network ID & Netmask of Facebook Server . I felt Network ID of Facebook server will be 69.0.0.0 & netmask 255.0.0.0 along with you can see the IP address of Gateway(192.168.43.1).

Step 4 :- Ping www.google.com

You can see the IP Address of Google Server(217.160.0.201) in the above image . Using this IP Address you will have to figure out the network ID & Netmask of Google Server. I felt, Network ID of Google server will be 217.160.0.0 & Netmask (255.255.255.0).

Step 5:- To see the by default rule in the Routing Table run route -n

Step 6:- To delete the default rule in the Routing Rule

route del -net 0.0.0.0

Step 7:- Add the rule in the route table in such a way so that , can ping only Google Server not other

route add -net 217.160.0.0 netmask 255.255.255.0 gw 192.168.43.1

Note:-

217.160.0.0 (Network ID of Google Server)

255.255.255.0 (Netmask of Google Server)

192.168.43.1 (Gateway IP of your Local Host)

Step 8:- ping 217.160.0.201

Now, you can ping Google Server Only.

Note:-

217.160.0.201 (IP Address of Google Server)

Step 9:- ping 67.171.250.35

You can’t ping IP address of Facebook Server.

Note:-

67.171.250.35 (IP Address of Facebook Server)

‼Finally , Completed this networking task. Hope, This article helped you a lot. If yes , then leave a comment here. I will come up with a new article . ‼😊

--

--

SUMIT CHATTERJEE
SUMIT CHATTERJEE

Written by SUMIT CHATTERJEE

0 Followers

RHCSA | AWS | OPENSHIFT | TERRAFORM | AI

No responses yet