[SOLVED] Interface display order

Started by reep, August 10, 2016, 04:21:23 PM

Previous topic - Next topic
August 10, 2016, 04:21:23 PM Last Edit: August 12, 2016, 01:23:30 PM by franco
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

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:
opnsense-patch 48769e27a


Best regards,

Ad

Thanks ! I'll give it a whirl.

B. Rgds
John


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.

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

Works now, I did something wrong. :D

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

Works for me :-)

Much nicer !

B. Rgds
JC