Status page IPV4 upstream shows wrong VLAN

Archer C7 V2 running OpenWrt 18.06.1 r7258-5eb055306f / LuCI openwrt-18.06 branch (git-18.228.31946-f64b152).

I have four VLANs. One regular LAN -> VLAN1 & WAN -> VLAN2, and two separate guest LANs. One guest VLAN4 has it's own port on the switch. Other guest VLAN3 is just connected to the wireless interface.

Everything is working fine but the status page -> IPV4 IPv4 Upstream shows my guest VLAN3 Device: Bridge: "br-guest" instead of my IPV4 WAN interface. The IP address, gateway etc. shown is from my private IP space for that subnet and not the public IP.

IPV6 Upstream shows correct Device: Software VLAN: "eth0.2"

Is this a bug?

No. LuCI shows the first interface with a gateway as upstream interface. You likely configured a superfluous and semantically incorrect "gateway" option on your "guest" network. Remove it and the status page should show the correct interface.

I think it's based on the routing table.

With IPv4 it works well on my routers, but with IPv6 you can have multiple default routes active concurrently with source-specific routing. It would be nice if an interface with default gateway enabled in the settings was given precedence on the status page. That would be a 6in4 tunnel in my case, but instead it shows the interface connected to my other routers (which got source-specific default routes for other IPv6 prefixes).

Open a ticket in the LuCI tracker and describe an algorithmic approach on how to select the proper IPv6 interface and I will take a look at it.

Note that this is OT wrt. the OPs question though

@jow, you are correct. As soon as I removed the gateway line from my config and rebooted, the upllink was fixed. Thank you.

What is gateway the option used for? I thought I had to explicitly provide it in VLAN subnets to make sure I had a default route to WAN.

It is not necessary to set up a default route for each ingress interface. All packets entering the router use the same routing table and default route (explanation slightly simplified).

The gateway option to configure the default route is only needed when your WAN interface uses a static IP configuration. For the common PPP or DHCP client setups, the default route is set up automatically.

I noticed that I can still access my main LAN router - from my other two VLAN subnets. That agrees with the common routing table comment that you made. In that case, what DNS server should I use for VLANs? I cannot access other devices in the main LAN from other two VLANs (expected result)

Do I also use that as my DNS server for other VLAN subnets? Currently I have left the field blank. As I use adblock, I have a firewall poer forward rule to pass all DNS queries to anyway.