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 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?

share|improve this question

2 Answers 2

The proper way to accomplish this is to configure Windows Firewall to block all outgoing traffic by default, and then only allow the incoming 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.

share|improve this answer
    
worth noting you still see things in wireshark doing this. –  barlop May 8 at 21:31

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

share|improve this answer
    
Nice! I didn't know you could do that –  user40311 Dec 16 '13 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 at 21:30

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.