#20739: VLAN configuration doesn't work on the web interface (LuCi)
---------------------------+------------------------
  Reporter:  achmetow84@…  |      Owner:  developers
      Type:  defect        |     Status:  new
  Priority:  normal        |  Milestone:
 Component:  packages      |    Version:  Trunk
Resolution:                |   Keywords:
---------------------------+------------------------

Comment (by GregorHoffleit):

 Replying to [comment:1 anonymous]:
 > Different routers have different switch layouts, so look at the Wiki for
 your specific device. The TP-Link Archer C7 has eth0 = WAN, and eth1 = LAN
 (the 4 switch ports). Port 0 of the switch = eth1 (labelled CPU in Luci),
 Port 6 = eth0. Port 1 is labelled WAN in Luci. Look at the wiki for your
 router. Every router is different. The popular TP-Link WDR4300 only has
 eth0.

 That's true.

 Still the point is that it is indeed a bug in the web interface:

 On an Archer C5/C7, if you go to "Network", "Interfaces", "Interface WAN"
 and then to the tab "Physical Settings", you're presented with the
 following options:

 * Ethernet Adapter: "@wan" (wan6)
 * Ethernet Adapter: "eth0" (wan, wan6)
 * VLAN Interface: "eth0.1"
 * VLAN Interface: "eth0.2"
 * Ethernet Switch: "eth1" (lan)
 * Ethernet Adapter: "wlan" (lan)
 * Wireless Network: Master "cola09a" (lan)
 * Wireless Network: Master "cola09" (lan)
 * Custom Interface: [...]

 The switch is correctly identified as "eth1", so the VLANs should be
 "eth1.1" and "eth1.2".

 It's a bug that the VLAN interfaces are listed under eth0.


 As far as I can see, the problem starts with the output of "swconfig dev
 switch0 help" on the Archer. The web interface would expect something like
 "switch0: eth1(Atheros AR8327)...", but on the Archer, the output looks
 like this:

 {{{
 # swconfig dev switch0 help
 switch0: ag71xx-mdio.0(Atheros AR8327), ports: 7 (cpu @ 0), vlans: 128
      --switch
         Attribute 1 (int): enable_vlan (Enable VLAN mode)
         Attribute 2 (none): reset_mibs (Reset all MIB counters)
         Attribute 3 (int): enable_mirror_rx (Enable mirroring of RX
 packets)
         Attribute 4 (int): enable_mirror_tx (Enable mirroring of TX
 packets)
         Attribute 5 (int): mirror_monitor_port (Mirror monitor port)
         Attribute 6 (int): mirror_source_port (Mirror source port)
         Attribute 7 (string): arl_table (Get ARL table)
         Attribute 8 (none): apply (Activate changes in the hardware)
         Attribute 9 (none): reset (Reset the switch)
      --vlan
         Attribute 1 (int): vid (VLAN ID (0-4094))
         Attribute 2 (ports): ports (VLAN port mapping)
      --port
         Attribute 1 (none): reset_mib (Reset single port MIB counters)
         Attribute 2 (string): mib (Get port's MIB counters)
         Attribute 3 (int): enable_eee (Enable EEE PHY sleep mode)
         Attribute 4 (int): pvid (Primary VLAN ID)
         Attribute 5 (string): link (Get port link information)

 }}}

 /usr/lib/lua/luci/model/network.lua tries to match against this string,
 but fails to find a reasonable (i.e. "ethX") value, and therefore uses
 "eth0" as fallback:

 {{{
 local l
 for l in utl.execi("swconfig dev %q help 2>/dev/null" % s.device) do
         if not base then
                 base = l:match("^%w+: (%w+)")
         end
 end
 if not base or not base:match("^eth%d") then
         base = "eth0"
 end
 }}}

 That's as far as I get at this moment.

 I've not yet understood how the web interface identifies "eth1" as switch
 in the first place.

 Anyhow, I wonder if the output above is a bug in swconfig?

--
Ticket URL: <https://dev.openwrt.org/ticket/20739#comment:2>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to