Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 (italc.sourceforge.net) 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
    
possible duplicate of allowing local network access while blocking internet access –  Ƭᴇcʜιᴇ007 Jul 15 '13 at 11:19
    
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

3 Answers 3

up vote 7 down vote accepted

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

route delete 0.0.0.0 mask 0.0.0.0

And to re-enable, add it back again:

route add 0.0.0.0 mask 0.0.0.0 192.168.1.1

but replace the 192.168.1.1 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 0.0.0.0).

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 at 22:12

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. –  bruce Jul 10 at 14:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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