Hello,
I spent so much time troubleshooting this... several days and this forum is the only hope for me. Here is the summary:
- Trying to setup OpenVPN on main WAN router.
- I have have done this numerous times in the past with success, but this time is a complete failure.
- Main difference is that this router manages VLANs and main
lan
interface is also a VLAN. - Tried to recreate PKI numerous times.
- Windows firewall (on client) is switched off.
- Client can connect to OpenVPN from within the network, i.e. when remote IP is basically router's internal IP.
- There is already another VPN router within the network and users can connect to that router from WAN (see port forward rule in the firewall setup). Users just cannot connect to OpenVPN installed on main WAN router.
- Logs do not say a lot.
Thank you for anyone, who helps me It has really exahusted me.
/etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fddd:5142:0b4b::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
option ipv6 '0'
config interface 'lan'
option device 'br-lan.10'
option proto 'static'
option ipaddr '192.168.10.1'
option netmask '255.255.255.0'
option ip6assign '60'
list dns '8.8.8.8'
list dns '8.8.4.4'
config device
option name 'wan'
option macaddr '26:f5:a2:2d:03:e8'
option ipv6 '0'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'Guest'
option proto 'static'
option ipaddr '172.24.20.1'
option netmask '255.255.255.0'
option device 'br-lan.20'
list dns '192.168.10.1'
config interface 'IoT'
option proto 'static'
option ipaddr '10.10.30.1'
option netmask '255.255.255.0'
option device 'br-lan.30'
list dns '192.168.10.1'
config bridge-vlan
option device 'br-lan'
option vlan '10'
list ports 'lan1'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4'
config bridge-vlan
option device 'br-lan'
option vlan '20'
list ports 'lan2:t'
list ports 'lan3:t'
config bridge-vlan
option device 'br-lan'
option vlan '30'
list ports 'lan2:t'
list ports 'lan3:t'
config bridge-vlan
option device 'br-lan'
option vlan '99'
list ports 'lan2'
list ports 'lan3'
config device
option name 'br-lan.10'
option type '8021q'
option ifname 'br-lan'
option vid '10'
option ipv6 '0'
config device
option name 'br-lan.20'
option type '8021q'
option ifname 'br-lan'
option vid '20'
option ipv6 '0'
config device
option name 'br-lan.30'
option type '8021q'
option ifname 'br-lan'
option vid '30'
option ipv6 '0'
config interface 'TUN0'
option proto 'none'
option device 'tun0'
/etc/config/firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
list device 'tun0'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
config zone
option name 'GuestZone'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'Guest'
config zone
option name 'IoTZone'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'IoT'
config forwarding
option src 'lan'
option dest 'IoTZone'
config forwarding
option src 'GuestZone'
option dest 'wan'
config rule
option name 'Allow Guest DHCP and DNS '
option src 'GuestZone'
option dest_port '53 67 68'
option target 'ACCEPT'
config redirect
option target 'DNAT'
option name 'WAN to srv-openvpn'
list proto 'udp'
option src 'wan'
option src_dport '1194'
option dest_ip '192.168.10.15'
option dest_port '1194'
config rule
option name 'Allow TIG to WAN'
option dest 'wan'
option target 'ACCEPT'
option src 'IoTZone'
list src_ip '10.10.30.166'
list src_ip '10.10.30.60'
option enabled '0'
config rule
option name 'Allow NAS to WAN'
option src 'IoTZone'
list src_ip '10.10.30.50'
option dest 'wan'
option target 'ACCEPT'
config rule
option name 'Allow IoT to srv-openvpn'
option src 'IoTZone'
option dest 'lan'
list dest_ip '192.168.10.15'
option target 'ACCEPT'
list src_ip '10.10.30.21'
list src_ip '10.10.30.22'
config rule
option name 'Allow-VPN'
option src 'wan'
option dest_port '1193'
option target 'ACCEPT'
list proto 'udp'
VPN server config (some options disabled as I reduced unknowns)
client-to-client
keepalive 10 120
user nobody
dev tun
port 1193
proto udp
push "route 192.168.10.0 255.255.255.0"
server 192.168.66.0 255.255.255.0
persist-key
persist-tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
dh /etc/openvpn/dh.pem
;crl-verify /etc/openvpn/crl.pem
key /etc/openvpn/server.key
;script-security 2
;auth-user-pass-verify /etc/openvpn/ovpnauth.sh via-file
ifconfig-pool-persist /tmp/ipp.txt
status /tmp/openvpn-status.log
log-append /tmp/openvpn.log
reneg-sec 0
verb 7
VPN client config
client
dev tun
proto udp
remote ip 1193
; this one works: remote 192.168.10.1 1193
resolv-retry infinite
nobind
user nobody
;group nobody
persist-key
persist-tun
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\user.crt"
key "C:\\Program Files\\OpenVPN\\config\\user.key"
remote-cert-tls server
cipher AES-256-CBC
;auth-user-pass
auth-nocache
reneg-sec 0
verb 7
Cut from the log of OpenVPN windows app
....
2024-03-24 16:52:08 us=203000 Using device interface: \\?\ROOT#NET#0003#{cac88484-7515-4c03-82e6-71a87abac361}\ovpn-dco
2024-03-24 16:52:08 us=203000 ovpn-dco device [OpenVPN Data Channel Offload] opened
2024-03-24 16:52:08 us=203000 dco_create_socket
2024-03-24 16:52:08 us=203000 UDP link local: (not bound)
2024-03-24 16:52:08 us=203000 UDP link remote: [AF_INET]85.206.9.188:1193
2024-03-24 16:52:08 us=203000 MANAGEMENT: >STATE:1711291928,WAIT,,,,,,
2024-03-24 16:52:08 us=203000 UDP WRITE [14] to [AF_INET]85.206.9.188:1193: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
2024-03-24 16:52:10 us=281000 UDP WRITE [14] to [AF_INET]85.206.9.188:1193: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 Closing DCO interface
2024-03-24 16:52:13 us=937000 Attempting CancelIO on ovpn-dco adapter
2024-03-24 16:52:13 us=937000 Attempting close of overlapped read event on ovpn-dco adapter
2024-03-24 16:52:13 us=937000 Attempting close of overlapped write event on ovpn-dco adapter
2024-03-24 16:52:13 us=937000 Attempting CloseHandle on ovpn-dco adapter
2024-03-24 16:52:13 us=937000 PID packet_id_free
2024-03-24 16:52:13 us=937000 SIGTERM[hard,] received, process exiting
2024-03-24 16:52:13 us=937000 MANAGEMENT: >STATE:1711291933,EXITING,SIGTERM,,,,,
2024-03-24 16:52:13 us=937000 PKCS#11: Terminating openssl
2024-03-24 16:52:13 us=937000 PKCS#11: Removing providers
2024-03-24 16:52:13 us=937000 PKCS#11: Releasing sessions
2024-03-24 16:52:13 us=937000 PKCS#11: Terminating slotevent
2024-03-24 16:52:13 us=937000 PKCS#11: Marking as uninitialized