🔰 Setup that you can ping google but not able to ping Facebook from same system🔰

Routing table
A 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.
A routing table contains the information necessary to forward a packet along the best path toward its destination. Each packet contains information about its origin and destination. When a packet is received, a network device examines the packet and matches it to the routing table entry providing the best match for its destination. The table then provides the device with instructions for sending the packet to the next hop on its route across the network.
ARTH — Task 13 👨🏻💻
Task Description📄
🔰 Create a Setup so that you can ping google but not able to ping Facebook from same system🔰
👉🏻Lets get started…😃
🔹My setup :
I have RHEL-8 OS installed on my VM with one NIC Card enp0s3 having IP 192.168.43.26

All the OS decides whether to create packet or not by looking to the Rules in the Routing Table.
In all OS By-default Rule in the Routing Table is to create packets for all the IP’s in the world i.e. Destination is 0.0.0.0
🔹To check the rules in the routing table we have a command :
# route -n

Rule is Destination 0.0.0.0 (means ALL IP’s) and My Gateway IP is 192.168.43.1
So we can ping to all the IP’s. Let’s try to ping to google and facebook:


🔹To get the IP of google and facebook we have a command:

So one of the google IP is 216.58.199.132 & Facebook IP is 69.171.250.35
🔹We can ping to them:


To create the setup that we can ping to google but not Facebook. We have to create some Rules in our Routing Table.
🔹First delete the rule of pinging to all the IP’s (0.0.0.0).
# route del -net 0.0.0.0

🔹Add Rule for pinging to google :
# route add -net n/w_name netmask range_of_n/w gw gateway_ip NIC

Done with the setup!
Let’s check by pinging to google IP 216.58.199.132 and facebook IP 69.171.250.35

🔹We can clearly see that we can able to ping google but not facebook.🔹
TASK COMPLETED Successfully✌🏻👨🏻💻
Thanks for reading !!!😊✨