42

I'm trying to use Windows 7 firewall to block all outgoing and incoming traffic, from all IP's and for all protocals, except for UDP to and from one particular IP address.

The reason why is because I am using a VPN over UDP, and so no other traffic is necessary so I'd like to shut it all down.

My configuration blocks all outgoing traffic, but also it blocks traffic going out to the IP I want to be able to access. I can't for example ping the allowed IP address (notice I have it set as any protocol allowed, so ping should work). I get 'General Failure' when I try to ping it.

I figured having the allow rule at the top of the list would make it work but it doesn't. Am I missing something here?

2 Answers 2

26

The proper way to accomplish this is to configure Windows Firewall to block all outgoing traffic by default, and then only allow the outgoing connection(s) you want.

To do that, click on Windows Firewall with Advanced Security in the left pane, and choose Windows Firewall Properties from the right pane. Next to Outbound connections, choose Block. Then, click OK.

Windows Firewall block outbound by default

Once you've done that, just delete the block all outgoing traffic rule and you should be all set.

2
  • 2
    worth noting you still see things in wireshark doing this.
    – barlop
    May 8, 2014 at 21:31
  • 3
    If you do this, you also need to remove all other rules (in the Public profile) except one you whant to alllow. Otherwise you won't get the "block all" effect.
    – droidgren
    Aug 9, 2016 at 11:59
23

You can do this with IPSec.

  1. Click Start and type MMC then select the MMC from the list.
  2. Click File -> Add/Remove Snap-In -> Add the IP Security Policy Snap-In and Click Ok
  3. Right Click on the middle section and click "Create IP Security Policy"
  4. Follow through the first wizard with the defaults giving the name/description you want.
  5. With the Windows that opens after the first wizard click "Add..."
  6. Click "Next" x3 and then click "Add..."
  7. Give the name of "Block All" or something similar. Click "Add..."
  8. Run through that wizard keeping all the defaults and click "OK"
  9. Select "Block All" and click "Next" and then "Add..." again
  10. Follow the wizard giving the name of "Block" and select "Block" as the action.
  11. Repeat Steps 5-10 selecting the proper source/destination/protocol and selecting "Permit" in Step 10.

MMC

2
  • Nice! I didn't know you could do that
    – user40311
    Dec 16, 2013 at 17:08
  • that was a riot, the first time i've ever found step by step rules that were worthwhile(not baby steps). And if you click outside and lose the window you're in, file..add/remove snap in, gets you back. Also, I skipped step 11 and just assigned/unassigned the block. It worked to an extent, in that it stopped wget for example. but you still see things in wireshark. same kind of effect as with blocking as much as one can in the win7 firewall
    – barlop
    May 8, 2014 at 21:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .