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:

  1. There should be physical connection between two computers
  2. There should be network card in both computers and allocated IP address
  3. 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 .
  4. 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

route -n

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

nslookup www.google.com

By runnnig above command i got the IP address of google is 172.217.167.228 and i have checked the connectivity with below command and got to know that system is pinging with google.

ping 172.217.167.228

For check the connectivity with facebook, first of all run below command and check the server IP and try to ping

nslookup www.facebook.com

By runnnig above command i got the IP address of facebook is 69.171.250.35 and i have checked the connectivity with below command and got to know that system is pinging with facebook.

ping 69.171.250.35

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 172.217.167.228

route add -net 172.217.167.228 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 172.217.167.228ping 69.171.250.35

--

--

--

enthusiastic for new technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Understanding the GRASP Design Patterns

Create a Simple Python GUI With These Open Source Projects

Kotlin — How to write code more readable and Clean, Best practices

Construct Your Object with Python Data Class

Backup script using rsync

NodeBunch conducting it’s first official airdrop program join to get NOCH tokens.

Home Security And Automation with raspberry pi (Part 1 — Live Camera Feed)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dhiraj Kumar

Dhiraj Kumar

enthusiastic for new technologies

More from Medium

Learning Java by creating a Tic-Tac-Toe game

Framework Interview Questions

CS373 Spring 2022: Nisha Ramesh

An Intuitive Approach to the Scytale Cipher — Java