I'm trying to setup again a VPN tunnel to access a DVR from outside.
It was working before till I did an upgrade of OpenWrt, now I'm getting issues trying to make it work again.
The difference from the previous configuration is the OpenWrt router IP that changed from 192.168.15.1
to 192.168.1.1
I can't see the tun0 device, maybe because of TLS Errors?
Can you help me debbuging the configuration?
TLS Errors on logread
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9289]: SIGTERM[hard,init_instance] received, process exiting
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: OpenVPN 2.4.5 mipsel-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: library versions: OpenSSL 1.0.2s 28 May 2019, LZO 2.10
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: TCP/UDP: Preserving recently used remote address: [AF_INET]138.34.6.7:1194
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: Socket Buffers: R=[163840->163840] S=[163840->163840]
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: UDP link local: (not bound)
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: UDP link remote: [AF_INET]138.34.6.7:1194
Sat Sep 7 01:34:28 2019 daemon.notice openvpn(vpnclient)[9396]: NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sat Sep 7 01:35:28 2019 daemon.err openvpn(vpnclient)[9396]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sat Sep 7 01:35:28 2019 daemon.err openvpn(vpnclient)[9396]: TLS Error: TLS handshake failed
Sat Sep 7 01:35:28 2019 daemon.notice openvpn(vpnclient)[9396]: SIGUSR1[soft,tls-error] received, process restarting
Sat Sep 7 01:35:28 2019 daemon.notice openvpn(vpnclient)[9396]: Restart pause, 5 second(s)
VPN Client and Site-to-site configuration
On the server
I added to /etc/openvpn/server.conf
client-config-dir /etc/openvpn/ccd
route 192.168.1.1 255.255.255.0 10.8.0.2
push "route 138.34.6.7 255.255.255.0"
/etc/openvpn/ccd/client
ifconfig-push 10.8.0.2 255.255.255.0
iroute 192.168.1.1 255.255.255.0
On the OpenWRT Client
/etc/openvpn/client.conf
I commented out setenv opt block-outside-dns
because was giving an error on the log
client
proto udp
sndbuf 0
rcvbuf 0
remote 138.34.6.7
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
#setenv opt block-outside-dns
key-direction 1
verb 3
<ca>
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
[...]
-----END PRIVATE KEY-----
</key>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
[...]
-----END OpenVPN Static key V1-----
</tls-auth>
user nobody
group nogroup
dev tun0
pull-filter ignore redirect-gateway
ip route show
default via 10.153.17.117 dev wwan0 src 10.153.17.118
10.153.17.116/30 dev wwan0 scope link src 10.153.17.118
192.168.1.0/24 dev br-lan scope link src 192.168.1.1
uci show network
network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd53:9377:b98b::/48'
network.lan=interface
network.lan.type='bridge'
network.lan.ifname='eth0.1'
network.lan.proto='static'
network.lan.ipaddr='192.168.1.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.lan_dev=device
network.lan_dev.name='eth0.1'
network.lan_dev.macaddr='28:3b:82:cc:b6:56'
network.wan=interface
network.wan.ifname='eth0.2'
network.wan.proto='dhcp'
network.wan_dev=device
network.wan_dev.name='eth0.2'
network.wan_dev.macaddr='28:3b:82:cc:b6:55'
network.wan6=interface
network.wan6.ifname='eth0.2'
network.wan6.proto='dhcpv6'
network.@switch[0]=switch
network.@switch[0].name='switch0'
network.@switch[0].reset='1'
network.@switch[0].enable_vlan='1'
network.@switch_vlan[0]=switch_vlan
network.@switch_vlan[0].device='switch0'
network.@switch_vlan[0].vlan='1'
network.@switch_vlan[0].ports='0 1 2 3 6t'
network.@switch_vlan[1]=switch_vlan
network.@switch_vlan[1].device='switch0'
network.@switch_vlan[1].vlan='2'
network.@switch_vlan[1].ports='4 6t'
network.wwan=interface
network.wwan.proto='wwan'
network.wwan.apn='wap.unomobile.it'
uci show firewall
firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood='1'
firewall.@defaults[0].input='ACCEPT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.lan=zone
firewall.lan.name='lan'
firewall.lan.input='ACCEPT'
firewall.lan.output='ACCEPT'
firewall.lan.forward='ACCEPT'
firewall.lan.network='lan wireles_lan'
firewall.lan.device='tun0'
firewall.wan=zone
firewall.wan.name='wan'
firewall.wan.input='REJECT'
firewall.wan.output='ACCEPT'
firewall.wan.forward='REJECT'
firewall.wan.masq='1'
firewall.wan.mtu_fix='1'
firewall.wan.network='wan wwan wan6'
firewall.lan_wan=forwarding
firewall.lan_wan.src='lan'
firewall.lan_wan.dest='wan'
firewall.@rule[0]=rule
firewall.@rule[0].name='Allow-DHCP-Renew'
firewall.@rule[0].src='wan'
firewall.@rule[0].proto='udp'
firewall.@rule[0].dest_port='68'
firewall.@rule[0].target='ACCEPT'
firewall.@rule[0].family='ipv4'
firewall.@rule[1]=rule
firewall.@rule[1].name='Allow-Ping'
firewall.@rule[1].src='wan'
firewall.@rule[1].proto='icmp'
firewall.@rule[1].icmp_type='echo-request'
firewall.@rule[1].family='ipv4'
firewall.@rule[1].target='ACCEPT'
firewall.@rule[2]=rule
firewall.@rule[2].name='Allow-IGMP'
firewall.@rule[2].src='wan'
firewall.@rule[2].proto='igmp'
firewall.@rule[2].family='ipv4'
firewall.@rule[2].target='ACCEPT'
firewall.@rule[3]=rule
firewall.@rule[3].name='Allow-DHCPv6'
firewall.@rule[3].src='wan'
firewall.@rule[3].proto='udp'
firewall.@rule[3].src_ip='fc00::/6'
firewall.@rule[3].dest_ip='fc00::/6'
firewall.@rule[3].dest_port='546'
firewall.@rule[3].family='ipv6'
firewall.@rule[3].target='ACCEPT'
firewall.@rule[4]=rule
firewall.@rule[4].name='Allow-MLD'
firewall.@rule[4].src='wan'
firewall.@rule[4].proto='icmp'
firewall.@rule[4].src_ip='fe80::/10'
firewall.@rule[4].icmp_type='130/0' '131/0' '132/0' '143/0'
firewall.@rule[4].family='ipv6'
firewall.@rule[4].target='ACCEPT'
firewall.@rule[5]=rule
firewall.@rule[5].name='Allow-ICMPv6-Input'
firewall.@rule[5].src='wan'
firewall.@rule[5].proto='icmp'
firewall.@rule[5].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type' 'router-solicitation' 'neighbour-solicitation' 'router-advertisement' 'neighbour-advertisement'
firewall.@rule[5].limit='1000/sec'
firewall.@rule[5].family='ipv6'
firewall.@rule[5].target='ACCEPT'
firewall.@rule[6]=rule
firewall.@rule[6].name='Allow-ICMPv6-Forward'
firewall.@rule[6].src='wan'
firewall.@rule[6].dest='*'
firewall.@rule[6].proto='icmp'
firewall.@rule[6].icmp_type='echo-request' 'echo-reply' 'destination-unreachable' 'packet-too-big' 'time-exceeded' 'bad-header' 'unknown-header-type'
firewall.@rule[6].limit='1000/sec'
firewall.@rule[6].family='ipv6'
firewall.@rule[6].target='ACCEPT'
firewall.@rule[7]=rule
firewall.@rule[7].name='Allow-IPSec-ESP'
firewall.@rule[7].src='wan'
firewall.@rule[7].dest='lan'
firewall.@rule[7].proto='esp'
firewall.@rule[7].target='ACCEPT'
firewall.@rule[8]=rule
firewall.@rule[8].name='Allow-ISAKMP'
firewall.@rule[8].src='wan'
firewall.@rule[8].dest='lan'
firewall.@rule[8].dest_port='500'
firewall.@rule[8].proto='udp'
firewall.@rule[8].target='ACCEPT'
firewall.@include[0]=include
firewall.@include[0].path='/etc/firewall.user'
firewall.@redirect[0]=redirect
firewall.@redirect[0].target='DNAT'
firewall.@redirect[0].src='wan'
firewall.@redirect[0].dest='lan'
firewall.@redirect[0].proto='tcp udp'
firewall.@redirect[0].src_dport='8016'
firewall.@redirect[0].dest_port='8016'
firewall.@redirect[0].name='DVR'
firewall.@redirect[0].dest_ip='192.168.1.103'
firewall.@redirect[1]=redirect
firewall.@redirect[1].target='DNAT'
firewall.@redirect[1].src='wan'
firewall.@redirect[1].dest='lan'
firewall.@redirect[1].proto='tcp udp'
firewall.@redirect[1].src_dport='10019'
firewall.@redirect[1].dest_ip='192.168.1.103'
firewall.@redirect[1].dest_port='10019'
firewall.@redirect[1].name='DVR Search'
firewall.@redirect[2]=redirect
firewall.@redirect[2].target='DNAT'
firewall.@redirect[2].src='wan'
firewall.@redirect[2].dest='lan'
firewall.@redirect[2].proto='tcp udp'
firewall.@redirect[2].src_dport='8116'
firewall.@redirect[2].dest_ip='192.168.1.103'
firewall.@redirect[2].dest_port='8116'
firewall.@redirect[2].name='DVR Audio'
firewall.ovpn=rule
firewall.ovpn.name='Allow-OpenVPN'
firewall.ovpn.src='wan'
firewall.ovpn.dest_port='1194'
firewall.ovpn.proto='udp'
firewall.ovpn.target='ACCEPT'
uci show openvpn
openvpn.vpnclient=openvpn
openvpn.vpnclient.enabled='1'
openvpn.vpnclient.config='/etc/openvpn/client.conf'