OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • [SOLVED] Interface display order
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] Interface display order  (Read 9878 times)

reep

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 8
    • View Profile
[SOLVED] Interface display order
« on: August 10, 2016, 04:21:23 pm »
Remember this when I played with earlier versions (https://github.com/opnsense/core/issues/199)

The first WAN interface is called 'wan' by the system with further interfaces then being called optx.

Despite being able to change the description of the interface the actual sort order does not change.

So for example in Firewall rules you get

WAN1   LAN   WAN2   WAN3   IPSEC

I found a solution was to manually rename and sort each interface in the <interfaces> in:

/conf/config.xml

I then renamed any references

e.g.

wan -> wan1
opt1 -> wan2
opt2 -> wan3

I then updated any relevant pages e.g. interfaces/gateways to resave and regenerate any configs e.g. firewall rules.

I now have nicely sorted interfaces everywhere :-) Only a small thing but looks SO much better and everything is more logical, and where you expect to find it.

It is better to do it as soon as you have assigned your interfaces and before you do any other configuration.

Not sure how to suggest fixing this - happy to create a bug if you think it is worth a NFR ?

B. Rgds
John
« Last Edit: August 12, 2016, 01:23:30 pm by franco »
Logged

AdSchellevis

  • Administrator
  • Hero Member
  • *****
  • Posts: 907
  • Karma: 184
    • View Profile
Re: Interface display order
« Reply #1 on: August 10, 2016, 08:55:35 pm »
Hi John,

It should indeed be better to sort the interfaces by description in the other areas as well, luckily (almost) all interface lists use a single function since 16.7 to retrieve the interface list.

I've added a patch for the proper sorting https://github.com/opnsense/core/commit/48769e27ae1d1a166fd0f6d286f5132c39d6d6ff

You can try it on your installation with:
Code: [Select]
opnsense-patch 48769e27a

Best regards,

Ad
Logged

reep

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 8
    • View Profile
Re: Interface display order
« Reply #2 on: August 10, 2016, 09:43:01 pm »
Thanks ! I'll give it a whirl.

B. Rgds
John
Logged

wurmloch

  • Full Member
  • ***
  • Posts: 101
  • Karma: 14
    • View Profile
Re: Interface display order
« Reply #3 on: August 10, 2016, 10:31:40 pm »
Thanks for this patch!

Uwe
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: Interface display order
« Reply #4 on: August 11, 2016, 09:07:22 am »
Hmm, the patch doesn't work for me. There is still an old function compare_interface_friendly_names() that prefers WAN and LAN on top. Maybe we should kill it?

As far as I know that's the only thing that still does what John described.


Cheers,
Franco

PS: Would not recommend editing the internal interfaces names in the config. Some parts still prefer "wan" and "lan", which also needs to be cleaned up.
Logged

reep

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 8
    • View Profile
Re: Interface display order
« Reply #5 on: August 11, 2016, 10:25:32 am »
Quote from: franco on August 11, 2016, 09:07:22 am
Hmm, the patch doesn't work for me. There is still an old function compare_interface_friendly_names() that prefers WAN and LAN on top. Maybe we should kill it?

As far as I know that's the only thing that still does what John described.

Anything I can try ?

Quote
PS: Would not recommend editing the internal interfaces names in the config. Some parts still prefer "wan" and "lan", which also needs to be cleaned up.

Yes I think  I fell foul of that last night.... did some changes and totalled the system  :'(  ;D ;D

Reinstall coming (and still have to do do it from 15.x and then upgrade !)

I know it doesn't affect the functionality, but it is an eyesore and just grates...

B. Rgds
John
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: Interface display order
« Reply #6 on: August 11, 2016, 11:00:54 am »
Works now, I did something wrong. :D
Logged

reep

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 8
    • View Profile
Re: Interface display order
« Reply #7 on: August 12, 2016, 10:35:47 am »
Quote from: franco on August 11, 2016, 11:00:54 am
Works now, I did something wrong. :D

LOL - nice to know that even the professionals get it wrong sometimes  :-)

I'll give it a go.

B. Rgds
John
Logged

reep

  • Jr. Member
  • **
  • Posts: 68
  • Karma: 8
    • View Profile
Re: Interface display order
« Reply #8 on: August 12, 2016, 10:38:39 am »
Works for me :-)

Much nicer !

B. Rgds
JC
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • [SOLVED] Interface display order
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2