How to build a network topology where you can ping to google but can’t to Facebook

Gupta Aditya
4 min readDec 25, 2020

Hey guys hope you all are doing good in today's article we are going to do and learn some interesting thing based on network.

Gen what we do to test internet is working or not we try to ping google if system pinging google then we say ok our internet is working fine no issues but when you try to ping Facebook or some other sites it shows network unreachable what does that means??? your internet is not working ???

No, your internet is working perfectly the issue is in the route table or in the IP allocation.

Today we are going to build a similar kind of system in which the system can ping google IP 8.8.8.8 but can't ping to any other sites.

Genmask:-used to give network name and help how much IP we can use

route table:-Help to define where to go and where to not

Gateway:- it is a path that changes source IP so that we can go to isp because we can not go to isp using private IP.

I am not going deep in these things as these things are way deeper I am just giving an overview but if you want to know more then let me know.

Pinging google

As you can see in the above image we have added that to go 8.8.8.0 use 192.168.1.1 gateway and genmask 255.255.255.0 means first three octet is network so effectively we can go to anywhere in b/w IP range 8.8.8.[0–255] this is the reason when trying to ping 8.8.8.8 we can ping easily because it is in the desired IP range as we set.

But as you can see below as we try to ping 69.171.250.35 it is showing error because this IP is out of range .

Now below you can we can 69.171.250.35 because it is in the range 69.171.250. (0-255)

Now we can not ping 8.8.8.8 because it out of range.

This is the reason in destination we gen give 0.0.0.0 and in genmask 0.0.0.0 because this cover all IP so that we can ping to anyone as shown below

default=0.0.0.0

Note if you are using the rhel8 cli version then to use the below command you need one software called net-tools you can download that from yum or DNF from the command:-

yum install net-tools

Some useful commands

1. To check route table

route

2. To add a new route in the route table

route add -net (ip[change with yours]) (netmask netmask[change with yours]) gw(gateway[change with yours]) network card name

eg:- route add -net 8.8.8.0 netmask 255.255.255.0 gw 192.168.1.8 enp0s3

  • To check network card use ifocnfig or IP a there you can see network card as you can see in below image my card is enp0s3

3. To delete route from route table

route del -net IP (ip[you want to delte from route table])

Guys, here we come to the end of this blog I hope you all like it and found it informative. If have any query feel free to reach me :)

Guys follow me for such amazing blogs and if have any review then please let me know I will keep those points in my mind next time while writing blogs. If want to read more such blog to know more about me here is my website link https://sites.google.com/view/adityvgupta/home.Guys Please do not hesitate to keep 👏👏👏👏👏 for it (An Open Secret: You can clap up to 50 times for a post, and the best part is, it wouldn’t cost you anything), also feel free to share it across. This really means a lot to me.

--

--