Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Vlan naming inconsistency between Console and GUI.
« previous
next »
Print
Pages: [
1
]
Author
Topic: Vlan naming inconsistency between Console and GUI. (Read 530 times)
mimizone
Newbie
Posts: 23
Karma: 1
Vlan naming inconsistency between Console and GUI.
«
on:
January 29, 2024, 06:48:46 pm »
Hi,
I've noticed that when using the text console to create vlan interfaces, it uses the "old" convention of interfacename_vlanXXX and it can't be set by the user, while the GUI is using the newer version of vlanXX.X.XX by default that's meant to be compatible with QinQ, and gives the impression the old convention is not a thing anymore (even if the code still allows it under the hood).
I tested that in 23.7.12 and it's still happening.
That's the line in the code responsible for this.
https://github.com/opnsense/core/blob/9f8a23a1daf5ad58f2cb7489834c1ed73837229b/src/etc/inc/console.inc#L645
I would have to understand better the PHP code to see if other functions in the Vlan.php code could be reused here, but it seems the code is meant for the GUI and not the text UI.
Like this one for instance
https://github.com/opnsense/core/blob/9f8a23a1daf5ad58f2cb7489834c1ed73837229b/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vlan.php#L40
There is nothing blocking the user to use the old convention in the GUI.
It's done here :
https://github.com/opnsense/core/blob/9f8a23a1daf5ad58f2cb7489834c1ed73837229b/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vlan.php#L63
But it's not stated anywhere in the GUI/help, and that's why I personally feel like it leads to inconsistency if you end up creating vlans in both the text console and GUI.
I may be an outlier here requiring to set vlan interfaces right away in the text console during the installation, otherwise I can't access the GUI because of the way our physical interfaces are set.
Furthermore, looking at the code, I find that the real prefix enforced is not vlan or qinq, but vlan0 or qinq0 (which makes total sense to look like other interfaces).
I believe the expected naming scheme is vlan0.XXXX or vlan0.XXXX.XXXX and qinq.XXXX.XXXX
Is that right?
the GUI error message when using the wrong name doesn't include the 0, which is misleading.
I've seen our routers ended up being configured with interfaces names vlan01, vlan02 or vlan0.1.100 (with 1 being meaningless in our case), because people misunderstood naming scheme.
I don't have a perfect solution for this.
- Adding more explicit documentation in the UI would be helpful.
- Enforcing more strict validation of names in the GUI would be nice with the risk though to break compatibility with existing deployments that didn't follow the format perfectly. I have some more fancy regex/if-else causes that I am testing if interested.
- Making the Console and GUI behave the same would be nice too, by offering the option to type a custom name, and use the default old format if none is provided.
It's all for discussion more than an actual feature request. I am now aware of the behavior, so I understand what to do. Just had to go deeper than expected to understand
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Vlan naming inconsistency between Console and GUI.