Is it possible to change the connection type in Windows 7? I have a OpenVPN connection which is identified as "unidentified network" and I do not want to apply certain rules to all unidentified networks in the firewall.
How does one conquer this?
|
Is it possible to change the connection type in Windows 7? I have a OpenVPN connection which is identified as "unidentified network" and I do not want to apply certain rules to all unidentified networks in the firewall. How does one conquer this?
| ||||
|
feedback
|
|
Look at "TAP driver / identified vs unidentified networks" or "Vista and Windows Server 2008 - Unidentified network" | ||||
feedback
|
|
You have to add default gateway for OpenVPN network interface. The way I found is adding route to target address 0.0.0.0 via network interface used OpenVPN. In this example I have a computer with the physical interface with IP addres 10.20.20.20 in network 10.20.20.0/24 and the OpenVPN TAP interface with IP address 10.1.1.10/24 in network 10.1.1.0/24 (IP address of server on VPN network is 10.1.1.1). 1) Find out your network interfaces and information about current route to 0.0.0.0:
At now we know that your OpenVPN network interface number is 15. Another important information is the metric of current route to 0.0.0.0. New route to 0.0.0.0 for OpenVPN network should have higher metric value than current to avoid redirecting whole network traffic to your OpenVPN connection instead of physical network (in case of two routes with the same routes, the route with lower metric will be chosen). 2) Add route to 0.0.0.0 via OpenVPN interface:
This command adds route to 0.0.0.0 via interface 15 with metric at least 50 and gateway 10.1.1.1. Replace the gateway with your own (IP address of server on VPN network). And of course, replace the interface number with your own. The -p argument adds route as permanent so it will be preserved after system reboot. 3) (Re)connect to VPN server and look into route table again:
And network is now identified in Network and Sharing Center so the 'Set a location...' window should appear ;-) | |||
|
feedback
|
|
This works, but it is better if you take it one step further by changing the IP settings for the TAP addapter manual. Use Update: Ignore this step if you do it your IP address won't be masked. I don't know why that is but i have done everything I can think of to reverse it, but the only way is to undo what I did in this step and reboot the computer. Update. A problem i have with this is that I configured windows 7 to start the connection when i boot windows and sometimes when i reboot or shutdown the computer, the network would go back to unknown. The route would still be in the table. A work around to this was to modify my configuration file for the VPN client i connect to. The command I added was: Dummy default gateway to work around Windows 'unidentified network'/'unknown network' (put a "#" in front of this) route-metric 30 route 0.0.0.0 0.0.0.0 10.0.0.1. Metric is retrieved by reading the route table that is displayed with the route print -4 command. 10.0.0.1 is the gateway that the vpn connects to. for example when i'm connected to the vpn, my route table looks something like this:IPv4 Route TableActive Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.100 25 0.0.0.0 128.0.0.0 10.0.0.1 10.0.7.102 30 The first entry is the route to my router. The second one is the VPN Connection. Now when i modify the vpn connection file (vpn.ovpn in my case)I use the network destination and make the netmask 0.0.0.0. And use 10.0.0.1 as my gateway. I then note that the metric is set to 30 and set it to 30 in the config file. | ||||
|
feedback
|