Creating a network which can ping to A network(Google) but not to B network (Facebook) from same system

Hello readers,

I am back with one more article on the network system which can ping to the google but not to the facebook from the same system.

For checking the IP of the system we have command in the redhat linux is “ifconfig”.

To get the IP address of the Google we can just ping to it. Here, 142.250.67.68 is IP one of the google server.

Same as above we can find the IP address of the facebook by pinging to it.

Here, the IP of facebook is 69.171.250.35

Routing table is the table where the all the routing policies is written.

For checking the routing table we have a command in redhat linux is

“route -n”

First we need to add the route of the google server.

For adding the route of the google server we have a command

route add -net 142.250.67.68 netmask 255.255.255.255 gw 192.168.43.157 enp0s3

Here, enp0s3 is the network adaptor name.

And we need to delete the routing policy to access external world except Google.

Here , we can see that it is pingable to the google but it is not reachable to the facebook server.

That’s it we have achieved our network system.

Thank you for spending your valuable time by reading this article.

I hope it helped you.

--

--

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
Sriramadasu Prasanth Kumar

Sriramadasu Prasanth Kumar

2 Followers

MLOps| Hybrid Cloud | DevOps | Hadoop | Kubernets | Data Science| AWS | GCP |