1

Windows 2012 Server has two network interfaces. One with static IPv4 configuration and a TAP adapter which is activated when this server connects to remote OpenVPN server.

Physical NIC, which is used by this server to communicate with Internet, has usual IPv4 settings (address,mask,default gateway, dns).

Once connection with remote OpenVPN server is established, ip address 10.0.10.6/24 is assigned via DHCP on TAP interface and I can communicate with OpenVPN's ip 10.0.10.1.

However, if I try to add route to a network behind OpenVPN server, Windows ignores it - tracert shows that packets to hosts in this network go through default gateway.

This is the routing table with VPN connection established.

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination      Netmask        Gateway       Interface  Metric
0.0.0.0           0.0.0.0          100.100.67.1   100.100.67.45    11
10.0.10.0         255.255.255.0    10.0.10.5      10.0.10.6        20
100.100.67.0      255.255.255.192  On-link        100.100.67.45   266
100.100.67.45     255.255.255.255  On-link        100.100.67.45   266
100.100.67.63     255.255.255.255  On-link        100.100.67.45   266
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  
192.168.151.0     255.255.255.0    10.0.10.1      10.0.10.6        21
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        10.0.10.6       276
224.0.0.0         240.0.0.0        On-link        100.100.67.45   266
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        10.0.10.6       276
255.255.255.255   255.255.255.255  On-link        100.100.67.45   266
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0  100.100.67.1  Default
===========================================================================

(I changed first two octets of ISP network to 100.100)

Communications between this server (10.0.10.6) and OpenVPN server (10.0.10.1) are working fine. As you can see, there is a route to 192.168.151.0/24 network via 10.0.10.1 gateway which is available through local address 10.0.10.6

I add this route like this:

route add 192.168.151.0 mask 255.255.255.0 10.0.10.1

However, tracing host in 192.168.151.0/24 network shows that packets are sent through default route to Internet Provider instead of being routed through gateway 10.0.10.1

C:\Users\user1>tracert -d 192.168.151.1
Tracing route to 192.168.151.1 over a maximum of 30 hops

  1    2 ms    2 ms    5 ms  100.100.67.1
  2   <1 ms   <1 ms    2 ms  213.239.245.229
  3    3 ms    5 ms    2 ms  213.239.224.13
^C
C:\Users\user1>

What am I missing?

  • Why is the gateway for 10.0.10.0 not On-link instead of 10.0.10.5? – Ron Maupin Dec 4 '19 at 23:15
  • 1
    Your gateway should be 10.0.10.5. If you want things to be simpler you probably should be using the subnet topology on the openvpn server, not net30. Look closely at your other route 10.0.10.0 255.255.255.0 10.0.10.5 10.0.10.6 – Zoredache Dec 4 '19 at 23:58
  • Thank you very much. I was not even aware about legacy net30 topology. For now routing through 10.0.10.5 works, I'll move to topology subnet in nearest future. Could you please make it an answer so I can accept it? – user2586441 Dec 5 '19 at 4:55
  • @Zoredache, could you please make your comment an answer so I can accept it? – user2586441 Dec 6 '19 at 8:28
1

As @Zoredache stated in comments, my openvpn server had the topology net30 option, so route through vpn server should be configured through 10.0.10.5 address, not On-link address on TAP interface.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.