Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a command (or command line program) to toggle (disable/enable) internet access to the outside world in Windows XP machines. It should temporarily block internet access but leave the LAN working.

I looked for ways to change the DNS, but browsers like Chrome keep their own cache. The machines are configured via DHCP.

share|improve this question
You have Wireless network ? – Sepahrad Salour Apr 23 '13 at 12:16
What sort of environment? – AthomSfere Apr 23 '13 at 13:58
Actually it's computer class. I would like to use iTalc ( to issue a command to all computers to disable Internet. At same time leaving local network working. Could block Internet at router/switch level but teachers should not have access to router. Wired by cable. – user219175 Apr 24 '13 at 8:09
What is a firewall? --- The other question (linked by techie007) is already closed as a dupe of this, which is mildly confusing. – Ярослав Рахматуллин Jul 18 '13 at 1:23
up vote 9 down vote accepted

It's probably the best to remove the default route to disable internet access:

route delete mask

And to re-enable, add it back again:

route add mask

but replace the with the correct IP of your router (you can find out while the internet is still working by typing route print and checking the entry for

share|improve this answer
The only catch is that if you have more than one local subnet, the computers will not be able to talk to computers in other subnet(s). – David Jul 7 '14 at 22:12
Another catch, on Windows 8, when you restart the machine, it automatically restores the connection – I.G. Pascual Feb 11 '15 at 8:52
After entering route delete mask in command prompt, I was still able to access the internet just fine... (Win7 64bit) – zigojacko Dec 9 '15 at 15:36

You should log into the router and tell it to disconnect from the internet. Unless you only want to deny specific computers access?

share|improve this answer
Even if its only specific machines, there are methods with routers that are not cheap consumer grade routers... – AthomSfere Apr 23 '13 at 13:58

This is a popular result on Google so I just wanted to provide an alternative answer for those using Virtual Machines via VirtualBox.

  • Make sure your virtual machine is turned off.
  • Go to VirtualBox -> File -> Preferences -> Network -> Host-Only Networks -> Click the add button (The host-only network should be set automatically by VirtualBox)
  • Machine -> Settings -> Network -> Change "Attached to" setting to "Host-Only Adapter". (it should autofill the host-only network name for you)

That's it...the Virtual Machine will now be able to utilize the Host Network but will not have access to the internet.

share|improve this answer
Michael's solution works up to a point. With a VirtualBox XP machine while all the network files are available, the network attached printer doesn't work even though it shows up under printers. I.e., any attempt to print to the display network printer gets stuck in the print queue. – user342094 Jul 10 '14 at 14:50

protected by Community Feb 6 '15 at 19:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.