Configure Routing Table
Anand Kumar
| Ansible | OpenShift | Terraform| DevOps | Hybrid Multi-Cloud | K8S & Docker | Software Engineer at Infinite Computer Solution
ARTH - Task 13.
Task Description:
?? Create a Setup so that you can ping google but not able to ping Facebook from the same system.
Let's Start to configure...
For this task, I am using RedHat Linux Virtual Machine as my local system, which has IP - 192.168.101.7 to find the IP use the cmd:
# ifconfig enp0s3
Check Routing Table:
# route -n
In my route table rule first rule is whenever we need to go public world then the system will use "192.168.101.1". But we want our system to only connect to the Google server, not the Facebook server.
First, check the connectivity of our local system to both the google and Facebook server, for that use the Ping cmd.
* Check Googe is pingable or not - ( It is pingable)
# ping www.google.com
* Check Facebook is pingable or not - (It is also pingable)
# ping www.facebook.com
Now we have to configure Routing Table Rules:
1.Delete "0.0.0.0" destination routing table rule:
# route del -net 0.0.0.0 enp0s3
2.Add Routing Table Rule For Google IPs:
I will only configure a rule for one IP Range ("172.217.0.0 - 172.217.31.255")
# route add -net 172.217.0.0/16 gw 192.168.101.1 enp0s3
"192.168.101.1" is my Router or gateway
Now ping to google server and the Facebook server:
# ping google.com
# ping facebook.com
We see our system is not able to ping Facebook server IP
Now we have configured the routing table In Such a Way So That We Can Ping Only the Google server Not the FaceBook server.