OPNsense Forum

English Forums => Development and Code Review => Topic started by: reep on August 10, 2016, 04:21:23 pm

Title: [SOLVED] Interface display order
Post by: reep 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
Title: Re: Interface display order
Post by: AdSchellevis 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 (https://github.com/opnsense/core/commit/48769e27ae1d1a166fd0f6d286f5132c39d6d6ff)

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

Best regards,

Ad
Title: Re: Interface display order
Post by: reep on August 10, 2016, 09:43:01 pm
Thanks ! I'll give it a whirl.

B. Rgds
John
Title: Re: Interface display order
Post by: wurmloch on August 10, 2016, 10:31:40 pm
Thanks for this patch!

Uwe
Title: Re: Interface display order
Post by: 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.


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.
Title: Re: Interface display order
Post by: reep on August 11, 2016, 10:25:32 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
Title: Re: Interface display order
Post by: franco on August 11, 2016, 11:00:54 am
Works now, I did something wrong. :D
Title: Re: Interface display order
Post by: reep on August 12, 2016, 10:35:47 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
Title: Re: Interface display order
Post by: reep on August 12, 2016, 10:38:39 am
Works for me :-)

Much nicer !

B. Rgds
JC