Yukta chakravarty

Dec 25, 2020

2 min read

Setup that connects to google but not facebook

Task Description:

Create a setup so that you can ping google but not able to ping Facebook from same system

Step 1: Deleting 0.0.0.0

1. We can see the rules in routing table using route -n , here we can see the entry of rule 0.0.0.0 with netmask 0.0.0.0 and gateway (we go to internet using gateway)

2. This rule allows us to connect to all websites , till we have this rule in routing table we can connect to google, facebook or any website provided you have internet connectivity

3. So we delete this rule using route del -net 0.0.0.0

After deleting the rule even though we have internet connectivity we can’t connect to google

Step 2: Finding google IP

We can use nslookup command to find IP of google , here we can see we get two address , first address is of dns server , second address we see is of google

Step 3: Adding rule for dns server and google

After adding the two rules we can ping to google

We can add rule only for google and we can still connect to it without adding rule for dns server but you have use IP to ping

For using ping www.google.com we need to add rule for dns server

We can only connect to google using this setup , we can’t connect to any other website

Here we see the host is unreachable even if we have internet connectivity
This is how routing table for this setup looks

You have to add rule for address you find using nslookup for your system