[FS#1341] vlan configuration fails

LEDE Bugs lede-bugs at lists.infradead.org
Sat Feb 10 08:36:50 PST 2018


A new Flyspray task has been opened.  Details are below. 

User who did this - Routing Route (rrt) 

Attached to Project - OpenWrt/LEDE Project
Summary - vlan configuration fails
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - lede-17.01
Due in Version - Undecided
Due Date - Undecided
Details -  
**Environment:**  Lede 17.01.4 on UBNT-ERX (Ubiquiti Networks - EdgeRouter X)

**Reproducing:** Configure the vlan switch configuration in luci with additional vlans (example below), and notice that the config won't get set up properly.

It turned out that the configured vlans get properly saved to /etc/config/network, but `swconfig dev switch0 show` would still only present only an incomplete configuration. Only the default vlan 1 (lan) and vlan 2 (wan) happened to work on those ports for which they where still configured, but nothing more.

**Workaround / Solution?:**
Adapting examples that I found on the net, I found out that an additional vlan for the port 4 could successfully be configured with `swconfig`, if adding following command sequence (that directly uses vlan id numbers in single commands) to /etc/rc.local (and it works as long as no a network config update is triggered in luci):


# The swconfig port numbers on UBNT-ERX are:
# |0|1|2|3|4|   |6|
#  ^             ^
# wan           host
#     
# (looking at front of ports)

# reset config
swconfig dev switch0 set reset 1
swconfig dev switch0 set enable_vlan 1

# configure vlan members
swconfig dev switch0 vlan 1 set ports '1 2 3 6t'
swconfig dev switch0 vlan 2 set ports '0 6t'
swconfig dev switch0 vlan 14 set ports '4 6t'

# configure incoming package tagging
swconfig dev switch0 port 0 set pvid 2
swconfig dev switch0 port 1 set pvid 1
swconfig dev switch0 port 2 set pvid 1
swconfig dev switch0 port 3 set pvid 1
swconfig dev switch0 port 4 set pvid 14

# apply config
swconfig dev switch0 set apply 1


**Not working sequence / Cause?**
I had also tried the following vlan member configuration sequence which seemed more logical and complete, but trying it in this more explicit way again only let to an incomplely activated switch config, just as the one set up by the lede scripts. So maybe this creates or suffers the same error. Maybe swconfig has a bug or the sequence is simply not correct.

swconfig dev switch0 set reset 1
swconfig dev switch0 set enable_vlan 1

swconfig dev switch0 vlan 1 set ports '1 2 3 6t'
swconfig dev switch0 vlan 1 set vid 1
swconfig dev switch0 vlan 2 set ports '0 6t'
swconfig dev switch0 vlan 2 set vid 2
swconfig dev switch0 vlan 3 set ports '4 6t'
swconfig dev switch0 vlan 3 set vid 14

swconfig dev switch0 port 0 set pvid 2
swconfig dev switch0 port 1 set pvid 1
swconfig dev switch0 port 2 set pvid 1
swconfig dev switch0 port 3 set pvid 1
swconfig dev switch0 port 4 set pvid 14

swconfig dev switch0 set apply 1


It seems to me the problem could possibly be solved by repairing `swconfig` to accept the lede config or let the scripts use the terser but working syntax.

More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=1341



More information about the lede-bugs mailing list