Help setting up Firewall/Network for OpenVPN & VLAN

Hello OpenWRT expert

Just a quick & dirty question:

  • I've successfully set up VLANs from OneMarcFifty's Youtube scenario for IOT / Guest / LAN under V21.02 and also exceeded for additional VLAN for Homeoffice.
  • On top of this configuration I want to to setup OpenVPN Server for only LAN part

What I've done:

  • Went through the OpenWRT documentation accordingly for:
  • Setup OpenSSL via No-IP.com DynDNS
  • Setup OpenVPN

Outcome:

  • I can get an OpenVPN connection with my client to the server
  • but of course no Internet or any LAN access

Could you please give me a hint to the right direction? I've read a lot already, seems to be PBR / NETIFD missing?

Is there any sequence in order to set it up right i.e. first setup PBR, then OpenVPN and afterwards my VLAN environment?

Thanks a lot to you for your time spent to help me.

Greetings and stay healthy
Televisor

OpenVPN needs to be assigned to a firewall zone and enable masquerade.
Regarding policy routing you have 3 options:

  1. mwan3 package
  2. pbr package
  3. a set of rules/routes for each internet connection.
    PBR is the easiest, but if you only want to send lan via the tunnel, it might make more sense to use a set of rule/route.

Hi all, Hi @trendy

I'm sorry but I'm still struggling around this and can't get neither OpenVPN nor internet connection with routing running. I've seen meanwhile another thread Setting up a dedicated VPN VLAN - #12 by JDf with similar topic. I've tried to add according documentation https://openwrt.org/docs/guide-user/network/routing/examples/pbr_netifd#route_lan_to_vpn_with_failover_to_wan and also https://openwrt.org/docs/guide-user/services/vpn/openvpn/extras#network_interface but I don't know where to put hands on.

Thanks for your help and below the outputs (part 1/3):

root@OpenWrt:~# uci export network; uci export wireless; \
> uci export dhcp; uci export firewall; \
> head -n -0 /etc/firewall.user; \
> iptables-save -c; ip6tables-save -c; \
> ip -4 addr ; ip -4 ro li tab all ; ip -4 ru; \
> ip -6 addr ; ip -6 ro li tab all ; ip -6 ru; \
> ls -l  /etc/resolv.* /tmp/resolv.*; head -n -0 /etc/resolv.* /tmp/resolv.*
package 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 packet_steering '1'
	option ula_prefix 'fd3f:9d72:10b8::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'

config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option device 'br-lan.99'
	option ip4table '1'
	option ip6table '1'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

config bridge-vlan
	option device 'br-lan'
	option vlan '3'
	list ports 'lan1:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '4'
	list ports 'lan1:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '99'
	list ports 'lan1:t'
	list ports 'lan2:u*'

config device
	option type 'bridge'
	option name 'br-iot'
	list ports 'br-lan.3'
	option bridge_empty '1'

config device
	option type 'bridge'
	option name 'br-guest'
	list ports 'br-lan.4'
	option bridge_empty '1'

config interface 'IOT'
	option proto 'static'
	option netmask '255.255.255.0'
	option device 'br-iot'
	option defaultroute '0'
	option ipaddr '10.214.30.1'

config interface 'GUEST'
	option proto 'static'
	option netmask '255.255.255.0'
	option defaultroute '0'
	option device 'br-guest'
	option ipaddr '172.19.40.1'

config bridge-vlan
	option device 'br-lan'
	option vlan '100'
	list ports 'lan1:t'

config interface 'HO'
	option proto 'static'
	option ipaddr '172.16.100.1'
	option netmask '255.255.255.0'
	option defaultroute '0'
	option device 'br-ho'

config device
	option type 'bridge'
	option name 'br-ho'
	list ports 'br-lan.100'
	option bridge_empty '1'

config interface 'vpn'
	option proto 'none'
	option device 'tun0'
	option ip4table '2'
	option ip6table '2'

config route 'vpn_rt'
	option interface 'vpn'
	option target '0.0.0.0/0'
	option onlink '1'

config rule 'lan_vpn'
	option in 'lan'
	option lookup '2'
	option priority '30000'

config rule6 'lan_vpn6'
	option in 'lan'
	option lookup '2'
	option priority '30000'

package wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
	option htmode 'HT20'
	option cell_density '0'
	option country 'CH'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'psk2'
	option key ‚xxxxxxxxxx‘
	option ieee80211r '1'
	option mobility_domain '123f'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11a'
	option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
	option htmode 'VHT80'
	option cell_density '0'
	option country 'CH'
	option channel 'auto'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'psk2'
	option key 'xxxxxxxxxx'
	option ieee80211r '1'
	option mobility_domain '123f'
	option ft_over_ds '0'
	option ft_psk_generate_local '1'

package 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.d/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'
	option ednspacket_max '1232'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'

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 'IOT'
	option interface 'IOT'
	option start '100'
	option limit '150'
	option leasetime '12h'
	list ra_flags 'none'

config dhcp 'GUEST'
	option interface 'GUEST'
	option start '100'
	option limit '150'
	option leasetime '12h'
	list ra_flags 'none'

config dhcp 'HO'
	option interface 'HO'
	option start '100'
	option limit '150'
	option leasetime '12h'
	list ra_flags 'none'

package firewall

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

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

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

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 rule
	option name 'Support-UDP-Traceroute'
	option src 'wan'
	option dest_port '33434:33689'
	option proto 'udp'
	option family 'ipv4'
	option target 'REJECT'
	option enabled '0'

config include
	option path '/etc/firewall.user'

config zone
	option name 'IOTzone'
	option output 'ACCEPT'
	option forward 'REJECT'
	option input 'ACCEPT'
	list network 'IOT'

config zone
	option name 'GUESTzone'
	option output 'ACCEPT'
	option forward 'REJECT'
	option input 'REJECT'
	list network 'GUEST'

config forwarding
	option src 'GUESTzone'
	option dest 'wan'

config forwarding
	option src 'lan'
	option dest 'IOTzone'

config zone
	option name 'HOzone'
	option output 'ACCEPT'
	option forward 'REJECT'
	option input 'ACCEPT'
	list network 'HO'

config forwarding
	option src 'HOzone'
	option dest 'wan'

config forwarding
	option src 'lan'
	option dest 'HOzone'

config rule
	option name 'Guest DHCP & DNS'
	option src 'GUESTzone'
	option dest_port '53 67 68'
	option target 'ACCEPT'

config rule 'ovpn'
	option name 'Allow-OpenVPN'
	option src 'wan'
	option dest_port '11945'
	option proto 'udp'
	option target 'ACCEPT'

# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
# Generated by iptables-save v1.8.7 on Mon Aug  8 15:02:16 2022
*nat
:PREROUTING ACCEPT [28555:4732324]
:INPUT ACCEPT [2563:177561]
:OUTPUT ACCEPT [3434:232400]
:POSTROUTING ACCEPT [53:4376]
:postrouting_GUESTzone_rule - [0:0]
:postrouting_HOzone_rule - [0:0]
:postrouting_IOTzone_rule - [0:0]
:postrouting_lan_rule - [0:0]
:postrouting_rule - [0:0]
:postrouting_wan_rule - [0:0]
:prerouting_GUESTzone_rule - [0:0]
:prerouting_HOzone_rule - [0:0]
:prerouting_IOTzone_rule - [0:0]
:prerouting_lan_rule - [0:0]
:prerouting_rule - [0:0]
:prerouting_wan_rule - [0:0]
:zone_GUESTzone_postrouting - [0:0]
:zone_GUESTzone_prerouting - [0:0]
:zone_HOzone_postrouting - [0:0]
:zone_HOzone_prerouting - [0:0]
:zone_IOTzone_postrouting - [0:0]
:zone_IOTzone_prerouting - [0:0]
:zone_lan_postrouting - [0:0]
:zone_lan_prerouting - [0:0]
:zone_wan_postrouting - [0:0]
:zone_wan_prerouting - [0:0]
[28555:4732324] -A PREROUTING -m comment --comment "!fw3: Custom prerouting rule chain" -j prerouting_rule
[208:14147] -A PREROUTING -i tun+ -m comment --comment "!fw3" -j zone_lan_prerouting
[25382:4582582] -A PREROUTING -i br-lan.99 -m comment --comment "!fw3" -j zone_lan_prerouting
[2965:135595] -A PREROUTING -i wan -m comment --comment "!fw3" -j zone_wan_prerouting
[208:14147] -A PREROUTING -i tun0 -m comment --comment "!fw3" -j zone_wan_prerouting
[0:0] -A PREROUTING -i br-iot -m comment --comment "!fw3" -j zone_IOTzone_prerouting
[0:0] -A PREROUTING -i br-guest -m comment --comment "!fw3" -j zone_GUESTzone_prerouting
[0:0] -A PREROUTING -i br-ho -m comment --comment "!fw3" -j zone_HOzone_prerouting
[10557:1420799] -A POSTROUTING -m comment --comment "!fw3: Custom postrouting rule chain" -j postrouting_rule
[638:68851] -A POSTROUTING -o tun+ -m comment --comment "!fw3" -j zone_lan_postrouting
[5:1360] -A POSTROUTING -o br-lan.99 -m comment --comment "!fw3" -j zone_lan_postrouting
[9866:1347572] -A POSTROUTING -o wan -m comment --comment "!fw3" -j zone_wan_postrouting
[638:68851] -A POSTROUTING -o tun0 -m comment --comment "!fw3" -j zone_wan_postrouting
[0:0] -A POSTROUTING -o br-iot -m comment --comment "!fw3" -j zone_IOTzone_postrouting
[0:0] -A POSTROUTING -o br-guest -m comment --comment "!fw3" -j zone_GUESTzone_postrouting
[0:0] -A POSTROUTING -o br-ho -m comment --comment "!fw3" -j zone_HOzone_postrouting
[0:0] -A zone_GUESTzone_postrouting -m comment --comment "!fw3: Custom GUESTzone postrouting rule chain" -j postrouting_GUESTzone_rule
[0:0] -A zone_GUESTzone_prerouting -m comment --comment "!fw3: Custom GUESTzone prerouting rule chain" -j prerouting_GUESTzone_rule
[0:0] -A zone_HOzone_postrouting -m comment --comment "!fw3: Custom HOzone postrouting rule chain" -j postrouting_HOzone_rule
[0:0] -A zone_HOzone_prerouting -m comment --comment "!fw3: Custom HOzone prerouting rule chain" -j prerouting_HOzone_rule
[0:0] -A zone_IOTzone_postrouting -m comment --comment "!fw3: Custom IOTzone postrouting rule chain" -j postrouting_IOTzone_rule
[0:0] -A zone_IOTzone_prerouting -m comment --comment "!fw3: Custom IOTzone prerouting rule chain" -j prerouting_IOTzone_rule
[643:70211] -A zone_lan_postrouting -m comment --comment "!fw3: Custom lan postrouting rule chain" -j postrouting_lan_rule
[25590:4596729] -A zone_lan_prerouting -m comment --comment "!fw3: Custom lan prerouting rule chain" -j prerouting_lan_rule
[10504:1416423] -A zone_wan_postrouting -m comment --comment "!fw3: Custom wan postrouting rule chain" -j postrouting_wan_rule
[10504:1416423] -A zone_wan_postrouting -m comment --comment "!fw3" -j MASQUERADE
[3173:149742] -A zone_wan_prerouting -m comment --comment "!fw3: Custom wan prerouting rule chain" -j prerouting_wan_rule
COMMIT
# Completed on Mon Aug  8 15:02:16 2022
# Generated by iptables-save v1.8.7 on Mon Aug  8 15:02:16 2022
*mangle
:PREROUTING ACCEPT [435722:279684633]
:INPUT ACCEPT [17265:1677569]
:FORWARD ACCEPT [401881:274748866]
:OUTPUT ACCEPT [17631:3575319]
:POSTROUTING ACCEPT [419002:278298845]
[5134:312190] -A FORWARD -o wan -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[5574:330020] -A FORWARD -i wan -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[3312:202884] -A FORWARD -o tun0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[147:8820] -A FORWARD -i tun0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
COMMIT

part 2/3:

# Completed on Mon Aug  8 15:02:16 2022
# Generated by iptables-save v1.8.7 on Mon Aug  8 15:02:16 2022
*filter
:INPUT ACCEPT [3:156]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
:forwarding_GUESTzone_rule - [0:0]
:forwarding_HOzone_rule - [0:0]
:forwarding_IOTzone_rule - [0:0]
:forwarding_lan_rule - [0:0]
:forwarding_rule - [0:0]
:forwarding_wan_rule - [0:0]
:input_GUESTzone_rule - [0:0]
:input_HOzone_rule - [0:0]
:input_IOTzone_rule - [0:0]
:input_lan_rule - [0:0]
:input_rule - [0:0]
:input_wan_rule - [0:0]
:output_GUESTzone_rule - [0:0]
:output_HOzone_rule - [0:0]
:output_IOTzone_rule - [0:0]
:output_lan_rule - [0:0]
:output_rule - [0:0]
:output_wan_rule - [0:0]
:reject - [0:0]
:syn_flood - [0:0]
:zone_GUESTzone_dest_ACCEPT - [0:0]
:zone_GUESTzone_dest_REJECT - [0:0]
:zone_GUESTzone_forward - [0:0]
:zone_GUESTzone_input - [0:0]
:zone_GUESTzone_output - [0:0]
:zone_GUESTzone_src_REJECT - [0:0]
:zone_HOzone_dest_ACCEPT - [0:0]
:zone_HOzone_dest_REJECT - [0:0]
:zone_HOzone_forward - [0:0]
:zone_HOzone_input - [0:0]
:zone_HOzone_output - [0:0]
:zone_HOzone_src_ACCEPT - [0:0]
:zone_IOTzone_dest_ACCEPT - [0:0]
:zone_IOTzone_dest_REJECT - [0:0]
:zone_IOTzone_forward - [0:0]
:zone_IOTzone_input - [0:0]
:zone_IOTzone_output - [0:0]
:zone_IOTzone_src_ACCEPT - [0:0]
:zone_lan_dest_ACCEPT - [0:0]
:zone_lan_forward - [0:0]
:zone_lan_input - [0:0]
:zone_lan_output - [0:0]
:zone_lan_src_ACCEPT - [0:0]
:zone_wan_dest_ACCEPT - [0:0]
:zone_wan_dest_REJECT - [0:0]
:zone_wan_forward - [0:0]
:zone_wan_input - [0:0]
:zone_wan_output - [0:0]
:zone_wan_src_REJECT - [0:0]
[644:52079] -A INPUT -i lo -m comment --comment "!fw3" -j ACCEPT
[16627:1625802] -A INPUT -m comment --comment "!fw3: Custom input rule chain" -j input_rule
[10231:1256555] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[1057:52656] -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m comment --comment "!fw3" -j syn_flood
[107:7293] -A INPUT -i tun+ -m comment --comment "!fw3" -j zone_lan_input
[2868:205487] -A INPUT -i br-lan.99 -m comment --comment "!fw3" -j zone_lan_input
[3421:156467] -A INPUT -i wan -m comment --comment "!fw3" -j zone_wan_input
[0:0] -A INPUT -i tun0 -m comment --comment "!fw3" -j zone_wan_input
[0:0] -A INPUT -i br-iot -m comment --comment "!fw3" -j zone_IOTzone_input
[0:0] -A INPUT -i br-guest -m comment --comment "!fw3" -j zone_GUESTzone_input
[0:0] -A INPUT -i br-ho -m comment --comment "!fw3" -j zone_HOzone_input
[401881:274748866] -A FORWARD -m comment --comment "!fw3: Custom forwarding rule chain" -j forwarding_rule
[390433:273016757] -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[95:6350] -A FORWARD -i tun+ -m comment --comment "!fw3" -j zone_lan_forward
[11353:1725759] -A FORWARD -i br-lan.99 -m comment --comment "!fw3" -j zone_lan_forward
[0:0] -A FORWARD -i wan -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -i tun0 -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -i br-iot -m comment --comment "!fw3" -j zone_IOTzone_forward
[0:0] -A FORWARD -i br-guest -m comment --comment "!fw3" -j zone_GUESTzone_forward
[0:0] -A FORWARD -i br-ho -m comment --comment "!fw3" -j zone_HOzone_forward
[0:0] -A FORWARD -m comment --comment "!fw3" -j reject
[644:52079] -A OUTPUT -o lo -m comment --comment "!fw3" -j ACCEPT
[16993:3524680] -A OUTPUT -m comment --comment "!fw3: Custom output rule chain" -j output_rule
[13513:3288608] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A OUTPUT -o tun+ -m comment --comment "!fw3" -j zone_lan_output
[18:4760] -A OUTPUT -o br-lan.99 -m comment --comment "!fw3" -j zone_lan_output
[3462:231312] -A OUTPUT -o wan -m comment --comment "!fw3" -j zone_wan_output
[0:0] -A OUTPUT -o tun0 -m comment --comment "!fw3" -j zone_wan_output
[0:0] -A OUTPUT -o br-iot -m comment --comment "!fw3" -j zone_IOTzone_output
[0:0] -A OUTPUT -o br-guest -m comment --comment "!fw3" -j zone_GUESTzone_output
[0:0] -A OUTPUT -o br-ho -m comment --comment "!fw3" -j zone_HOzone_output
[1095:48690] -A reject -p tcp -m comment --comment "!fw3" -j REJECT --reject-with tcp-reset
[2294:105948] -A reject -m comment --comment "!fw3" -j REJECT --reject-with icmp-port-unreachable
[1057:52656] -A syn_flood -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 25/sec --limit-burst 50 -m comment --comment "!fw3" -j RETURN
[0:0] -A syn_flood -m comment --comment "!fw3" -j DROP
[0:0] -A zone_GUESTzone_dest_ACCEPT -o br-guest -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_GUESTzone_dest_REJECT -o br-guest -m comment --comment "!fw3" -j reject
[0:0] -A zone_GUESTzone_forward -m comment --comment "!fw3: Custom GUESTzone forwarding rule chain" -j forwarding_GUESTzone_rule
[0:0] -A zone_GUESTzone_forward -m comment --comment "!fw3: Zone GUESTzone to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_GUESTzone_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_GUESTzone_forward -m comment --comment "!fw3" -j zone_GUESTzone_dest_REJECT
[0:0] -A zone_GUESTzone_input -m comment --comment "!fw3: Custom GUESTzone input rule chain" -j input_GUESTzone_rule
[0:0] -A zone_GUESTzone_input -p tcp -m tcp --dport 53 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p tcp -m tcp --dport 67 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p tcp -m tcp --dport 68 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p udp -m udp --dport 53 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p udp -m udp --dport 67 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p udp -m udp --dport 68 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[0:0] -A zone_GUESTzone_input -m comment --comment "!fw3" -j zone_GUESTzone_src_REJECT
[0:0] -A zone_GUESTzone_output -m comment --comment "!fw3: Custom GUESTzone output rule chain" -j output_GUESTzone_rule
[0:0] -A zone_GUESTzone_output -m comment --comment "!fw3" -j zone_GUESTzone_dest_ACCEPT
[0:0] -A zone_GUESTzone_src_REJECT -i br-guest -m comment --comment "!fw3" -j reject
[0:0] -A zone_HOzone_dest_ACCEPT -o br-ho -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_HOzone_dest_REJECT -o br-ho -m comment --comment "!fw3" -j reject
[0:0] -A zone_HOzone_forward -m comment --comment "!fw3: Custom HOzone forwarding rule chain" -j forwarding_HOzone_rule
[0:0] -A zone_HOzone_forward -m comment --comment "!fw3: Zone HOzone to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_HOzone_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_HOzone_forward -m comment --comment "!fw3" -j zone_HOzone_dest_REJECT
[0:0] -A zone_HOzone_input -m comment --comment "!fw3: Custom HOzone input rule chain" -j input_HOzone_rule
[0:0] -A zone_HOzone_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[0:0] -A zone_HOzone_input -m comment --comment "!fw3" -j zone_HOzone_src_ACCEPT
[0:0] -A zone_HOzone_output -m comment --comment "!fw3: Custom HOzone output rule chain" -j output_HOzone_rule
[0:0] -A zone_HOzone_output -m comment --comment "!fw3" -j zone_HOzone_dest_ACCEPT
[0:0] -A zone_HOzone_src_ACCEPT -i br-ho -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_IOTzone_dest_ACCEPT -o br-iot -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_IOTzone_dest_REJECT -o br-iot -m comment --comment "!fw3" -j reject
[0:0] -A zone_IOTzone_forward -m comment --comment "!fw3: Custom IOTzone forwarding rule chain" -j forwarding_IOTzone_rule
[0:0] -A zone_IOTzone_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_IOTzone_forward -m comment --comment "!fw3" -j zone_IOTzone_dest_REJECT
[0:0] -A zone_IOTzone_input -m comment --comment "!fw3: Custom IOTzone input rule chain" -j input_IOTzone_rule
[0:0] -A zone_IOTzone_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[0:0] -A zone_IOTzone_input -m comment --comment "!fw3" -j zone_IOTzone_src_ACCEPT
[0:0] -A zone_IOTzone_output -m comment --comment "!fw3: Custom IOTzone output rule chain" -j output_IOTzone_rule
[0:0] -A zone_IOTzone_output -m comment --comment "!fw3" -j zone_IOTzone_dest_ACCEPT
[0:0] -A zone_IOTzone_src_ACCEPT -i br-iot -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_lan_dest_ACCEPT -o tun+ -m comment --comment "!fw3" -j ACCEPT
[18:4760] -A zone_lan_dest_ACCEPT -o br-lan.99 -m comment --comment "!fw3" -j ACCEPT
[11448:1732109] -A zone_lan_forward -m comment --comment "!fw3: Custom lan forwarding rule chain" -j forwarding_lan_rule
[11448:1732109] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to IOTzone forwarding policy" -j zone_IOTzone_dest_ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to HOzone forwarding policy" -j zone_HOzone_dest_ACCEPT
[0:0] -A zone_lan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[2975:212780] -A zone_lan_input -m comment --comment "!fw3: Custom lan input rule chain" -j input_lan_rule
[0:0] -A zone_lan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[2975:212780] -A zone_lan_input -m comment --comment "!fw3" -j zone_lan_src_ACCEPT
[18:4760] -A zone_lan_output -m comment --comment "!fw3: Custom lan output rule chain" -j output_lan_rule
[18:4760] -A zone_lan_output -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[107:7293] -A zone_lan_src_ACCEPT -i tun+ -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[2865:205331] -A zone_lan_src_ACCEPT -i br-lan.99 -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[492:24512] -A zone_wan_dest_ACCEPT -o wan -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[10271:1530984] -A zone_wan_dest_ACCEPT -o wan -m comment --comment "!fw3" -j ACCEPT
[18:828] -A zone_wan_dest_ACCEPT -o tun0 -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[4129:407097] -A zone_wan_dest_ACCEPT -o tun0 -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_REJECT -o wan -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_dest_REJECT -o tun0 -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_forward -m comment --comment "!fw3: Custom wan forwarding rule chain" -j forwarding_wan_rule
[0:0] -A zone_wan_forward -p esp -m comment --comment "!fw3: Allow-IPSec-ESP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -p udp -m udp --dport 500 -m comment --comment "!fw3: Allow-ISAKMP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_wan_forward -m comment --comment "!fw3" -j zone_wan_dest_REJECT
[3421:156467] -A zone_wan_input -m comment --comment "!fw3: Custom wan input rule chain" -j input_wan_rule
[0:0] -A zone_wan_input -p udp -m udp --dport 68 -m comment --comment "!fw3: Allow-DHCP-Renew" -j ACCEPT
[31:1448] -A zone_wan_input -p icmp -m icmp --icmp-type 8 -m comment --comment "!fw3: Allow-Ping" -j ACCEPT
[0:0] -A zone_wan_input -p igmp -m comment --comment "!fw3: Allow-IGMP" -j ACCEPT
[1:381] -A zone_wan_input -p udp -m udp --dport 11945 -m comment --comment "!fw3: Allow-OpenVPN" -j ACCEPT
[0:0] -A zone_wan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[3389:154638] -A zone_wan_input -m comment --comment "!fw3" -j zone_wan_src_REJECT
[3462:231312] -A zone_wan_output -m comment --comment "!fw3: Custom wan output rule chain" -j output_wan_rule
[3462:231312] -A zone_wan_output -m comment --comment "!fw3" -j zone_wan_dest_ACCEPT
[3389:154638] -A zone_wan_src_REJECT -i wan -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_src_REJECT -i tun0 -m comment --comment "!fw3" -j reject
COMMIT
# Completed on Mon Aug  8 15:02:16 2022
# Generated by ip6tables-save v1.8.7 on Mon Aug  8 15:02:16 2022
*mangle
:PREROUTING ACCEPT [13205:1969730]
:INPUT ACCEPT [4256:342612]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [4471:457209]
:POSTROUTING ACCEPT [4471:457209]
[0:0] -A FORWARD -o wan -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[0:0] -A FORWARD -i wan -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[0:0] -A FORWARD -o tun0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[0:0] -A FORWARD -i tun0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
COMMIT
# Completed on Mon Aug  8 15:02:16 2022
# Generated by ip6tables-save v1.8.7 on Mon Aug  8 15:02:16 2022
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
:forwarding_GUESTzone_rule - [0:0]
:forwarding_HOzone_rule - [0:0]
:forwarding_IOTzone_rule - [0:0]
:forwarding_lan_rule - [0:0]
:forwarding_rule - [0:0]
:forwarding_wan_rule - [0:0]
:input_GUESTzone_rule - [0:0]
:input_HOzone_rule - [0:0]
:input_IOTzone_rule - [0:0]
:input_lan_rule - [0:0]
:input_rule - [0:0]
:input_wan_rule - [0:0]
:output_GUESTzone_rule - [0:0]
:output_HOzone_rule - [0:0]
:output_IOTzone_rule - [0:0]
:output_lan_rule - [0:0]
:output_rule - [0:0]
:output_wan_rule - [0:0]
:reject - [0:0]
:syn_flood - [0:0]
:zone_GUESTzone_dest_ACCEPT - [0:0]
:zone_GUESTzone_dest_REJECT - [0:0]
:zone_GUESTzone_forward - [0:0]
:zone_GUESTzone_input - [0:0]
:zone_GUESTzone_output - [0:0]
:zone_GUESTzone_src_REJECT - [0:0]
:zone_HOzone_dest_ACCEPT - [0:0]
:zone_HOzone_dest_REJECT - [0:0]
:zone_HOzone_forward - [0:0]
:zone_HOzone_input - [0:0]
:zone_HOzone_output - [0:0]
:zone_HOzone_src_ACCEPT - [0:0]
:zone_IOTzone_dest_ACCEPT - [0:0]
:zone_IOTzone_dest_REJECT - [0:0]
:zone_IOTzone_forward - [0:0]
:zone_IOTzone_input - [0:0]
:zone_IOTzone_output - [0:0]
:zone_IOTzone_src_ACCEPT - [0:0]
:zone_lan_dest_ACCEPT - [0:0]
:zone_lan_forward - [0:0]
:zone_lan_input - [0:0]
:zone_lan_output - [0:0]
:zone_lan_src_ACCEPT - [0:0]
:zone_wan_dest_ACCEPT - [0:0]
:zone_wan_dest_REJECT - [0:0]
:zone_wan_forward - [0:0]
:zone_wan_input - [0:0]
:zone_wan_output - [0:0]
:zone_wan_src_REJECT - [0:0]
[23:3412] -A INPUT -i lo -m comment --comment "!fw3" -j ACCEPT
[4233:339200] -A INPUT -m comment --comment "!fw3: Custom input rule chain" -j input_rule
[66:5503] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[145:11616] -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m comment --comment "!fw3" -j syn_flood
[0:0] -A INPUT -i tun+ -m comment --comment "!fw3" -j zone_lan_input
[4165:333585] -A INPUT -i br-lan.99 -m comment --comment "!fw3" -j zone_lan_input
[2:112] -A INPUT -i wan -m comment --comment "!fw3" -j zone_wan_input
[0:0] -A INPUT -i tun0 -m comment --comment "!fw3" -j zone_wan_input
[0:0] -A INPUT -i br-iot -m comment --comment "!fw3" -j zone_IOTzone_input
[0:0] -A INPUT -i br-guest -m comment --comment "!fw3" -j zone_GUESTzone_input
[0:0] -A INPUT -i br-ho -m comment --comment "!fw3" -j zone_HOzone_input
[0:0] -A FORWARD -m comment --comment "!fw3: Custom forwarding rule chain" -j forwarding_rule
[0:0] -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A FORWARD -i tun+ -m comment --comment "!fw3" -j zone_lan_forward
[0:0] -A FORWARD -i br-lan.99 -m comment --comment "!fw3" -j zone_lan_forward
[0:0] -A FORWARD -i wan -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -i tun0 -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -i br-iot -m comment --comment "!fw3" -j zone_IOTzone_forward
[0:0] -A FORWARD -i br-guest -m comment --comment "!fw3" -j zone_GUESTzone_forward
[0:0] -A FORWARD -i br-ho -m comment --comment "!fw3" -j zone_HOzone_forward
[0:0] -A FORWARD -m comment --comment "!fw3" -j reject
[23:3412] -A OUTPUT -o lo -m comment --comment "!fw3" -j ACCEPT
[4448:453797] -A OUTPUT -m comment --comment "!fw3: Custom output rule chain" -j output_rule
[2958:343043] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A OUTPUT -o tun+ -m comment --comment "!fw3" -j zone_lan_output
[1420:100254] -A OUTPUT -o br-lan.99 -m comment --comment "!fw3" -j zone_lan_output
[70:10500] -A OUTPUT -o wan -m comment --comment "!fw3" -j zone_wan_output
[0:0] -A OUTPUT -o tun0 -m comment --comment "!fw3" -j zone_wan_output
[0:0] -A OUTPUT -o br-iot -m comment --comment "!fw3" -j zone_IOTzone_output
[0:0] -A OUTPUT -o br-guest -m comment --comment "!fw3" -j zone_GUESTzone_output
[0:0] -A OUTPUT -o br-ho -m comment --comment "!fw3" -j zone_HOzone_output
[0:0] -A reject -p tcp -m comment --comment "!fw3" -j REJECT --reject-with tcp-reset
[0:0] -A reject -m comment --comment "!fw3" -j REJECT --reject-with icmp6-port-unreachable
[145:11616] -A syn_flood -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 25/sec --limit-burst 50 -m comment --comment "!fw3" -j RETURN
[0:0] -A syn_flood -m comment --comment "!fw3" -j DROP
[0:0] -A zone_GUESTzone_dest_ACCEPT -o br-guest -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_GUESTzone_dest_REJECT -o br-guest -m comment --comment "!fw3" -j reject
[0:0] -A zone_GUESTzone_forward -m comment --comment "!fw3: Custom GUESTzone forwarding rule chain" -j forwarding_GUESTzone_rule
[0:0] -A zone_GUESTzone_forward -m comment --comment "!fw3: Zone GUESTzone to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_GUESTzone_forward -m comment --comment "!fw3" -j zone_GUESTzone_dest_REJECT
[0:0] -A zone_GUESTzone_input -m comment --comment "!fw3: Custom GUESTzone input rule chain" -j input_GUESTzone_rule
[0:0] -A zone_GUESTzone_input -p tcp -m tcp --dport 53 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p tcp -m tcp --dport 67 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p tcp -m tcp --dport 68 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p udp -m udp --dport 53 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p udp -m udp --dport 67 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -p udp -m udp --dport 68 -m comment --comment "!fw3: Guest DHCP & DNS" -j ACCEPT
[0:0] -A zone_GUESTzone_input -m comment --comment "!fw3" -j zone_GUESTzone_src_REJECT
[0:0] -A zone_GUESTzone_output -m comment --comment "!fw3: Custom GUESTzone output rule chain" -j output_GUESTzone_rule
[0:0] -A zone_GUESTzone_output -m comment --comment "!fw3" -j zone_GUESTzone_dest_ACCEPT
[0:0] -A zone_GUESTzone_src_REJECT -i br-guest -m comment --comment "!fw3" -j reject
[0:0] -A zone_HOzone_dest_ACCEPT -o br-ho -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_HOzone_dest_REJECT -o br-ho -m comment --comment "!fw3" -j reject
[0:0] -A zone_HOzone_forward -m comment --comment "!fw3: Custom HOzone forwarding rule chain" -j forwarding_HOzone_rule
[0:0] -A zone_HOzone_forward -m comment --comment "!fw3: Zone HOzone to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_HOzone_forward -m comment --comment "!fw3" -j zone_HOzone_dest_REJECT
[0:0] -A zone_HOzone_input -m comment --comment "!fw3: Custom HOzone input rule chain" -j input_HOzone_rule
[0:0] -A zone_HOzone_input -m comment --comment "!fw3" -j zone_HOzone_src_ACCEPT
[0:0] -A zone_HOzone_output -m comment --comment "!fw3: Custom HOzone output rule chain" -j output_HOzone_rule
[0:0] -A zone_HOzone_output -m comment --comment "!fw3" -j zone_HOzone_dest_ACCEPT
[0:0] -A zone_HOzone_src_ACCEPT -i br-ho -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_IOTzone_dest_ACCEPT -o br-iot -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_IOTzone_dest_REJECT -o br-iot -m comment --comment "!fw3" -j reject
[0:0] -A zone_IOTzone_forward -m comment --comment "!fw3: Custom IOTzone forwarding rule chain" -j forwarding_IOTzone_rule
[0:0] -A zone_IOTzone_forward -m comment --comment "!fw3" -j zone_IOTzone_dest_REJECT
[0:0] -A zone_IOTzone_input -m comment --comment "!fw3: Custom IOTzone input rule chain" -j input_IOTzone_rule
[0:0] -A zone_IOTzone_input -m comment --comment "!fw3" -j zone_IOTzone_src_ACCEPT
[0:0] -A zone_IOTzone_output -m comment --comment "!fw3: Custom IOTzone output rule chain" -j output_IOTzone_rule
[0:0] -A zone_IOTzone_output -m comment --comment "!fw3" -j zone_IOTzone_dest_ACCEPT
[0:0] -A zone_IOTzone_src_ACCEPT -i br-iot -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_lan_dest_ACCEPT -o tun+ -m comment --comment "!fw3" -j ACCEPT
[1420:100254] -A zone_lan_dest_ACCEPT -o br-lan.99 -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3: Custom lan forwarding rule chain" -j forwarding_lan_rule
[0:0] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to IOTzone forwarding policy" -j zone_IOTzone_dest_ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to HOzone forwarding policy" -j zone_HOzone_dest_ACCEPT
[0:0] -A zone_lan_forward -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[4165:333585] -A zone_lan_input -m comment --comment "!fw3: Custom lan input rule chain" -j input_lan_rule
[4165:333585] -A zone_lan_input -m comment --comment "!fw3" -j zone_lan_src_ACCEPT
[1420:100254] -A zone_lan_output -m comment --comment "!fw3: Custom lan output rule chain" -j output_lan_rule
[1420:100254] -A zone_lan_output -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[0:0] -A zone_lan_src_ACCEPT -i tun+ -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[4165:333585] -A zone_lan_src_ACCEPT -i br-lan.99 -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_ACCEPT -o wan -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[70:10500] -A zone_wan_dest_ACCEPT -o wan -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_ACCEPT -o tun0 -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[0:0] -A zone_wan_dest_ACCEPT -o tun0 -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_REJECT -o wan -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_dest_REJECT -o tun0 -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_forward -m comment --comment "!fw3: Custom wan forwarding rule chain" -j forwarding_wan_rule
[0:0] -A zone_wan_forward -p ipv6-icmp -m icmp6 --icmpv6-type 128 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Forward" -j ACCEPT
[0:0] -A zone_wan_forward -p ipv6-icmp -m icmp6 --icmpv6-type 129 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Forward" -j ACCEPT
[0:0] -A zone_wan_forward -p ipv6-icmp -m icmp6 --icmpv6-type 1 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Forward" -j ACCEPT
[0:0] -A zone_wan_forward -p ipv6-icmp -m icmp6 --icmpv6-type 2 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Forward" -j ACCEPT
[0:0] -A zone_wan_forward -p ipv6-icmp -m icmp6 --icmpv6-type 3 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Forward" -j ACCEPT
[0:0] -A zone_wan_forward -p ipv6-icmp -m icmp6 --icmpv6-type 4/0 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Forward" -j ACCEPT
[0:0] -A zone_wan_forward -p ipv6-icmp -m icmp6 --icmpv6-type 4/1 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Forward" -j ACCEPT
[0:0] -A zone_wan_forward -p esp -m comment --comment "!fw3: Allow-IPSec-ESP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -p udp -m udp --dport 500 -m comment --comment "!fw3: Allow-ISAKMP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -m comment --comment "!fw3" -j zone_wan_dest_REJECT
[2:112] -A zone_wan_input -m comment --comment "!fw3: Custom wan input rule chain" -j input_wan_rule
[0:0] -A zone_wan_input -s fc00::/6 -d fc00::/6 -p udp -m udp --dport 546 -m comment --comment "!fw3: Allow-DHCPv6" -j ACCEPT
[0:0] -A zone_wan_input -s fe80::/10 -p ipv6-icmp -m icmp6 --icmpv6-type 130/0 -m comment --comment "!fw3: Allow-MLD" -j ACCEPT
[0:0] -A zone_wan_input -s fe80::/10 -p ipv6-icmp -m icmp6 --icmpv6-type 131/0 -m comment --comment "!fw3: Allow-MLD" -j ACCEPT
[0:0] -A zone_wan_input -s fe80::/10 -p ipv6-icmp -m icmp6 --icmpv6-type 132/0 -m comment --comment "!fw3: Allow-MLD" -j ACCEPT
[0:0] -A zone_wan_input -s fe80::/10 -p ipv6-icmp -m icmp6 --icmpv6-type 143/0 -m comment --comment "!fw3: Allow-MLD" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 128 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 129 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 1 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 2 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 3 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 4/0 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 4/1 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[2:112] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 133 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 135 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 134 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p ipv6-icmp -m icmp6 --icmpv6-type 136 -m limit --limit 1000/sec -m comment --comment "!fw3: Allow-ICMPv6-Input" -j ACCEPT
[0:0] -A zone_wan_input -p udp -m udp --dport 11945 -m comment --comment "!fw3: Allow-OpenVPN" -j ACCEPT
[0:0] -A zone_wan_input -m comment --comment "!fw3" -j zone_wan_src_REJECT
[70:10500] -A zone_wan_output -m comment --comment "!fw3: Custom wan output rule chain" -j output_wan_rule
[70:10500] -A zone_wan_output -m comment --comment "!fw3" -j zone_wan_dest_ACCEPT
[0:0] -A zone_wan_src_REJECT -i wan -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_src_REJECT -i tun0 -m comment --comment "!fw3" -j reject
COMMIT

part 3/3

# Completed on Mon Aug  8 15:02:16 2022
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
3: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 80.xxx.xxx.xxx/21 brd 80.xxx.xxx.xxx scope global wan
       valid_lft forever preferred_lft forever
8: br-guest: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 172.19.40.1/24 brd 172.19.40.255 scope global br-guest
       valid_lft forever preferred_lft forever
9: br-ho: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 172.16.100.1/24 brd 172.16.100.255 scope global br-ho
       valid_lft forever preferred_lft forever
10: br-iot: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 10.214.30.1/24 brd 10.214.30.255 scope global br-iot
       valid_lft forever preferred_lft forever
12: br-lan.99@br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan.99
       valid_lft forever preferred_lft forever
16: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
    inet 10.66.77.1/24 scope global tun0
       valid_lft forever preferred_lft forever
192.168.1.0/24 dev br-lan.99 table 1 proto static scope link 
default via 80.xxx.xxx.xxx dev wan proto static src 80.xxx.xxx.xxx 
10.66.77.0/24 dev tun0 proto kernel scope link src 10.66.77.1 
10.214.30.0/24 dev br-iot proto kernel scope link src 10.214.30.1 
80.xxx.xxx.xxx/21 dev wan proto kernel scope link src 80.xxx.xxx.xxx 
172.16.100.0/24 dev br-ho proto kernel scope link src 172.16.100.1 
172.19.40.0/24 dev br-guest proto kernel scope link src 172.19.40.1 
broadcast 10.66.77.0 dev tun0 table local proto kernel scope link src 10.66.77.1 
local 10.66.77.1 dev tun0 table local proto kernel scope host src 10.66.77.1 
broadcast 10.66.77.255 dev tun0 table local proto kernel scope link src 10.66.77.1 
broadcast 10.214.30.0 dev br-iot table local proto kernel scope link src 10.214.30.1 
local 10.214.30.1 dev br-iot table local proto kernel scope host src 10.214.30.1 
broadcast 10.214.30.255 dev br-iot table local proto kernel scope link src 10.214.30.1 
broadcast 80.xxx.xxx.xxx dev wan table local proto kernel scope link src 80.xxx.xxx.xxx 
local 80.xxx.xxx.xxx dev wan table local proto kernel scope host src 80.xxx.xxx.xxx 
broadcast 80.xxx.xxx.xxx dev wan table local proto kernel scope link src 80.xxx.xxx.xxx 
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1 
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1 
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1 
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1 
broadcast 172.16.100.0 dev br-ho table local proto kernel scope link src 172.16.100.1 
local 172.16.100.1 dev br-ho table local proto kernel scope host src 172.16.100.1 
broadcast 172.16.100.255 dev br-ho table local proto kernel scope link src 172.16.100.1 
broadcast 172.19.40.0 dev br-guest table local proto kernel scope link src 172.19.40.1 
local 172.19.40.1 dev br-guest table local proto kernel scope host src 172.19.40.1 
broadcast 172.19.40.255 dev br-guest table local proto kernel scope link src 172.19.40.1 
broadcast 192.168.1.0 dev br-lan.99 table local proto kernel scope link src 192.168.1.1 
local 192.168.1.1 dev br-lan.99 table local proto kernel scope host src 192.168.1.1 
broadcast 192.168.1.255 dev br-lan.99 table local proto kernel scope link src 192.168.1.1 
0:	from all lookup local
10000:	from 192.168.1.1 lookup 1
20000:	from all to 192.168.1.1/24 lookup 1
30000:	from all iif br-lan.99 lookup 2
32766:	from all lookup main
32767:	from all lookup default
90012:	from all iif lo lookup 1
90016:	from all iif lo lookup 2
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ac/64 scope link 
       valid_lft forever preferred_lft forever
3: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ab/64 scope link 
       valid_lft forever preferred_lft forever
8: br-guest: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ac/64 scope link 
       valid_lft forever preferred_lft forever
9: br-ho: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ac/64 scope link 
       valid_lft forever preferred_lft forever
10: br-iot: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ac/64 scope link 
       valid_lft forever preferred_lft forever
11: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ac/64 scope link 
       valid_lft forever preferred_lft forever
12: br-lan.99@br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fd3f:9d72:10b8::1/60 scope global noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::5264:2bff:fe90:47ac/64 scope link 
       valid_lft forever preferred_lft forever
16: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 state UNKNOWN qlen 500
    inet6 fe80::5e43:e55a:8fa0:e416/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever
17: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ae/64 scope link 
       valid_lft forever preferred_lft forever
18: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::5264:2bff:fe90:47ad/64 scope link 
       valid_lft forever preferred_lft forever
fd3f:9d72:10b8::/64 dev br-lan.99 table 1 proto static metric 1024 pref medium
unreachable fd3f:9d72:10b8::/48 dev lo proto static metric 2147483647 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev tun0 proto kernel metric 256 pref medium
fe80::/64 dev br-lan proto kernel metric 256 pref medium
fe80::/64 dev br-lan.99 proto kernel metric 256 pref medium
fe80::/64 dev br-iot proto kernel metric 256 pref medium
fe80::/64 dev br-guest proto kernel metric 256 pref medium
fe80::/64 dev br-ho proto kernel metric 256 pref medium
fe80::/64 dev wan proto kernel metric 256 pref medium
fe80::/64 dev wlan0 proto kernel metric 256 pref medium
fe80::/64 dev wlan1 proto kernel metric 256 pref medium
local ::1 dev lo table local proto kernel metric 0 pref medium
anycast fd3f:9d72:10b8:: dev br-lan.99 table local proto kernel metric 0 pref medium
local fd3f:9d72:10b8::1 dev br-lan.99 table local proto kernel metric 0 pref medium
anycast fe80:: dev tun0 table local proto kernel metric 0 pref medium
anycast fe80:: dev eth0 table local proto kernel metric 0 pref medium
anycast fe80:: dev br-lan table local proto kernel metric 0 pref medium
anycast fe80:: dev br-guest table local proto kernel metric 0 pref medium
anycast fe80:: dev br-lan.99 table local proto kernel metric 0 pref medium
anycast fe80:: dev br-ho table local proto kernel metric 0 pref medium
anycast fe80:: dev wan table local proto kernel metric 0 pref medium
anycast fe80:: dev br-iot table local proto kernel metric 0 pref medium
anycast fe80:: dev wlan0 table local proto kernel metric 0 pref medium
anycast fe80:: dev wlan1 table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ab dev wan table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ac dev eth0 table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ac dev br-lan table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ac dev br-guest table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ac dev br-lan.99 table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ac dev br-ho table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ac dev br-iot table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ad dev wlan0 table local proto kernel metric 0 pref medium
local fe80::5264:2bff:fe90:47ae dev wlan1 table local proto kernel metric 0 pref medium
local fe80::5e43:e55a:8fa0:e416 dev tun0 table local proto kernel metric 0 pref medium
multicast ff00::/8 dev eth0 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev br-lan.99 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev tun0 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev br-lan table local proto kernel metric 256 pref medium
multicast ff00::/8 dev br-iot table local proto kernel metric 256 pref medium
multicast ff00::/8 dev br-guest table local proto kernel metric 256 pref medium
multicast ff00::/8 dev br-ho table local proto kernel metric 256 pref medium
multicast ff00::/8 dev wan table local proto kernel metric 256 pref medium
multicast ff00::/8 dev wlan0 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev wlan1 table local proto kernel metric 256 pref medium
0:	from all lookup local
20000:	from all to fd3f:9d72:10b8::1/64 lookup 1
30000:	from all iif br-lan.99 lookup 2
32766:	from all lookup main
90012:	from all iif lo lookup 1
90016:	from all iif lo lookup 2
4200000001:	from all iif lo failed_policy
4200000003:	from all iif wan failed_policy
4200000008:	from all iif br-guest failed_policy
4200000009:	from all iif br-ho failed_policy
4200000010:	from all iif br-iot failed_policy
4200000012:	from all iif br-lan.99 failed_policy
4200000016:	from all iif tun0 failed_policy
lrwxrwxrwx    1 root     root            16 Oct 24  2021 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            47 Aug  8 12:32 /tmp/resolv.conf

/tmp/resolv.conf.d:
-rw-r--r--    1 root     root            83 Aug  8 12:26 resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf.d <==
head: /tmp/resolv.conf.d: I/O error

Are you sure that this is correct?
Furthermore lan interface is assigned to table 1 and then you have a rule to lookup table for lan ingress traffic. vpn is assigned to table 2.

Hi @trendy

Wow, that was fast - thanks for your quick reply. I have to admit that I don't have in depth knowledge about routing/tables. So I don't know whether it is correct, but assuming it is not as you seem to doubt. May I ask in another way. I think this configuration is for a pro very easy but unfortunately I'm not that pro. So when I have Vlans and setup OpenVPN according to the main OpenWRT documentation what do I have to add from the extras section? I mean in detail what action is to be done when declaring interface, assigning to a firewall zone (separate or lan zone?), which SW modules should be installed for PBR, race conditions, netifd etc. I have read so much information and dived in try and errors so heavily but can't succeed. I'm so proud that I've managed to create the Vlan working for my home network divided in Lan, IOT, Guest and Homeoffice zones. I only want to be able to have a OpenVPN connction to my Lan devices and there to have access to NAS and Nextcloud server as well as to route the whole internet connection when I'm in Germany (or anywhere else) and want access to my home in Switzerland to run the TV app (geolocation restricted). I will try with a second OpenWRT router to play around so that my main router keeps up and running. It's not that I'm not willing to learn, but it's very time consuming and I have 2 little children, one with autism, which costs nearly my whole energy. That's just for the background why it's so hard for me to proceed in sequence.

Thank you anyway so much.

Regards
Televisor

I think for starters it is better to use pbr package. It is much easier to configure everything and it can handle the table creation and assignments. Give it a try, after you revert the settings you applied here, and let us know how it goes.