Help setting up VLANs on a TP-Link Archer A7 v5

I tried following a few tutorials, but many cover the "old" way, and the newer tutorials I've found seem to be very hardware specific and I haven't found one that matches (or even comes close) to my devices' hardware.

Here's what my initial plan is, but I'm open to suggestions. There are a few concepts of VLANs that I do not fully comprehend. I think I'm looking at 3 VLANs. One for a wired connection for a server, one for IoT devices on both 2.4 GHz and 5 GHz bands, and one for "normal" connections, also on both 2.4 GHz and 5 GHz.

Firewall rules are something I think I'm going to have to play around with. Some tutorials have recommended completely isolating the IoT VLAN, but I believe some of my devices need internet access to work. Again, I'm open to suggestions.

I've hopefully provided all the necessary information below.

Thanks.

ubus call system board
{
	"kernel": "6.6.104",
	"hostname": "wrath",
	"system": "Qualcomm Atheros QCA956X ver 1 rev 0",
	"model": "TP-Link Archer A7 v5",
	"board_name": "tplink,archer-a7-v5",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "24.10.3",
		"revision": "r28872-daca7c049b",
		"target": "ath79/generic",
		"description": "OpenWrt 24.10.3 r28872-daca7c049b",
		"builddate": "1758316778"
	}
}
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 'fd9a:4c7b:aa53::/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 'REDACTED'

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

config interface 'wan6'
	option device 'eth0.2'
	option proto 'dhcpv6'

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

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

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '1 0t'
cat /etc/config/wireless
config wifi-device 'radio0'
	option type 'mac80211'
	option path 'pci0000:00/0000:00:00.0'
	option band '5g'
	option channel 'auto'
	option htmode 'VHT80'
	option country 'US'
	option cell_density '0'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'test.50'
	option encryption 'psk2'
	option key 'REDACTED'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'platform/ahb/18100000.wmac'
	option band '2g'
	option channel 'auto'
	option htmode 'HT40'
	option country 'US'
	option cell_density '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'test.24'
	option encryption 'psk2'
	option key 'REDACTED'
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 cachesize '1000'
	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'
	option filter_aaaa '0'
	option filter_a '0'

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'
cat /etc/config/firewall
config defaults
	option syn_flood	1
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
# Uncomment this line to disable ipv6 rules
#	option disable_ipv6	1

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

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
	option name		Allow-DHCP-Renew
	option src		wan
	option proto		udp
	option dest_port	68
	option target		ACCEPT
	option family		ipv4

# Allow IPv4 ping
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

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
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

# Allow essential incoming IPv6 ICMP traffic
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

# Allow essential forwarded IPv6 ICMP traffic
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


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option dest		wan
#	option proto	tcp
#	option target	REJECT

# block a specific mac on wan
#config rule
#	option dest		wan
#	option src_mac	00:11:22:33:44:66
#	option target	REJECT

# block incoming ICMP traffic on a zone
#config rule
#	option src		lan
#	option proto	ICMP
#	option target	DROP

# port redirect port coming in on wan to lan
#config redirect
#	option src			wan
#	option src_dport	80
#	option dest			lan
#	option dest_ip		192.168.16.235
#	option dest_port	80
#	option proto		tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#	option src		wan
#	option src_dport	22001
#	option dest		lan
#	option dest_port	22
#	option proto		tcp

### FULL CONFIG SECTIONS
#config rule
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port	80
#	option dest		wan
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp
#	option target	REJECT

#config redirect
#	option src		lan
#	option src_ip	192.168.45.2
#	option src_mac	00:11:22:33:44:55
#	option src_port		1024
#	option src_dport	80
#	option dest_ip	194.25.2.129
#	option dest_port	120
#	option proto	tcp

VLANs are, technically speaking, applicable only to Ethernet. you only need to worry about setting up the VLANs themselves if you are connecting these separate subnets to the physical ports so you can connect via Ethernet (to the devices and/or to another ap that will broadcast those networks).

It sounds like you might only need additional wireless networks. Is that the case? And if so, is there another AP involved, or just this one?

Meanwhile, you can use the guest wifi tutorial to get started. This might be all you need to do, but if you want to connect them to Ethernet, we can help with the tweaks to the recipe after you’ve done this initial bit.

This tutorial only applies if the OpenWrt box is the main router and you want to create guest Wi-Fi locally on it.

Once you have the main router without Wi-Fi and you want to use guest VLAN for all the APs and some switches on the network, than it is of not much use, unless I am mistaken.

I am currently trying to find a way how to configure such setup with OpenWrt as an dumb AP. I already have it running with AsusWrt-Merlin as AP and OPNsense as my main router, but so far I am failing to find how to configure OpenWrt to accept guest VLAN on it’s LAN ports and bridge it to separate SSID for guests.

I need to go through more tutrials it seems…

I think you just need to create a different network in the OpenWrt router beside LAN. That way, you can assign the physical ports to it and also create Wireless AP associated with it.

The link above shared by @psherman is probably enough to get you started in the right direction.

I already read that whole guide two days ago. But it has zero info about VLANs. It is just about separate Wi-Fi SSID for guests on the main router. That doesn’t mean it is not helpful, but it solves only half of the problem.

And the trouble is while this guide seems to be up-to-date, all the VLAN related guides on the wiki are outdated, still mentioning switch configuration, etc.

I have already found some tutorial that explains how to move all the traffic to VLANs (including the normal LAN traffic), but that’s not what I want to achieve.
I have normal LAN traffic untagged and only guest network is tagged so I can use only on devices which are aware of tagged packets.

The answer was ment for the OP, you are hijacking this thread.
If you have a different question then better start your own thread.

2 Likes

That’s not entirely true. He is quite literally asking how to setup VLANs to have separate wireless network for IoT and for normal Wi-Fi clients which is basically the same goal as mine.

The only difference is, I have the separate wireless network for guests and not for IoT.

Seems like after two days spent deep in youtube videos, guides and discussions I finally have a working setup.
Will share it here once I verify everything works as expected.

I will be happy to help you set this up when I have a little more time (later today). In the meantime:

  • what VLANs are on the upstream?
  • What are the functions/names of each vlan (ie lan, guest, iot)?
  • What port is used to connect to the upstream?
  • Are all networks tagged, or is one untagged? If there is an untagged network, what is it?
  • What is the desired network for managing the ap and what address?
  • What port-vlan assignments do you want for the other ports?

A bridged or "dumb" AP carrying multiple SSIDs on separate VLANs back to a main router is set up like this:

  • An Ethernet VLAN attached to a bridge. How to do that depends on whether the router is swconfig or the new DSA system. Almost all targets except ath79 (used by the Archer A7) have been converted to DSA. DSA models will use bridge-vlans inside a single bridge. swconfig models will use separate bridge devices.

  • An Interface of proto none ("Unmanaged" in the GUI) with the bridge or bridge-vlan as its Device.

  • A wifi-iface of mode AP with the Interface defined above as its Network.

Repeat these blocks for each SSID / VLAN.

The cable to the main router should have all VLANs tagged, as consumer grade hardware can have trouble mixing tagged and untagged. This means you'll need to reconfigure the original lan network to be tagged as well.

Thanks for offering help. Luckily I already made it working, so I would just appreciate if you check it for obvious beginner mistakes.

To your questions:

  • There is only single guest VLAN on the OPNsense router (upstream)
  • I am using WAN port to connect to upstream, as it is the only port with PoE (WR3000P)
  • I have kept default LAN untagged, even though I understand it is strictly speaking not the ideal solution
  • I want to manage all my network devices on default LAN
  • One port of the AP is assigned to the guest VLAN, so I can connect untrusted devices there

Here is my network config:

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

config interface 'lan'
        option device 'br-lan.1'
        option proto 'static'
        option ipaddr '100.100.1.250'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '100.100.1.1'
        list dns '100.100.1.1'
        list dns_search 'lan_domain'

config bridge-vlan
        option device 'br-lan'
        option vlan '1'
        list ports 'lan1:u*'
        list ports 'lan2:u*'
        list ports 'lan3:u*'
        list ports 'wan:u*'

config bridge-vlan
        option device 'br-lan'
        option vlan '11'
        list ports 'lan4'
        list ports 'wan:t'

config interface 'guest'
        option proto 'static'
        option device 'br-lan.11'
        option ipaddr '100.100.11.250'
        option netmask '255.255.255.0'
        option gateway '100.100.11.1'
        option type 'bridge'

Wireless is simple, you just assign it to the guest interface:


config wifi-iface 'wifinet2'
        option device 'radio0'
        option mode 'ap'
        option ssid 'guest'
        option encryption 'sae-mixed'
        option key 'REDACTED'
        option ocv '0'
        option network 'guest'

My main motivation is to have separate Wi-Fi for untrusted devices, which should be fulfilled by this setup even with the default untagged LAN. If I understand it correctly wireless clients should not be able to abuse any imperfection this might have introduced.
I tried to test whether there is a way to hop to the default LAN from the guest and everything was blocked even on the cable, so it looks safe enough to me for now.

Off-course I had to configure the tagged guest VLAN on my managed switches, to make it work.

There is no need for the guest interface on the AP to hold an IP address. Having one allows the guests to attempt IP-based attacks on the AP operating system.

I agree with @mk24. The guest network interface should look like this:

config interface 'guest'
        option proto 'none'
        option device 'br-lan.11'

Yep, will probably remove it.

I have added it mainly for debugging purposes, to be able to ping / traceroute it.

I am a bit confused about one element of your config...

The A7v5 is an ath79 device, so I would expect it to have swconfig based config stanzas. This is clearly DSA syntax.

Was this br-lan section (other than the wan port in the bridge which you clearly added) found in thed efault configuration of this device?

Sorry, I haven’t noticed that Archer A7 is still old swconfig device. I thought OP just found some obsolete VLAN config from days before DSA.

As I mentioned in my post I am on WR3000P, where I use WAN as upstream port as it is 2.5 GbE with PoE. WR3000P is DSA as most of the HW these days.

I've followed the guest wifi tutorial as suggested, and the IoT VLAN seems to be working as expected.

As for the wired VLAN, perhaps an explanation of what I'm trying to do will provide more clarity.

I'm in the process of setting up a homelab. The router I've configured with the IoT VLAN is connected (via the WAN port) to a LAN port on another router, which in turn connects to the Internet. The homelab server is connected to a LAN port on same router as the IoT VLANs. I've read numerous articles stating that setting up a separate VLAN for the server is better from a security standpoint.

I'm probably overthinking the configuration, and I'm always open to suggestions.

Thanks.

Remove LAN 4 from VLAN 1 and use it to create a new VLAN 3.
Then use eth0.3 as the device to create a new interface.

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

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

config switch_vlan
	    option device 'switch0'
	    option vlan '3'
	    option ports '5 0t'

config interface 'hmlabsrv'
        option device 'eth0.3'
        option proto ...
	    ...

Create a new firewall zone, rules and a dhcp pool (if needed) using the guest network guide. Plug the server into LAN 4 and it will be isolated from the LAN and IoT based on the firewall rules you created.