3
For some reason Windows is using only one interface for local network broadcasting (the one with lowest metrics). When client connects to VPN network, i want it to make new network preferred for broadcasting by changing metric value for 255.255.255.255 route on the interface. Microsoft has a DHCP option that helps tweaking interface metric: Default Router Metric Base (http://msdn.microsoft.com/en-us/library/cc227277.aspx). However, i can't make it working.
Client is running Windows 8, but similar problem exists on Windows 7 (can't say for earlier versions, although it must be present, as Windows identifies itself as "MSFT 5.0" since Windows 2000). Server is ISC DHCP Server 4.2 (isc-dhcp42-server-4.2.4_2). Client connects to the server through OpenVPN tunnel and receives DHCP information. According to Wireshark capture vendor specific options are sent as well. But it does not make any difference, table is identical to the one without that vendor option being sent.
Here is DHCP config:
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
option space ms-specific;
option ms-specific.metric-fix code 3 = unsigned integer 32;
subnet 172.16.130.0 netmask 255.255.255.0
{
range 172.16.130.80 172.16.130.130;
option routers 172.16.130.8;
option broadcast-address 172.16.130.255;
default-lease-time 600;
max-lease-time 7200;
vendor-option-space ms-specific;
option ms-specific.metric-fix 1;
}
Here is client's routing table after connecting
Address Mask Gateway Interface Metric
0.0.0.0 0.0.0.0 172.16.13.8 172.16.13.80 20
0.0.0.0 0.0.0.0 172.16.130.8 172.16.130.80 30
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
172.16.13.0 255.255.255.0 On-link 172.16.13.80 276
172.16.13.80 255.255.255.255 On-link 172.16.13.80 276
172.16.13.255 255.255.255.255 On-link 172.16.13.80 276
172.16.130.0 255.255.255.0 On-link 172.16.130.80 286
172.16.130.80 255.255.255.255 On-link 172.16.130.80 286
172.16.130.255 255.255.255.255 On-link 172.16.130.80 286
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 172.16.13.80 276
224.0.0.0 240.0.0.0 On-link 172.16.130.80 286
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 172.16.13.80 276
255.255.255.255 255.255.255.255 On-link 172.16.130.80 286
172.16.13.0/24 is physical local network. 172.16.130.0/24 is VPN. As you can see, routes from physical local network have lower metric. I believe it should be possible to prioritize VPN because Hamachi, for example, also creates virtual interface with 'Automatic metric' turned on, but after connecting it always has lower metric than both physical network and OpenVPN tunnel. I tried changing adapter order in 'Advanced settings' in 'ncpa.cpl', but it also had no effect.
So, is there any way to make my OpenVPN tunnel preferred for 255.255.255.255 broadcasting? It would be excellent if i can do it on server side, so clients do not have to adjust anything.
Microsoft NetBios name resolution is broadcast based, I did a test (windows 7) few moments ago to test name resolution in physical and VPN segment. In both cases I've received an answer. – Michal Sokolowski – 2016-05-19T02:57:18.527