Setup system for pinging to only google not facebook
Networking is the process by which IT resources are connected for transfer data among each other frequently without getting any error .
Basics requirements of networking between two systems:
- There should be physical connection between two computers
- There should be network card in both computers and allocated IP address
- If both computers are in same network then switch is required , but when both computers are in different network then router is required for networking .
- For setup connection between two computers ,Routing table is necessary . it allows to create packet for transfer data .
For setup connection between two computers , it is necessary to create net packet, in net packets two sections are available , header and payloads . In header information of data is mentioned , source IP and destination IP is also mentioned ,data is available in payload.
In this task , i have configured a system as system can ping to google only , can’t ping to facebook using routing table .
In networking, routing table has important role for setup connection between two systems . When all requirements are full filled for setup connection but there is no any rule created in routing table then net packets will not be created and without net packets two systems can’t ping to each other .
I have a system which IP address is 192.168.43.101 This system can ping to google and facebook both due to existence of default gateway rule in routing table.
Default gateway is a routing rule which allow system to connect with public world . For check routing rule run below command
In this system default gateway is available in routing table. For creating default gateway routing rule in this system , run below command
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.43.1 enp0s3
For check the connectivity with google , first of all run below command and check the server IP and try to ping
By runnnig above command i got the IP address of google is 220.127.116.11 and i have checked the connectivity with below command and got to know that system is pinging with google.
For check the connectivity with facebook, first of all run below command and check the server IP and try to ping
By runnnig above command i got the IP address of facebook is 18.104.22.168 and i have checked the connectivity with below command and got to know that system is pinging with facebook.
Now setup system as system can ping to google only but can’t ping to facebook , for this first of all delete default gateway using below command
route del -net 0.0.0.0
Now run below command to add routing rule for ping to google only . I got the IP address of google is 22.214.171.124
route add -net 126.96.36.199 netmask 255.255.255.255 gw 192.168.43.1 enp0s3
Now check the connection using ping command , and got that system is pinging to google but can’t ping to facebook .
ping 188.8.131.52ping 184.108.40.206