Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtysh: Do not sort ip[v6] address configured prefixes #15490

Conversation

ton31337
Copy link
Member

@ton31337 ton31337 commented Mar 5, 2024

Related: #15464

Depending on how you give the commands in vtysh for ip addresses this
is the order of the IPs installed on interface. But as soon you save
the configuration, the order in config is different, taking the ascending
order of the IPs.

It could be nice to have an specific order of the IPs installed on the
interface, for example for lo that can have public IP and private IP.

In this case you want the public IP to be first in to be able to use GRT
as a normal system to do updates for example.

At this moment Linux doesn't support multiple loopbacks, except dummy interfaces.

Before:

```
R02# interface lo
R02#  ip address 89.A.B.2/32 label 01
R02#  ip address 10.100.2.1/32 label 02
R02# show run
interface lo
 ip address 10.100.2.1/32 label 02
 ip address 89.A.B.2/32 label 01
```

Signed-off-by: Donatas Abraitis <[email protected]>
Copy link
Contributor

@idryzhov idryzhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only makes the configuration output non-deterministic, but doesn't actually ensure the order of command execution when reading the config.

The order of execution is determined by libyang and doesn't necessarily correspond to the order in which addresses are set in the config. I'm not sure how libyang orders the lists, but the order is definitely not guaranteed and can change even between minor releases. This also won't work when working through the API.

If we want to ensure the order, then we must make the list ordered-by user in our YANG model and implement it correctly on the daemon's side. I won't recommend doing that though, because it doesn't make any sense if addresses are from different subnets, which is a majority of cases.

@ton31337
Copy link
Member Author

ton31337 commented Mar 6, 2024

Yes, I tried ordered-by user in YANG, but it needs more attention (something is not finished/implemented yet).

@ton31337 ton31337 closed this Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants