Lose of internet on other interfaces except OpenVPN connection

Hi everyone,
Short summary of the problem: My network consist of following subnets:
192.168.1.x (lan)
192.168.2.x (named open)
192.168.3.x (named guest)
All of them work flawlessly and all of these subnets have access to internet.... Up until I setup an OpenVPN to route all connections from devices on 192.168.1.x through vpn. As soon as I start the vpn connection, all devices on 192.168.1.x go through vpn without any problem, but devices on other subnets can't connect to internet anymore (not directly, nor through vpn).
I have already spent many hours without any luck. This issue is driving me crazy. Can someone help me solve this issue?
My configuration:
network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdcd:b55e:ba3e::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr 'xx:xx:xx:7c:f5:1c' (edit: removed from post)

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'
        list dns '1.1.1.1'
        list dns '1.0.0.1'
        option peerdns '0'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr 'xx:xx:xx:7c:f5:1c' (edit: removed from post)

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'
        list dns '2606:4700:4700::1111'
        list dns '2606:4700:4700::1001'
        option reqprefix 'auto'
        option reqaddress 'try'
        option peerdns '0'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '4 6t'

config interface 'open'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'

config interface 'guest'
        option proto 'static'
        option ipaddr '192.168.3.1'
        option netmask '255.255.255.0'

config interface 'vpn'
        option proto 'none'
        option ifname 'tun0'

dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config dhcp 'open'
        option start '100'
        option leasetime '12h'
        option limit '150'
        option interface 'open'

config dhcp 'guest'
        option start '100'
        option limit '150'
        option interface 'guest'
        option leasetime '2h'

Firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

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 src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        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 include
        option path '/etc/firewall.user'

config zone
        option network 'open'
        option forward 'REJECT'
        option name 'open'
        option output 'ACCEPT'
        option input 'REJECT'

config zone
        option network 'guest'
        option forward 'REJECT'
        option name 'guest'
        option output 'ACCEPT'
        option input 'REJECT'

config forwarding
        option dest 'wan'
        option src 'open'

config forwarding
        option dest 'wan'
        option src 'guest'

config rule
        option dest_port '53'
        option src 'open'
        option name 'Open network DNS'
        option target 'ACCEPT'

config rule
        option dest_port '53'
        option src 'guest'
        option name 'Guest network DNS'
        option target 'ACCEPT'

config rule
        option dest_port '67-68'
        option src 'open'
        option name 'Open network DHCP'
        option target 'ACCEPT'
        list proto 'udp'

config rule
        option dest_port '67-68'
        option src 'guest'
        option name 'Guest network DHCP'
        option target 'ACCEPT'
        list proto 'udp'

config zone
        option network 'vpn_fw vpn'
        option name 'vpn_fw'
        option mtu_fix '1'
        option input 'REJECT'
        option forward 'REJECT'
        option masq '1'
        option output 'ACCEPT'

config forwarding
        option dest 'vpn_fw'
        option src 'lan'

ovpn file

client
verb 1
proto udp
remote **removed**.com 53
explicit-exit-notify
connect-retry-max 3
connect-retry 3
resolv-retry 15
dev tun
auth-user-pass /etc/openvpn/USMiami.auth
persist-key
persist-tun
nobind
ca /etc/openvpn/ca1.crt
;comp-lzo
auth SHA1
auth-nocache
key-direction 1
remote-cert-tls server
cipher AES-256-CBC
route-method exe
route-delay 2
route 0.0.0.0 0.0.0.0
script-security 2
tls-client
tls-auth /etc/openvpn/tls-auth.key

You have the zone for open network set to reject. It should be set similar to lan.

The other issue is that you are forwarding from lan to both wan and vpn. I think you should forward lan to vpn only so that you have no connection on lan when the vpn is down

Thank you for your reply. This was a wonderful tip, which sounds like a better setup :slight_smile: thank you.
However neither of the solutions helped with my issue. Changing the zone for "open" or "guest" network to "accept" didn't fix the issue: The clients can't connect to internet. By the way, I followed the this exact tutorial to create the other subnets.

I did some more tests which may help troubleshoot the issue:
I installed vpnbypass which you can add IP ranges to bypass the vpn. Then I added other networks to it, both 192.168.2.x and 192.168.3.x, and guess what. Suddenly clients in those subnets could connect directly to internet! So my guess is that clients in those subnets try to use vpn too. However, VPNbypass is not the solution I want. It's like a workaround but I prefer to figure out why other subnets can't connect to internet while VPN is connected on completely different interface....
To summarize the test findings:

  • When I disconnect VPN (subnet "lan"), clients on other subnets (open & guest) can suddenly connect to internet again.
  • Adding other subnets (open & guest) to vpnbypass and they can connect to internet again while VPN is connected.

So the problem has something to do with VPN to become default route for all subnets. This is why vpnbypass fixes the problem (see above). I read somewhere that VPN host can configure this on their host or through opvn file! How this is even possible when there are different subnets with completely different firewall rules?
I found the e following in ovpn file (as seen above):
Route 0.0.0.0 0.0.0.0
Do you think the problem occurs because of this line? If yes, what should be there instead of those routes? Or is it something else that results in VPN to become default route for all subnets?