Knowledgebase
How to prevent an IP leak with Windows Firewall
Posted by Max Biggavelli on 09 December 2013 07:16
This article outlines a "blacklist-whitelist" method using the standard Windows Firewall to block all Internet traffic, unless connected to the VPN (via OpenVPN).Again understand that Traffic will be allowed through OpenVPN only and nothing else, that means no connectivity, no windows updates, not anything, except it goes through OpenVPN!

All described steps fall under your own "risk" but surely incase of any troubles, you can simply revert the changes afterwards.

So lets go..

1. Go to your windows Control Panel and click on System and Security
 
https://nvpn.net/images/win_fw1.jpg

2. In the next window, click on Windows Firewall
 
https://nvpn.net/images/win_fw2.jpg

3. First make sure Firewall is enabled and shows a green frame on Home & Public networks, incase you see a red frame, click on Turn Windows Firewall on or off and enable both accordingly!

Procceed now and click on Advanced Settings on the left panel (Note: You must be logged in as an Adminstrator to make changes to the Firewall Settings)
 
https://nvpn.net/images/win_fw3.jpg

4. Click on the centered link "Windows Firewall Properties"

https://nvpn.net/images/win_fw4.jpg

5. Choose Block for InboundOutbound and this in both, the "Domain Profile" AND the "Private Profile" and click on Apply. (by that ALL Traffic In&Out will be blocked as default - often referred to as Blacklisting)

https://nvpn.net/images/win_fw5.jpg

https://nvpn.net/images/win_fw6.jpg

6. Now that all Traffic is blocked, we need to specifically allow Traffic to our wanted Application in our case OpenVPN (often referred to as Whitelisting)

Create the required Inbound rule, click on Inbound Rules and on the right panel you will see an option for New Rule... appear, click on it.

https://nvpn.net/images/win_fw7.jpg

7. Tick Program

https://nvpn.net/images/win_fw8.jpg

8. Tick "This program path" and navigate to your OpenVPN folder and find the "openvpn.exe" ( for Win 7 the program path should be as shown in screen so "%ProgramFiles% (x86)\OpenVPN\bin\openvpn.exe" )

https://nvpn.net/images/win_fw9.jpg

9. In Action we choose to Allow the connection (by that we exclusively allow traffic via OpenVPN only - Whitelisting)

https://nvpn.net/images/win_fw10.jpg

10. In Profile tick on Domain, Private and Public

https://nvpn.net/images/win_fw11.jpg

11. Give it a Profile & Description name of choice, we name it "Allow nVPN IN" click on Next and we are done for the Inbound rules part!

https://nvpn.net/images/win_fw12.jpg

12. Important: Now that the Inbound rule is finished, dont forget that an identical Outbound rule is required too. Repeat the steps 6-11 and name the profile "Allow nVPN OUT" once finished.

Once the missing Outbound rule is created, you are done and all traffic will be blocked, which is not exclusively going through OpenVPN. A disconnect off the VPN, immediately results in an entire Traffic cut off.

(66 vote(s))
Helpful
Not helpful