OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version lede-17.01
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Routing Route - 10.02.2018
Last edited by Jo-Philipp Wich - 14.02.2018

FS#1341 - vlan configuration fails


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.

Closed by  Jo-Philipp Wich
14.02.2018 15:48
Reason for closing:  Fixed
Routing Route commented on 10.02.2018 17:01

I found other vlan issues that I think could be other symptoms of lede trying to configure the vlans with a half-working swconfig sequence (only works if counter equals vlan id?)

I left comments on the other issues, but maybe the syntax/sequence mismatch reported in this issue is the root cause.

Routing Route commented on 11.02.2018 16:36

Ok, the following bug numbers confirm the lede scripts really seem to use the wrong sequence (second example above, that only works for when stanza==vlanid), and many vlan configuration issues can be fixed by having the scripts use the working swconfig sequence (first from above).

 FS#991   FS#1147  FS#1279

Admin
Jo-Philipp Wich commented on 14.02.2018 15:48

Fixed with the following commits:

Routing Route commented on 14.02.2018 15:55

Thank you very much for fixing it!

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing