Networking
Create a Setup so that you can ping google but not able to ping Facebook from same system
Here you can see my IP address , netmask as 255.255.255.0 it means it can connect to 256 IP address to it.
route -n command is used to see rules inside routing table. Here rule number first that has Destination as 0.0.0.0 and netmask/genmask as 0.0.0.0 it means that it can connect to all the ips in the world. Our aim is to create rule that we are able ping google but not facebook. So we have to delete this rule.
To delete this rule we have command
route del -net 0.0.0.0
We have deleted the rule.
To know ip address of facebook and google we can use nslookup command.
We need to create rule to add for range of ip address of google. To create rule syntax
route add -net <network name> netmask <netmask> gw <internet gateway> network card
We can decide network name of google by ie IP by deciding netmask , we select 255.255.255.0 then network name of google is 172.217.27.0. Gateway of my system is 192.168.225.1 and network card is enp0s3. From above information we can create rule to ping google.
In above image you can see command to create rule and in routing table rule is created.
Now lets see we can ping google or not.
Here you can see that we are able to ping google.
Now lets can we ping facebook or not.
IP of Facebook is 69.171.250.35.
You can notice here that we are not able to ping facebook.
So we have achived our goal.
Thank You!!!!