Temporary block all incoming and outgoing except chrome in Windows Firewall [duplicate]

Solution 1:

This is more a stub of answer since my test machine is currently not here so I can’t test it.

  • Define the 3G network as Public inside Network and Sharing Center
  • Set the Windows Firewall Properties (Advanced Settings) for Public Profile to Outbound connections to Block

At this time, no program that does not have a rule for the Public profile, will be allowed to send data.

Next step is to make sure that only rules concerning core networking functions and Google Chrome are allowed for the Public profile.

In order to change all existing rules, use the netsh advfirewall firewall (see Technet) command line utility and put these commands in a batch file.

  • Disable the public profile for all rules:
    • Netsh advfirewall firewall set rule name=all profile=public new profile=Domain,Private
    • WARNING! UNTESTED!
  • Renable all rules from the Core Networking group (DNS requests etc.) again for the public profile
    • Netsh advfirewall firewall set rule group=”Core Networking” new profile=Domain,Private,Public
    • WARNING! UNTESTED!
  • Renable the rule for Chrome for the public profile
    • your command here :)

Every time you would use the 3G stick, you simply run this batch. This will make sure that any new rule a program has created in the meantime will be disallowed and does not eat up your bandwidth.

Again, sorry for posting untested commands but my test machine should return the day after tomorrow, and then I could try to clean this up.

Reference: List all rules for the Public profile:

 netsh advfirewall firewall show rule name=all profile=public