I have the following network setup:
Ethernet adapter OpenVPN:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Win32 Adapter V9
IPv4 Address. . . . . . . . . . . : 10.109.254.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.252
Default Gateway . . . . . . . . . :
Ethernet adapter VPN Adapter:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Loopback Adapter
IPv4 Address. . . . . . . . . . . : 192.168.0.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 0.0.0.0
Ethernet adapter PublicNetwork-A:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : A.B.C.130(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.192
Default Gateway . . . . . . . . . : A.B.C.129
OpenVPN is the TAP adapter created by OpenVPN.
VPN Adapter is a Microsoft Loopback Adapter used by RRAS for VPN and NAT.
PublicNetwork is a physical adapter, with a public IP address assigned.
Not important at all, but I have another physical adapter, named PrivateNetwork that is only used for internal networking. It should make no difference with or without it.
I successfully installed OpenVPN but can not get the Internet traffic from a client connection to OpenVPN redirected through the server.
My config files below:
server.ovpn
client.ovpn:port 80
proto udp
dev tun
ca "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.crt"
key "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.key"
dh "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\dh1024.pem"
server 10.109.254.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1" # This will force the clients to use the server`s internet connection
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
cipher BF-CBC
comp-lzo
max-clients 254
persist-key
persist-tun
script-security 3
auth-user-pass-verify "cscript.exe Auth4OpenVPN.vbs" via-env
client-cert-not-required
username-as-common-name
status openvpn-status.log
verb 4
I would like to route all OpenVPN client traffic via the server.client
dev tun
proto udp
remote A.B.C.130 80
route 192.168.0.0 255.255.255.0
resolv-retry infinite
nobind
persist-key
persist-tun
ca "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\ca.crt"
auth-user-pass
cipher BF-CBC # Blowfish (default) encrytion
comp-lzo
redirect-gateway def1
verb 1
I enabled [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"IPEnableRouter"=dword:00000001 .
The OpenVPN TAP adapter does not appear in the NAT interface list when I try to add it. If I try to add it via netsh I get an error, saying that “the adapter is not connected to the router” (or something like this). After some more reading it seems that Microsoft does not like virtual adapters much, unless it`s their own.
ICS is not an option as it will not run in parallel with RRAS.
Also I`d like to avoid any 3rd party software like NAT32 and just use the builtin RRAS functionality, without messing the PPTP VPN up.
I guess the only option I have is to configure some static routes, but I am unsure as to what static route(s) should I add to the routing table.I tried different route add command, coupled with the push route X.Y.Z.Q in the config file with no success.
Can someone please provide some input as for the route(s) I should add to the Windows routing table and to the server.ovpn file, taking into consideration my config.
Thank you very much,