How to Create a network such that it can only connect to Google.

Abhishek Sahu
3 min readMar 14, 2021

Hello Guys, Today I am going to share you, How can you make your computer or network such that it can only ping to google. This type of system is very needful for certain use cases where you want to restrict user of your computer to a certain site.

Ok, So lets start implementing the same system.

Step 1: Open the terminal of your device.

Step 2: Check connectivity to google and other sites first.

Connectivity to google.
Connectivity to facebook.

Now, Currently our system is working fine and connecting to all websites. It’s time to restrict the access.

Step 3: Look for the routes in routing table and delete the default route.

Looking routes.

To see route table use: “route -n

Delete Default route.

Command to delete Default route :- “ route del -net

Step 4:- Now try ping to any network, you aren’t able to connect to any network.

No Connectivity.

Step 5: Now add IP of google in routing table.

Adding IP of google.

To add entry in route table use “route add (IP you want to add) gw(your gateway)

Step 6: Now you are able to connect to IP but not url.

Connecting to IP

Step 6: To connect to url you have to add a local DNS entry in your system.

Updating Local DNS.

Now this system can only connect to , Similarly you can restrict a site by adding reject flag in route add command.

Thanks for reading hope you find this tutorial helpful.



Abhishek Sahu

Hey Readers, I am tech enthusiast and an Computer Science Student. Here I am sharing various industry use cases and its solution.