OpenVPN Server configured but not started. Followed guide

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3  Next
Author Message
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Wed Feb 17, 2016 23:35    Post subject: Reply with quote
Unfortunately though my VPN client shows as Disconnected.

Quote:
2016-02-17 23:28:55 *Tunnelblick: openvpnstart starting OpenVPN
2016-02-17 23:28:56 OpenVPN 2.3.6 x86_64-apple-darwin [SSL (OpenSSL)] [LZO] [PKCS11] [MH] [IPv6] built on Feb 1 2016
2016-02-17 23:28:56 library versions: OpenSSL 1.0.1r 28 Jan 2016, LZO 2.08
2016-02-17 23:28:56 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:1339
2016-02-17 23:28:56 Need hold release from management interface, waiting...
2016-02-17 23:28:57 *Tunnelblick: Established communication with OpenVPN
2016-02-17 23:28:57 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:1339
2016-02-17 23:28:57 MANAGEMENT: CMD 'pid'
2016-02-17 23:28:57 MANAGEMENT: CMD 'state on'
2016-02-17 23:28:57 MANAGEMENT: CMD 'state'
2016-02-17 23:28:57 MANAGEMENT: CMD 'bytecount 1'
2016-02-17 23:28:57 MANAGEMENT: CMD 'hold release'
2016-02-17 23:28:57 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
2016-02-17 23:28:57 Socket Buffers: R=[196724->65536] S=[9216->65536]
2016-02-17 23:28:57 MANAGEMENT: >STATE:1455751737,RESOLVE,,,
2016-02-17 23:28:57 UDPv4 link local: [undef]
2016-02-17 23:28:57 UDPv4 link remote: [AF_INET]79.68.12.129:1194
2016-02-17 23:28:57 MANAGEMENT: >STATE:1455751737,WAIT,,,
2016-02-17 23:28:57 MANAGEMENT: >STATE:1455751737,AUTH,,,
2016-02-17 23:28:57 TLS: Initial packet from [AF_INET]79.68.12.129:1194, sid=e822f9f5 cbd192f5
2016-02-17 23:28:57 VERIFY OK: depth=1, C=UK
2016-02-17 23:28:57 VERIFY OK: nsCertType=SERVER
2016-02-17 23:28:57 VERIFY OK: depth=0, C=UK, CN=server
2016-02-17 23:28:58 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1573', remote='link-mtu 1570'
2016-02-17 23:28:58 WARNING: 'auth' is used inconsistently, local='auth SHA1', remote='auth MD5'
2016-02-17 23:28:58 WARNING: 'comp-lzo' is present in remote config but missing in local config, remote='comp-lzo'
2016-02-17 23:28:58 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
2016-02-17 23:28:58 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
2016-02-17 23:28:58 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
2016-02-17 23:28:58 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
2016-02-17 23:28:58 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
2016-02-17 23:28:58 [server] Peer Connection Initiated with [AF_INET]79.68.12.129:1194
2016-02-17 23:28:59 Authenticate/Decrypt packet error: packet HMAC authentication failed
2016-02-17 23:28:59 MANAGEMENT: >STATE:1455751739,GET_CONFIG,,,
2016-02-17 23:28:59 Authenticate/Decrypt packet error: packet HMAC authentication failed
2016-02-17 23:29:00 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
2016-02-17 23:29:00 PUSH: Received control message: 'PUSH_REPLY,route-gateway 192.168.1.1,ping 10,ping-restart 120,ifconfig 192.168.1.50 255.255.255.0'
2016-02-17 23:29:00 OPTIONS IMPORT: timers and/or timeouts modified
2016-02-17 23:29:00 OPTIONS IMPORT: --ifconfig/up options modified
2016-02-17 23:29:00 OPTIONS IMPORT: route-related options modified
2016-02-17 23:29:00 MANAGEMENT: Client disconnected
2016-02-17 23:29:00 Cannot open TUN/TAP dev /dev/tap0: No such file or directory (errno=2)
2016-02-17 23:29:00 Exiting due to fatal error
2016-02-17 23:29:02 *Tunnelblick: No 'post-disconnect.sh' script to execute
2016-02-17 23:29:02 *Tunnelblick: Expected disconnection occurred.


I see a few issues here, mainly the warnings. I could modify those on the client side but i'm not sure if this is necessary or not?

Cannot open Tun/TAP dev /dev/tap0 seems to be the real issue though. I'm still confused around the whole tun0 / tap0 business Sad
Sponsor
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Thu Feb 18, 2016 8:24    Post subject: Reply with quote
I made the required change, but my client still disconnects:

2016-02-18 08:18:19 Cannot open TUN/TAP dev /dev/tap0: No such file or directory (errno=2)
2016-02-18 08:18:19 Exiting due to fatal error
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Thu Feb 18, 2016 18:29    Post subject: Reply with quote
Woo ok so now I've made that change I am now able to get "Connected" (albeit, after about 30 seconds). But I can't access things in my home network like I could prior to changing to Bridged mode Sad


Client log
Quote:
2016-02-18 18:09:01 TUN/TAP device /dev/tap0 opened
2016-02-18 18:09:01 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
2016-02-18 18:09:01 MANAGEMENT: >STATE:1455818941,ASSIGN_IP,,192.168.1.50,
2016-02-18 18:09:01 /sbin/ifconfig tap0 delete
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
2016-02-18 18:09:01 NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
2016-02-18 18:09:01 /sbin/ifconfig tap0 192.168.1.50 netmask 255.255.255.0 mtu 1500 up
2016-02-18 18:09:01 /Applications/Tunnelblick.app/Contents/Resources/client.up.tunnelblick.sh -a -d -f -m -w -ptADGNWradsgnw tap0 1500 1573 192.168.1.50 255.255.255.0 init
**********************************************
Start of output from client.up.tunnelblick.sh
Configuring tap DNS via DHCP asynchronously
End of output from client.up.tunnelblick.sh
**********************************************
2016-02-18 18:09:03 Initialization Sequence Completed
2016-02-18 18:09:03 MANAGEMENT: >STATE:1455818943,CONNECTED,SUCCESS,192.168.1.50,79.68.12.129
Sleeping for 0 seconds to wait for DHCP to finish setup.
Sleeping for 1 seconds to wait for DHCP to finish setup.
Sleeping for 2 seconds to wait for DHCP to finish setup.
Sleeping for 3 seconds to wait for DHCP to finish setup.
Sleeping for 4 seconds to wait for DHCP to finish setup.
WARNING: No DNS information received from OpenVPN via DHCP, so no network/DNS configuration changes need to be made.
Will NOT monitor for other network configuration changes.
DNS servers '172.20.10.1' will be used for DNS queries when the VPN is active
The DNS servers do not include any free public DNS servers known to Tunnelblick. This may cause DNS queries to fail or be intercepted or falsified even if they are directed through the VPN. Specify only known public DNS servers or DNS servers located on the VPN network to avoid such problems.
Flushed the DNS cache via dscacheutil
/usr/sbin/discoveryutil not present. Not flushing the DNS cache via discoveryutil
Notified mDNSResponder that the DNS cache was flushed
2016-02-18 18:09:04 *Tunnelblick: No 'connected.sh' script to execute
2016-02-18 18:09:09 *Tunnelblick: This computer's apparent public IP address (85.255.235.244) was unchanged after the connection was made



Maybe something to do with the DHCP settings?

This is my ifconfig output on client, it has two IP addresses which I don't really understand.

tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ee:14:7f:d5:a9:12
inet 192.168.1.50 netmask 0xffffff00 broadcast 192.168.1.255
inet 169.254.52.64 netmask 0xffff0000 broadcast 169.254.255.255
media: autoselect
status: active
open (pid 1273)
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Thu Feb 18, 2016 20:12    Post subject: Reply with quote
Nope, I can't ping by IP to my home freenas or router etc.
(request time out) but I can ping google.com

Adding those client params to my client config meant that I could not even access the internet anymore (ping google.com failed)

Quote:
2016-02-18 20:09:13 Tunnelblick[372] currentIPInfo(Name): IP address info could not be fetched within 16.0 seconds; the error was 'Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSErrorFailingURLStringKey=https://www.tunnelblick.net/ipinfo, _kCFStreamErrorCodeKey=-2102, NSErrorFailingURLKey=https://www.tunnelblick.net/ipinfo, NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4, NSUnderlyingError=0x784160 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSErrorFailingURLStringKey=https://www.tunnelblick.net/ipinfo, NSErrorFailingURLKey=https://www.tunnelblick.net/ipinfo, NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4}}}'; the response was '(null)'
2016-02-18 20:09:13 Tunnelblick[372] tcp_connection_destination_perform_socket_connect 11 connectx to 205.233.73.116:80@0 failed: [65] No route to host
2016-02-18 20:09:13 Tunnelblick[372] tcp_connection_destination_perform_socket_connect 11 connectx to 205.233.73.116:80@0 failed: [65] No route to host
2016-02-18 20:09:14 Tunnelblick[372] tcp_connection_destination_perform_socket_connect 12 connectx to 205.233.73.116:80@0 failed: [65] No route to host
2016-02-18 20:09:14 Tunnelblick[372] tcp_connection_destination_perform_socket_connect 12 connectx to 205.233.73.116:80@0 failed: [65] No route to host
2016-02-18 20:09:15 Tunnelblick[372] tcp_connection_destination_perform_socket_connect 13 connectx to 205.233.73.116:80@0 failed: [65] No route to host
2016-02-18 20:09:15 Tunnelblick[372] tcp_connection_destination_perform_socket_connect 13 connectx to 205.233.73.116:80@0 failed: [65] No route to host
2016-02-18 20:09:16 Tunnelblick[372] tcp_connection_destination_perform_socket_connect 14 connectx to 205.233.73.116:80@0 failed: [65] No route to host
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Thu Feb 18, 2016 22:29    Post subject: Reply with quote
I can try tomorrow on my work laptop on a VM. I'll use the exact same settings as on the mac. Thanks for your help Smile

Weird though it worked OK when using the routed way.
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Fri Feb 19, 2016 13:48    Post subject: Reply with quote
I can't seem to get it to work on my work laptop, I think there is a problem because of the virtual infrustructure getting in the way. Arghh I really need to get this working before I go away for a couple of weeks on Sunday ha. I'm going to work at it this evening
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Fri Feb 19, 2016 21:59    Post subject: Reply with quote
OK so I did some more tests while connected to the VPN, I still cannot ping any of my internal structure but this was interesting:

Jamies-MacBook-Pro:~ Jamie$ arp -a
...
? (192.168.1.1) at (incomplete) on tap0 ifscope [ethernet]
? (192.168.1.2) at (incomplete) on tap0 ifscope [ethernet]
? (192.168.1.4) at (incomplete) on tap0 ifscope [ethernet]
? (192.168.1.5) at (incomplete) on tap0 ifscope [ethernet]
? (192.168.1.100) at (incomplete) on tap0 ifscope [ethernet]
? (192.168.1.255) at (incomplete) on tap0 ifscope [ethernet]

The above addresses are the only addresses currently in use on my home network (.100 being my laptop) which is strange. I'm not really sure what this means though ha some problem with translation from internet layer to link layer ?

Also notices my netmask is represented different on my tap0 which is weird:
inet 192.168.1.50 netmask 0xffffff00 broadcast 192.168.1.255

Tried messing around with some firewall rules but nothing is working :/

Just to clarify, these are my current setups: (NO scripts in the Command section)

Quote:
remote *dyndnshere* 1194

client
dev tap
proto udp
resolv-retry infinite
nobind
persist-key
persist-tun
float

verb 3

ca ca.crt
cert macbook.crt
key macbook.key

ns-cert-type server




Any more ideas or troubleshooting? Sad
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Sat Feb 20, 2016 0:27    Post subject: Reply with quote
I didn't reset the router. I have so many settings on there it's going to be a nightmare to do :/
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Sat Feb 20, 2016 1:51    Post subject: Reply with quote
Is this definitely correct?

Pool start IP: 192.168.1.50
Pool end IP: 192.168.1.60
Gateway: 192.168.1.1
Netmask: 255.255.255.0 ?

Taking into consideration that my home network is on 192.168.1.*

DHCP range from *.100 upwards,

Static ranges only up to .10
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Sat Feb 20, 2016 2:08    Post subject: Reply with quote
Ok thanks, will try that now, here is my config PRE - dhcp proxy change you suggest:

Code:
root@DD-WRT:~# cat /tmp/openvpn/openvpn.conf
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
keepalive 10 120
verb 3
mute 3
syslog
writepid /var/run/openvpnd.pid
management 127.0.0.1 14
management-log-cache 100
topology subnet
script-security 2
port 1194
proto udp
cipher bf-cbc
auth sha1
client-connect /tmp/openvpn/clcon.sh
client-disconnect /tmp/openvpn/cldiscon.sh
client-config-dir /tmp/openvpn/ccd
comp-lzo adaptive
tls-server
ifconfig-pool-persist /tmp/openvpn/ip-pool 86400
client-to-client
fast-io
tun-mtu 1500
mtu-disc yes
server-bridge 192.168.1.1 255.255.255.0 192.168.1.50 192.168.1.60
dev tap2


Edit: still no dice with the dhcp proxy option, Only change I see is my tap0 now only has one IP / broadcast instead of two like before:
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 52:70:46:54:65:b3
inet 169.254.17.50 netmask 0xffff0000 broadcast 169.254.255.255
media: autoselect
status: active
open (pid 12813)
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Sat Feb 20, 2016 2:18    Post subject: Reply with quote
Gah!

Maybe it is something to do with my client then.. I do have an awful lot of interfaces on my macbook for one reason or another..

Code:
Jamies-MacBook-Pro:mnt Jamie$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
   options=3<RXCSUM,TXCSUM>
   inet6 ::1 prefixlen 128
   inet 127.0.0.1 netmask 0xff000000
   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
   nd6 options=1<PERFORMNUD>

gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280

stf0: flags=0<> mtu 1280

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
   ether a0:99:9b:1c:eb:cb
   inet6 fe80::a299:9bff:fe1c:ebcb%en0 prefixlen 64 scopeid 0x4
   inet 172.20.10.2 netmask 0xfffffff0 broadcast 172.20.10.15
   nd6 options=1<PERFORMNUD>
   media: autoselect
   status: active

en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
   options=60<TSO4,TSO6>
   ether 4a:00:02:6e:d2:50
   media: autoselect <full-duplex>
   status: inactive

en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
   options=60<TSO4,TSO6>
   ether 4a:00:02:6e:d2:51
   media: autoselect <full-duplex>
   status: inactive

p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
   ether 02:99:9b:1c:eb:cb
   media: autoselect
   status: inactive

awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
   ether ea:b4:2b:8b:25:4f
   inet6 fe80::e8b4:2bff:fe8b:254f%awdl0 prefixlen 64 scopeid 0x8
   nd6 options=1<PERFORMNUD>
   media: autoselect
   status: active

bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
   options=63<RXCSUM,TXCSUM,TSO4,TSO6>
   ether a2:99:9b:c1:75:00
   Configuration:
      id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
      maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
      root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
      ipfilter disabled flags 0x2
   member: en1 flags=3<LEARNING,DISCOVER>
           ifmaxaddr 0 port 5 priority 0 path cost 0
   member: en2 flags=3<LEARNING,DISCOVER>
           ifmaxaddr 0 port 6 priority 0 path cost 0
   nd6 options=1<PERFORMNUD>
   media: <unknown type>
   status: inactive

tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
   ether 52:70:46:54:65:b3
   inet 169.254.17.50 netmask 0xffff0000 broadcast 169.254.255.255
   media: autoselect
   status: active
   open (pid 12813)
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Sat Feb 20, 2016 2:26    Post subject: Reply with quote
I can't see anything online saying that it doesn't support it. As far as I know, it's just an OSX implementation of openvpn client for windows

I need to head to sleep now, 2.30am my time. Thanks very much for your help. I'm going to try and crack on again tomorrow but I'm a bit lost with what to do now.
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Mon Feb 22, 2016 8:52    Post subject: Reply with quote
Still no luck.

I noticed that when I stay attached to the VPN for a while, that I will drop and reconnect every 4 mins:

http://pastebin.com/3xMYnVFy

Here is my log from my client. I also noticed I have a tap0 and also a tap1 on my OSX which may be causing some problems. (When i restart my mac, I don't have any tap interfaces until I begin the vpn stuff.
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Mon Feb 22, 2016 20:51    Post subject: Reply with quote
Ok thank you, I will have to try this on Sunday when I am back home. Will let you know how it goes Smile
windyboi
DD-WRT User


Joined: 01 Dec 2015
Posts: 111

PostPosted: Mon Feb 29, 2016 20:06    Post subject: Reply with quote
Ok so I've reset the router to factory settings, and then configured the open vpn server, using exactly the same config as before and the same client config also.

Here's the output from my client log on pastern (if you can be bothered to look at it http://pastebin.com/Rfxb8Mwe ) . I can't see anything interesting in there, apart from perhaps the output of ifconfig might be significant (maybe theres some error still in bridging into my network).

Are there any other tests that you can think of that I can perform? I'm lost really.

Thank you.
Goto page Previous  1, 2, 3  Next Display posts from previous:    Page 2 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum