Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Openvpn, and it worked great when I used it on PC (Windows 8), then I copied all files (Certificates and config) to an Android 4 phone to use them. Now, Openvpn works on the phone, but not the PC. Specifically, when I open Google I get: The server at www.google.com can't be found, because the DNS lookup failed, but the VPN seems to be connected.

I have a simple question, could the problem be because I copied the same files?

Routing table before connecting:-

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.1.254    192.168.1.101     25
        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.1.0    255.255.255.0         On-link     192.168.1.101    281
    192.168.1.101  255.255.255.255         On-link     192.168.1.101    281
    192.168.1.255  255.255.255.255         On-link     192.168.1.101    281
        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     192.168.1.101    281
  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     192.168.1.101    281
===========================================================================

Routing table after connecting:-

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    192.168.1.254    192.168.1.101     25
          0.0.0.0        128.0.0.0         10.8.0.5         10.8.0.6     30
         10.8.0.1  255.255.255.255         10.8.0.5         10.8.0.6     30
         10.8.0.4  255.255.255.252         On-link          10.8.0.6    286
         10.8.0.6  255.255.255.255         On-link          10.8.0.6    286
         10.8.0.7  255.255.255.255         On-link          10.8.0.6    286
     **.**.***.**  255.255.255.255    192.168.1.254    192.168.1.101     25
        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
        128.0.0.0        128.0.0.0         10.8.0.5         10.8.0.6     30
      192.168.1.0    255.255.255.0         On-link     192.168.1.101    281
    192.168.1.101  255.255.255.255         On-link     192.168.1.101    281
    192.168.1.255  255.255.255.255         On-link     192.168.1.101    281
        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     192.168.1.101    281
        224.0.0.0        240.0.0.0         On-link          10.8.0.6    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     192.168.1.101    281
  255.255.255.255  255.255.255.255         On-link          10.8.0.6    286
===========================================================================

Server conf:-

port 1194
proto udp
dev tun
ca ca.crt
cert myservername.crt
key myservername.key 
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
duplicate-cn
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
push "redirect-gateway def1"

Client conf:-

client
dev tun
proto udp
remote 89.32.148.35 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ca.crt
cert client1.crt
key client1.key
verb 3
comp-lzo
redirect-gateway def1

Here is the log file:-

Tue Dec 18 16:34:27 2012 OpenVPN 2.2.2 Win32-MSVC++ [SSL] [LZO2] [PKCS11] built on Dec 15 2011

Tue Dec 18 16:34:27 2012 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.

Tue Dec 18 16:34:27 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables

Tue Dec 18 16:34:27 2012 LZO compression initialized

Tue Dec 18 16:34:27 2012 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]

Tue Dec 18 16:34:27 2012 Socket Buffers: R=[65536->65536] S=[65536->65536]

Tue Dec 18 16:34:27 2012 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]

Tue Dec 18 16:34:27 2012 Local Options hash (VER=V4): '41690919'

Tue Dec 18 16:34:27 2012 Expected Remote Options hash (VER=V4): '530fdded'

Tue Dec 18 16:34:27 2012 UDPv4 link local: [undef]

Tue Dec 18 16:34:27 2012 UDPv4 link remote: ..*.:1194

Tue Dec 18 16:34:27 2012 TLS: Initial packet from ..*.:1194, sid=4d1496ad 2079a5fa

Tue Dec 18 16:34:28 2012 VERIFY OK: depth=1, /C=/ST=/L=/O=/OU=/CN=/name=/emailAddress=

Tue Dec 18 16:34:28 2012 VERIFY OK: depth=0, /C=/ST=/L=/O=/OU=/CN=/name=/emailAddress=

Tue Dec 18 16:34:29 2012 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key

Tue Dec 18 16:34:29 2012 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication

Tue Dec 18 16:34:29 2012 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key

Tue Dec 18 16:34:29 2012 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication

Tue Dec 18 16:34:29 2012 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA

Tue Dec 18 16:34:29 2012 [myservername] Peer Connection Initiated with ..*.:1194

Tue Dec 18 16:34:32 2012 SENT CONTROL [myservername]: 'PUSH_REQUEST' (status=1)

Tue Dec 18 16:34:32 2012 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'

Tue Dec 18 16:34:32 2012 OPTIONS IMPORT: timers and/or timeouts modified

Tue Dec 18 16:34:32 2012 OPTIONS IMPORT: --ifconfig/up options modified

Tue Dec 18 16:34:32 2012 OPTIONS IMPORT: route options modified

Tue Dec 18 16:34:32 2012 ROUTE default_gateway=192.168.1.254

Tue Dec 18 16:34:32 2012 TAP-WIN32 device [Local Area Connection] opened: \.\Global{F0CFEBBF-9B1B-4CFB-8A82-027330974C30}.tap

Tue Dec 18 16:34:32 2012 TAP-Win32 Driver Version 9.9

Tue Dec 18 16:34:32 2012 TAP-Win32 MTU=1500

Tue Dec 18 16:34:32 2012 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.8.0.6/255.255.255.252 on interface {F0CFEBBF-9B1B-4CFB-8A82-027330974C30} [DHCP-serv: 10.8.0.5, lease-time: 31536000]

Tue Dec 18 16:34:32 2012 Successful ARP Flush on interface [26] {F0CFEBBF-9B1B-4CFB-8A82-027330974C30}

Tue Dec 18 16:34:37 2012 TEST ROUTES: 2/2 succeeded len=1 ret=1 a=0 u/d=up

Tue Dec 18 16:34:37 2012 C:\WINDOWS\system32\route.exe ADD ..*. MASK 255.255.255.255 192.168.1.254

Tue Dec 18 16:34:37 2012 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=25 and dwForwardType=4

Tue Dec 18 16:34:37 2012 Route addition via IPAPI succeeded [adaptive]

Tue Dec 18 16:34:37 2012 C:\WINDOWS\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 10.8.0.5

Tue Dec 18 16:34:37 2012 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4

Tue Dec 18 16:34:37 2012 Route addition via IPAPI succeeded [adaptive]

Tue Dec 18 16:34:37 2012 C:\WINDOWS\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 10.8.0.5

Tue Dec 18 16:34:37 2012 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4

Tue Dec 18 16:34:37 2012 Route addition via IPAPI succeeded [adaptive]

Tue Dec 18 16:34:37 2012 C:\WINDOWS\system32\route.exe ADD 10.8.0.1 MASK 255.255.255.255 10.8.0.5

Tue Dec 18 16:34:37 2012 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4

Tue Dec 18 16:34:37 2012 Route addition via IPAPI succeeded [adaptive]

Tue Dec 18 16:34:37 2012 Initialization Sequence Completed

share|improve this question
    
Because It's a mess, and I might break something that is already working; maybe it's my PC that has got something wrong. Yes, I only copied them. I even copied from my phone back to PC, it still doesn't work and phone still works. –  jaja Dec 18 '12 at 14:34
    
What you are saying doesn't make sense. I'm willing to resetup the server it, only if it's the problem. –  jaja Dec 18 '12 at 14:47
    
I wish you good luck solving your problem. –  Ramhound Dec 18 '12 at 14:53

1 Answer 1

If you didn't set the duplicate-cn in the server config, then you won't be able to connect with two clients at the same with the same key.

Having a look at your log, this doesn't seem to be the problem since you are connected and the smartphone is disconnected at the same time. (and would have the same ip)


You route all traffic over the VPN due to redirect-gateway def1. Is this what you want?

You use net30 topology, so having 10.8.0.6 for your client, 10.8.0.5 as a (virtual) gateway for your client, and 10.0.8.1 for your vpn-server seems fine.

On the server routing from DNS server to your client works? Maybe some of that setup is broken after restarting the server or similar.

Please try to ping an ip from the client. If that works, then DNS is the problem. (www.google.com -> 173.194.69.147)

The vpn-server has to work like a NAT for your vpn and the server must be able to connect to the DNS server the client wants to use, push "dhcp-option DNS x.x.x.x to the client or push "redirect-gateway bypass-dns def1". (Backup your dns server config if any). The client might try 192.168.1.254 as DNS server and the server isn't able to find a DNS server under this ip.

The smartphone possibly just refuses to redirect all traffic or tries to use a different DNS server. Not really sure though why this would surface now.

share|improve this answer
    
I've enabled it right now and restarted openvpn on the server. I tried to connect but same error when opening Google. –  jaja Dec 18 '12 at 14:55
    
@jaja: it seems to be a networking/routing problem. So what is your normal network setup (on the PC) and what should it be with the VPN? You push 192.168.1.254 as the default gateway and some VPN routes. What is your routing table before and after the connection? –  JonnyJD Dec 18 '12 at 15:06
    
I've updated my post to include the client and server conf files. Yes they both have the same IP, but I try to connect from PC while the mobile is disconnected. I'll include the routing table in a bit. –  jaja Dec 18 '12 at 15:12
    
@jaja: edited again. Looks like networking/dns problems to me. Not sure why it worked before. Did you change any DNS option on the PC? –  JonnyJD Dec 18 '12 at 16:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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