I am using OpenVPN to connect get access to my home network from my laptop when I am away from home. I have my smartphone connected to the Internet via its data connection and running a WiFi access point the laptop is connected to. Then I run OpenVPN on the laptop to connect into my home network. The laptop dual boots Windows 7 and Mythbuntu 14.04, and the connection works from Mythbuntu. But when I connect from Windows 7, everything seems to work initially, but after a few seconds, Windows stops getting any replies to packets it sends. In particular, arp stops working.
Both Windows and Mythbuntu use the same cryptographic setup - the files for the certificates and so on are stored in the Windows OpenVPN folder and the Mythbuntu OpenVPN setup just uses the same files directly. Unfortunately, the way Mythbuntu does the OpenVPN configuration is via its NetworkManager applet, which does not allow me to also share using the same client .conf file. I believe it is possible to import an existing .conf file, which I think is how I originally set up Mythbuntu, but since then my home network configuration has changed and the two setups have been updated independently. I do not want to try importing the existing Windows .conf file as that may stop Mythbuntu from connecting properly too.
The server is on my home Mythbuntu 14.04 box, running OpenVPN 2.3.4-debian0. This is the server.conf file:
local 10.0.2.4
port 1194
proto udp
dev tap0
up "/etc/openvpn/up.sh br0 tap0 1500"
down "/etc/openvpn/down.sh br0 tap0"
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
ifconfig-pool-persist ipp.txt
server-bridge 10.0.2.4 255.255.255.0 10.0.2.121 10.0.2.130
keepalive 10 120
tls-auth ta.key 0
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 4
script-security 3 system
mssfix 1200
Windows 7 has been updated to the latest OpenVPN version (openvpn-install-2.3.6-I601-x86_64.exe) and this is its client .conf file (jsw.gen.nz.ovpn):
client
dev tap
dev-node tap0
proto udp
remote openvpn.jsw.gen.nz 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert gt70.crt
key gt70.key
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-CBC
comp-lzo
verb 4
route-method exe
route-delay 2
I ran a test to get some clean logs. What I did was to restart the OpenVPN server, connect Windows 7 to the Internet via my mobile, then start Wireshark/Tshark at each end on the tap0 interfaces. I ran a continouous ping command on the laptop, then started the OpenVPN laptop client. Here is what the pings showed:
[C:\Program Files\OpenVPN\log]ping -n 10000 10.0.2.4
Pinging 10.0.2.4 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 10.0.2.4: bytes=32 time=153ms TTL=64
Reply from 10.0.2.4: bytes=32 time=171ms TTL=64
Reply from 10.0.2.4: bytes=32 time=210ms TTL=64
Reply from 10.0.2.4: bytes=32 time=136ms TTL=64
Reply from 10.0.2.4: bytes=32 time=151ms TTL=64
Reply from 10.0.2.4: bytes=32 time=163ms TTL=64
Reply from 10.0.2.4: bytes=32 time=182ms TTL=64
Reply from 10.0.2.4: bytes=32 time=319ms TTL=64
Reply from 10.0.2.4: bytes=32 time=205ms TTL=64
Reply from 10.0.2.4: bytes=32 time=208ms TTL=64
Reply from 10.0.2.4: bytes=32 time=149ms TTL=64
Reply from 10.0.2.4: bytes=32 time=166ms TTL=64
Reply from 10.0.2.4: bytes=32 time=269ms TTL=64
Reply from 10.0.2.4: bytes=32 time=219ms TTL=64
Reply from 10.0.2.4: bytes=32 time=443ms TTL=64
Reply from 10.0.2.4: bytes=32 time=157ms TTL=64
Reply from 10.0.2.4: bytes=32 time=265ms TTL=64
Reply from 10.0.2.4: bytes=32 time=167ms TTL=64
Reply from 10.0.2.4: bytes=32 time=206ms TTL=64
Reply from 10.0.2.4: bytes=32 time=333ms TTL=64
Reply from 10.0.2.4: bytes=32 time=298ms TTL=64
Reply from 10.0.2.4: bytes=32 time=156ms TTL=64
Reply from 10.0.2.4: bytes=32 time=191ms TTL=64
Reply from 10.0.2.4: bytes=32 time=546ms TTL=64
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 10.0.2.121: Destination host unreachable.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 10.0.2.4:
Packets: Sent = 105, Received = 25, Lost = 80 (76% loss),
Approximate round trip times in milli-seconds:
Minimum = 136ms, Maximum = 546ms, Average = 227ms
Control-C
^C
Initially, the pings do not work until the VPN connection comes up. Then they work for a while, and then stop working. Eventually, the OpenVPN client sees no keepalive responses and tries to restart the connection. Restarting does not work, and also the server has not seen any disconnection and thinks that the restarted connection is a duplicate connection from the same PC. Eventually, I told the client to disconnect, which did not work and it stayed in a "disconnecting" state until I "exit"ed the OpenVPN GUI (which also kills the OpenVPN client).
As posting the logs here makes this post too big for the forum, I have put copies of all these files plus the logs (jsw.gen.nz.log = cleint, openvpn.log = server) and Wireshark/Tshark capture files from the tap0 interfaces (windows7.pgapng = client, windows7.tap0 = server) in a zip file on my web server:
http://www.jsw.gen.nz/win7_openvpn_problem.zip
The tap interface capture files seem to show the same thing as the pings - the connection works for a while, then traffic from the client to the server stops getting through to the server. But not entirely - broadcast traffic is still making it through. Arps are not working, so traffic from the client to specific IP addresses at the server end stops working.
So does anyone have any idea what may be going wrong here?