TP-Link Archer A9 v6 22.03 Configurations issues - VLAN / Firewall configuration issues

Hello folks, Excuse the newbie questions & be gentle y'll. Thx.

All I'm trying to do is get 3 networks going . A Trusted LAN 192.168.1.1 already created by default (I thought I could use that, 2) Guest 192.168.40.1/24 vlan40 (called " Marti" in my case) & 3) perhaps a future Security Lab (172.16.0.1/24 Vlan16).

Once I get the wires part working I will add the second floor AP but first things first. I tried to follow OneMarcFifty 19 & 21 version but 22.03 is different...


There was some default config, I added vlan16 & 40. When I plug my computer into switch port 4 "vlan16" I should be getting a static address of 192.168.40.x switch port 4 "vlan40" & similarly on port3 I should be getting a static address of 172.16.0.x but in both case I'm not... So I screwed up somewhere but not sure where..

Another thing that confused me why I could not choose a Firewall zone for "SecLab" or "Marti" instead the choices were"WAN & Marti".. this was odd
Any help will be appreciated. I have the config and pics below.

root@OpenWrt:~# cat /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 'xxx:3bd5:xxxx::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'eth0.2'
        option macaddr 'xx:xx:6a:f1:xx:xx'

config interface 'wan'
        option device 'eth0.2'
        option proto 'dhcp'

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

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0t 2 3 4 5'
        option vid '1'

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

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '0t 5t'
        option vid '40'
        option description 'Marti'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option ports '0t 4t'
        option vid '16'
        option description 'SecLab'

config interface 'Marti'
        option proto 'static'
        option device 'eth0.40'
        option ipaddr '192.168.40.1'
        option netmask '255.255.255.0'

config interface 'SecLab'
        option proto 'static'
        option device 'eth0.16'
        option ipaddr '172.16.0.1'
        option netmask '255.255.255.0'

config device
        option name 'eth0'

config device
        option name 'eth0.16'
        option type '8021q'
        option ifname 'eth0'
        option vid '16'

config device
        option name 'eth0.1'
        option type '8021q'
        option ifname 'eth0'
        option vid '1'

config device
        option name 'eth0.40'
        option type '8021q'
        option ifname 'eth0'
        option vid '40'

root@OpenWrt:~#

See image of the LuCi here: https://imgur.com/M4gmobF

This looks good if you’re using only Ethernet (and/or an external ap connected by Ethernet). If you’re using the internal radios, your interfaces need to use a bridge device (use br-lan as an example).

I realized I didn't address all of your issues:

This is because you have setup your networks as tagged on those ports. Normal computers and such are not expecting to work with 802.1q tagged networks, so they won't see this network unless explicitly configured to do so.

Moreover, you still have your main lan (VLAN 1) associated with those ports, untagged. You may only have one untagged network on a port, so you must remove them from VLAN 1.

Here's how you do that:

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

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '0t 5'
        option vid '40'
        option description 'Marti'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option ports '0t 4'
        option vid '16'
        option description 'SecLab'

Note that logical ports 4 and 5 may map to physical ports 3 and 4, for example, or maybe something else. You may need to try every port to figure out the mapping.

For reference, your device uses logical port 0 for the CPU, and logical port 1 for the WAN port. The other logical ports (2-5) are your lan ports, but the specific mapping is not necessarily straight forward.

You didn't post your firewall configuration, so it's hard to say for sure what you're seeing. You should have a lan zone -- I'd recommend associating your two new networks with the lan zone for now -- it's the most permissive and won't introduce unexpected variables into the equation. You can tighten things down after you know it is working.

@psherman I appreciate your efforts. I modified the network config to this:

root@OpenWrt:~# cat /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 'xxxx:3bd5:xxxx::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'
        option vlan_filtering '1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'eth0.2'
        option macaddr 'xx:xx:6a:f1:xx:xx'

config interface 'wan'
        option device 'eth0.2'
        option proto 'dhcp'

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

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

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

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '0t 5t'
        option vid '40'
        option description 'Marti'

config switch_vlan
        option device 'switch0'
        option vlan '4'
        option ports '0t 4t'
        option vid '16'
        option description 'SecLab'

config interface 'Marti'
        option proto 'static'
        option device 'eth0.40'
        option ipaddr '192.168.40.1'
        option netmask '255.255.255.0'

config interface 'SecLab'
        option proto 'static'
        option device 'eth0.16'
        option ipaddr '172.16.0.1'
        option netmask '255.255.255.0'

config device
        option name 'eth0'

config device
        option name 'eth0.1'
        option type '8021q'
        option ifname 'eth0'
        option vid '1'
root@OpenWrt:~#

On LAN Port 1 & 2, I can ping 172.16.0.1 & 192.168.40.1, however on LAN Port 3 & 4, get an IP address [172.16.0.1/24] nor ping the GW addresses .1 ( Port 3 "VLAN16" and port 4 "VLAN40" (IP address [192.168.40.1/24] )

Here is the Firewall setting:

root@OpenWrt:~# cat /etc/config/firewall

config defaults
        option input 'ACCEPT'
        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'

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 'Marti'
        option output 'ACCEPT'
        option forward 'REJECT'
        option input 'REJECT'
        list network 'Marti'

config zone
        option name 'SecLabs'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'
        list network 'SecLab'

config forwarding
        option src 'SecLabs'
        option dest 'wan'

config forwarding
        option src 'lan'
        option dest 'SecLabs'

config forwarding
        option src 'Marti'
        option dest 'wan'

config rule
        option name 'Marti_DHCP_and_DNS'
        option src 'Marti'
        option dest_port '53 67 68'
        option target 'ACCEPT'
root@OpenWrt:~#

Here is my DHCP Config setting:

root@OpenWrt:~# cat /etc/config/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'
        option ra_slaac '1'
        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 'Marti'
        option interface 'Marti'
        option start '100'
        option limit '150'
        option leasetime '12h'

config dhcp 'SecLab'
        option interface 'SecLab'
        option start '100'
        option limit '150'
        option leasetime '12h'
root@OpenWrt:~#

remove the vlan_filtering option from this bridge. It isn't necessary.

And below, your VLANs are still tagged on the ports (4 and 5). Remove the t from ports for and 5 (respectively) -- it should be '0t 4' and '0t 5'

@psherman, Many Thanks! The wired LAN Network is up & running. I will add the WiFi than post the working config for all other to benefit.

Just one quick questions for my edification why was it necessary to remove option vlan_filtering '1'

Thanks.

I'm not sure that it was "necessary", but you're not using VLAN filtering, so no need to have it enabled.

Keep in mind that wifi won't work with the VLANs as currently configured. You need to make bridges and attach the networks to the bridges.

So, on my current setup without adding the dumb AP all the 2 Interfaces ( e0.16 vlan16 SecLab & e.40 vlan40 are bridged on br-lan lan interface e0.

Since I have to add wireless do I need to make separate 3 additional bridges (LAN, Guest (Marti) & SecLabs)?

Are you talking about your dumb AP or the main router at in this sentence?

They should not be bridged. And in this device (the A9), they are not. You have br-lan which contains eth0.1. It should not have anything else.

If you want to use the wifi in the A9, you need to setup bridges for the two other networks

You'll add these two bridge devices:

config device
        option name 'br-marti'
        option type 'bridge'
        list ports 'eth0.40'

config device
        option name 'br-seclab'
        option type 'bridge'
        list ports 'eth0.16'

and then edit your network interfaces to use those bridges (note the device line):

config interface 'Marti'
        option proto 'static'
        option device 'br-marti'
        option ipaddr '192.168.40.1'
        option netmask '255.255.255.0'

config interface 'SecLab'
        option proto 'static'
        option device 'br-seclab'
        option ipaddr '172.16.0.1'
        option netmask '255.255.255.0'

Maybe I missed something but you don’t need to make additional bridges. Just select the interfaces as normal when you create SSIDs.

Bridges are required if a network connects to more than one physical interface. So for example, ethernet + wifi, or 2 wifi radios -- without a bridge, it will not work properly.

In this case, since the bridge device consists of just 1 vlan, then technically you won't need the bridge device, cos you can just attach the specific vlan directly from the interface dialog, and in the wifi dialog you'd attach the interface. Am I missing something?

Yes. Ethernet is one physical interface. A radio is another. That makes 2 physical interfaces. Therefore, you need a bridge. But it's a bit more nuanced, which may be why you are thinking that the bridge only has one physical interface.

A network can only associate with a single 'device'. That device can be a physical interface such as eth0, a VLAN (eth0.16), or a radio/SSID -- but there can only be one. In this case, think of it like an ethernet connection on your computer -- if you have one port, you can only directly connect it to one other device. If you want to connect that computer to multiple devices, you get a switch, and that (in super simplistic terms) behaves like a 'splitter' and allows you to have many devices connected together.

Alternatively, you can use a bridge and connect that to your network -- the bridge is basically a software equivalent of a simple/unmanaged switch that allows multiple physical/virtual interfaces to be connected together. A bridge appears as a single device to the network interface -- much like how an ethernet switch has a single physical connection to your computer, but functionally connects it your computer to mulitple devices.

Because of the way OpenWrt specifies wired and wireless devices in separate files, the wifi radios do not appear in the /etc/config/network file. As such, the bridge will contain only the device (i.e. eth0.16) in the network file.

In the /etc/config/wireless file, the network will be associated with a radio/SSID. When you add the network to the radio/SSID (in the wireless file), it will associate with as a 'device' for that network... if the network doesn't have a device defined, that's fine. However, if an ethernet/VLAN (or another radio) device is already defined, that causes a problem since the network can only have a single device attached. This is where the bridge comes in... the association of SSID --> network allows the radio to join the bridge, just as if it is using an ethernet cable to connect to a switch that is connected to the network interface.

Does that make more sense?

Thanks for the thorough answer, you truly are the mvp.

I know the concept of bridging, but I somehow assumed OW would create an interim bridge if you were to associate a lone device to a interface/network and then associate wifi to the same interface. (As to why I asummed that, I dunno, but it probably involves some late-at-nightism where you think you did something that you didn’t lol)