nav
nav copied to clipboard
[BUG] PortAdmin forces configuration of native vlan on trunks
Describe the bug
Some switch platforms (JunOS is one) allow trunk ports to not have a native VLAN configured. However, PortAdmin seems to force a native vlan to always be configured. This likely stems from PortAdmin originally being developed and tested on networks that were very Cisco-oriented, where Cisco switches would always default to VLAN 1 as the native VLAN for a trunk if left unset.
Here is one of potentially multiple places in the code that need to be inspected. This line defaults the native vlan value to 1 if left out of the trunk configuration POST request:
https://github.com/Uninett/nav/blob/2e0c8e993c1776d9a0519436a62c39443eaaffb6/python/nav/web/portadmin/views.py#L669
Expected behavior
PortAdmin should not force a native vlan setting on platforms where such a value can "legally" be omitted.
Environment (please complete the following information):
- NAV version installed: 5.8.3
Additional context
Care should be taken that changing this behavior doesn't disrupt existing behavior for platforms like Cisco and HP.
This was discovered when testing a fix for #2477