How to firewall a VPN connection in Windows 7?

2

I have a VPN connection to a private VPN server in another country. I don't want any internet packets to leave or enter my laptop unless they are going to or coming from the VPN server's IP.

Is there a way to enforce this using perhaps the built in firewall in Windows 7?

seticruncher

Posted 2012-01-23T16:54:15.637

Reputation: 21

Answers

1

In your settings of the VPN check the Use Default gateway on remote network

In this case ALL packets travel via the secure VPN and leaves the server on that side.

Many times people un-tick this because the internet runs very sluggish.

enter image description here

If you want to verify that it works you can use Fiddler and you can monitor where http packets are going and coming from.

An even more advanced packet sniffer is WireShark and shows the whole design of a packet, source destination and all that.

A firewall is not used to redirect packets. You can , YES, stop packets from leaving, but that would be better to BLOCK ALL INCOMING AND OUTGOING traffic on your router, EXCEPT for VPN tunnel..

Piotr Kula

Posted 2012-01-23T16:54:15.637

Reputation: 3 538

Wont work for me... it's openvpn client software, its not ipsec. – seticruncher – 2012-01-23T17:01:10.057

block it on the router then.. deny all in and out. Just allow the VPN tunnel, leave windows firewall alone. – Piotr Kula – 2012-01-23T17:03:09.477

Have other people use my wireless network that don't use vpn... – seticruncher – 2012-01-23T17:06:21.247

0

openvpn uses a tun/tap virtual NIC, so you have a similar option. All you have to do is to un-tick the auto metric option and set the value to one that is very low like 1. Then you can verify the results by running the command netsh int ip sh route and check if the virtual NIC is listed higher than your physical NIC for the default route (0.0.0.0/0).

This will make sure all your outgoing traffic, except the ones to your local network and the VPN server, goes through the tunnel.

To block incoming traffic, you have two options:

  1. Delete the default route for your physical NIC, so any incoming traffic becomes essentially useless.
  2. Setup a third-party firewall to block all incoming traffic on your physical NIC or its IP address range. I don't think you can't do this with Windows firewall easily.

billc.cn

Posted 2012-01-23T16:54:15.637

Reputation: 6 821

0

There are basically two connection in Vpn one for Incoming & another for outgoing.

Following are the steps for configuring Incoming VPN Connection in Windows 7

1.First go to Control Panel and open Network and Sharing Center. 2.Click on Change adapter settings. 3.Press Alt+F and select New Incoming connection 4.Put a check on who you’d like to give access to this computer or you can configure a new account by clicking on Add someone,after that click on Next. 5.Put a check mark on Through the Internet. Click on Next. 6.Select the protocols you want to enable for this connection. Click on Allow access. 7.Make a note of the Computer name as this will be used by the client to connect to this computer and after that Click on Close.

Following are the steps for configuring Outgoing VPN Connection in Windows 7

1.First go to Control Panel and open Network and Sharing Center. 2.Click on Set up a new connection or network. 3.Select Connect to a workplace then click on Next. 4.Select Use my internet connection (VPN). 5.Type the IP address or computer name where you wish to connect and your connection name under the Destination name field. 6.Enter a User name and password that has been granted access to the host computer. 7.For getting connected through created VPN connection, you can either right-click on the Network icon in the system tray and select Network and Sharing Center or go to Control Panel and open Network and Sharing Center, and click on Connect to a network. 8.Now connect VPN Connection windows will appears. Hope this helps you.

benjamin

Posted 2012-01-23T16:54:15.637

Reputation: 1