[SOLVED] Guest network for AirPort Extreme (VLAN 1003)

Ok, after additional tinkering with my setup I found source of the issue and how to permanently fix it.

This RTF_IFSCOPE flag is somehow forced by DHCP server or rather its misconfiguration.

I fixed it by setting list dhcp_option '6,192.168.5.254' on my wlan1 interface, where 192.168.5.0/24 is the wlan1 subnet and 192.168.5.254 is the IP address of my router/gateway running my own DHCP and DNS server.

I’m a networking noob, but my theory is that having traffic properly routed into a separate network interface (tun0 managed by OpenVPN in my case) and no explicit DHCP/DNS config, the wifi connection tries to ask for DHCP in tun0 and someone there gives misleading info (maybe no info at all). And macOS networking subsystem decides that the interface is not ready and adds RTF_IFSCOPE flag there (maybe while assuming there is another non-scoped interface available).

Anyways the dhcp_option tweak reproducibly fixed the issue and removing it reproducibly brings it back.