Hi,
i have some trouble with creating a p2p connection between a debian server and an OpenWRT router. Here are the config files:
The debian server:
dev tun
proto tcp-server
comp-lzo
port 40960
ifconfig 172.21.211.129 172.21.211.1
secret keys/dn42_home.key
log log/dn42_home.log
log-append log/dn42_home.log
verb 7
The relevant part of the openvpn config on the openwrt router:
config openvpn 'dn42_meldir'
option enabled '1'
option mode 'p2p'
option dev 'tun'
option proto 'tcp-client'
option port '40960'
option remote '37.221.193.14'
option ifconfig '172.23.211.1 172.23.211.129'
option secret '/etc/openvpn/meldir.psk'
option verb 9
option comp_lzo '1'
option log '/tmp/dn42_meldir.log'
And the results in the log file:
Debian Server
Mon Aug 4 10:36:26 2014 us=106523 TUN/TAP device tun0 opened
Mon Aug 4 10:36:26 2014 us=106571 TUN/TAP TX queue length set to 100
Mon Aug 4 10:36:26 2014 us=106609 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Mon Aug 4 10:36:26 2014 us=106654 /sbin/ifconfig tun0 172.21.211.129 pointopoint 172.21.211.1 mtu 1500
Mon Aug 4 10:36:26 2014 us=109826 Data Channel MTU parms [ L:1547 D:1450 EF:47 EB:135 ET:0 EL:0 AF:3/1 ]
Mon Aug 4 10:36:26 2014 us=132534 Local Options String: 'V4,dev-type tun,link-mtu 1547,tun-mtu 1500,proto TCPv4_SERVER,ifconfig 172.21.211.1 172.21.211.129,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,secret'
Mon Aug 4 10:36:26 2014 us=132602 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1547,tun-mtu 1500,proto TCPv4_CLIENT,ifconfig 172.21.211.129 172.21.211.1,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,secret'
Mon Aug 4 10:36:26 2014 us=132645 Local Options hash (VER=V4): '3ccfa33b'
Mon Aug 4 10:36:26 2014 us=132662 Expected Remote Options hash (VER=V4): '8ca2e772'
Mon Aug 4 10:36:26 2014 us=132724 Listening for incoming TCP connection on [undef]
OpenWRT Router
Mon Aug 4 10:25:56 2014 us=171830 OpenVPN 2.2.2 mips-openwrt-linux [SSL] [LZO2] [EPOLL] built on Mar 14 2013
Mon Aug 4 10:25:56 2014 us=172649 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Mon Aug 4 10:25:56 2014 us=188448 WARNING: file '/etc/openvpn/meldir.psk' is group or others accessible
Mon Aug 4 10:25:56 2014 us=189174 Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Aug 4 10:25:56 2014 us=189424 Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Aug 4 10:25:56 2014 us=190890 Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Aug 4 10:25:56 2014 us=191112 Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Aug 4 10:25:56 2014 us=191316 LZO compression initialized
Mon Aug 4 10:25:56 2014 us=191640 Socket Buffers: R=[87380->131072] S=[16384->131072]
Mon Aug 4 10:25:56 2014 us=203605 TUN/TAP device tun2 opened
Mon Aug 4 10:25:56 2014 us=203844 TUN/TAP TX queue length set to 100
Mon Aug 4 10:25:56 2014 us=204188 /sbin/ifconfig tun2 172.23.211.1 pointopoint 172.23.211.129 mtu 1500
Mon Aug 4 10:25:56 2014 us=214888 Data Channel MTU parms [ L:1547 D:1450 EF:47 EB:135 ET:0 EL:0 AF:3/1 ]
Mon Aug 4 10:25:56 2014 us=215243 Attempting to establish TCP connection with 37.221.193.14:40960 [nonblock]
Mon Aug 4 10:25:57 2014 us=215890 TCP connection established with 37.221.193.14:40960
Mon Aug 4 10:25:57 2014 us=216103 TCPv4_CLIENT link local: [undef]
Mon Aug 4 10:25:57 2014 us=216243 TCPv4_CLIENT link remote: 37.221.193.14:40960
Mon Aug 4 10:25:58 2014 us=415879 event_wait returned 0
Mon Aug 4 10:25:59 2014 us=613695 event_wait returned 0
Mon Aug 4 10:26:00 2014 us=812185 event_wait returned 0
Mon Aug 4 10:26:02 2014 us=10647 event_wait returned 0
Mon Aug 4 10:26:03 2014 us=209128 event_wait returned 0
Both sides have the tun device created and assigned the IPs and created a direct route via the tun devices, but i can't ping across the tunnel. I have two other p2p connections spreading from the router with exact the same config, which was copypasted with the proper values, and they are working fine (well, they are UDP, i switched to TCP on this particular connection for debugging purposes).
So i hope someone around here is able to help me. 😉