Allow network traffic only for specific programs in windows 7

4

1

Sometimes I use my mobile phone as wi-fi router. When my windows 7 home premium connects to this network, it consumes lots of data immediately. I need to disable all the internet traffic except browser and skype in those cases, and easily switch back when I get usual home wi-fi. I thought windows firewall could easily do it, but it doesn`t seem so.

Justinas Dūdėnas

Posted 2012-03-21T17:05:36.430

Reputation: 548

Answers

6

If you want to block all outbound connections do the following:

Type Firewall in the search box in the start menu and select "Windows Firewall with advanced security", in the middle section of the window click `Windows Firewall Properties' enter image description here

From there whatever network your cell phone modem is considered (Public, Domain, or Private) go to that tab and change outbound connections from Allow to Block.

enter image description here

If you need some programs to be able to connect you need to explicitly let them connect by adding a rule to the Outbound Rules.

If you make your cell phone connection fall under the "Public" profile and your home connection as your "Private" profile you will not need to make any changes at all when you switch between your two connections if you only block outbound "public" connections.


If you can identify the program that is using a lot of traffic you can skip all of the above steps and just make a new outbound rule and set it to block that application.

Scott Chamberlain

Posted 2012-03-21T17:05:36.430

Reputation: 28 923

1Outbound rules apply to all configurations. So you have to switch off lots of default exceptions for all the profiles, if you want to block everything but the browser. – Justinas Dūdėnas – 2012-03-21T18:27:55.113

1@JustinasDūdėnas No they dont, rt-click on the rule, go to Properties then go to the advanced tab and you can check and un-check which profiles the rule applies to. – Scott Chamberlain – 2012-03-21T18:55:06.250

Youre right! It took like 100 mouseclicks to fix all of them, but it probably isnt harder than installing and configuring another firewall. Still I agree that in terms of usability windows firewall is far from perfect. – Justinas Dūdėnas – 2012-03-21T19:49:46.383

@JustinasDūdėnas You can script it via powershell and do updates in mass. If you are using Windows 8 or newer it is even easier

– Scott Chamberlain – 2014-03-05T00:42:13.500

0

Generally your soulution works like a charm. I've had excacly same issue as poster - wanted to block internet access from applications while using 3G connection. I've spend some time (20 minutes) to add exceptions for some applications to allow traffic through public profile and that did the job. But now.... I'm facing same problem on this f...... Windows 8. Almost everything works excacly the same like for Win7 but Metro (or Modern if you like) apps live their own lives. It seems that all Metro apps are using some common gateway to "get-into" Internet because they don't give a f.... about Firewall rules. While classic applications follow firewall rules, then metro one just have a full access to Internet. They ALL must have one common rule for all metro apps so firewall rules can't separatelly control traffic for each Metro apps separatelly. My biggest fear is that Windows Firewall can block/allow access to ALL metro apps at once following by single rule, but can't block/allow access to particular metro apps separatelly. Am I right?

user200948

Posted 2012-03-21T17:05:36.430

Reputation: 1

For wi-fi Win-8 has a dedicated feature called "metered connection": http://en.kioskea.net/faq/30984-windows-8-set-network-as-metered-connection BTW, this is a comment, not an answer you're posting, to be strict.

– Justinas Dūdėnas – 2014-03-06T07:46:01.287