Configure Routing Table In Such a Way So That We Can Ping Only Google IP Not FaceBook Ipđź“„
đź”° Create a Setup so that you can ping google but not able to ping Facebook from same system
For this task I have a Virtual Machine at my local system , which has IP — 10.0.2.15
# ifconfig
Check Route Table roule -
# route -n
In my route table rule first rule is whenever we need to go public world then system will use “10.0.2.2”. But we want that our system only connect to Google not Facebook IP.
* Check Googe and Facebook Ip and check whether they are pingable or no
# nslookup www.google.com
# nslookup www.facebook.com
Now we have to configure Routing Table Rules -
(A) Delete “0.0.0.0” destination routing table rule -
# route del -net 0.0.0.0 enp0s3
(b) Add Routing Table Rule For Google IPs -
- In my case I will only configure rule for one IP Range (“172.217.0.0–172.217.31.255”)
# route add -net 172.217.0.0/16 gw 10.0.2.2 enp0s3
“10.0.2.2” is my Router or gateway
Now ping to these Google Ip Range Server -
# ping 172.217.168.228
Now ping FaceBook Server Ips -
# ping 69.171.250.35
We see our system is not able to ping facebook server ip
Now we have configured routing table In Such a Way So That We Can Ping Only Google IP Not FaceBook Ip
Now our task is successfully done .
My LinkedIn: Himanshu Agrawal