feat: add support for address priority#256
Merged
jsimonetti merged 1 commit intojsimonetti:masterfrom Apr 15, 2025
Merged
Conversation
This allows to set route priority/metric for prefix routes created automatically when an address is assigned. E.g. `10.0.0.0/8` with metric `32` would generate a route: ``` 10.0.0.0/8 via <if> metric 32 ``` The default metric is zero. A custom metric allows to prefer one interface over another when the prefixes overlap. See siderolabs/talos#10696 Signed-off-by: Andrey Smirnov <[email protected]>
Contributor
Author
|
The failures don't seem to be related to my changes:
|
Owner
|
Thank you for this. |
smira
added a commit
to smira/talos
that referenced
this pull request
Apr 15, 2025
See jsimonetti/rtnetlink#256 See siderolabs#10696 Support setting address priority, this is important to ensure that the prefix route has appropriate priority. For now, we don't have it exposed in the machine config except for the DHCP4 operator, so now both routes created explicitly by DHCP and routes created implicitly have same metric/priority: ``` 172.20.0.2 network RouteStatus inet4//172.20.0.0/24/1024 1 172.20.0.0/24 enp0s2 1024 172.20.0.2 network RouteStatus inet4/172.20.0.1//1024 1 172.20.0.1 enp0s2 1024 ``` Before this change, the first route would have a metric zero. Signed-off-by: Andrey Smirnov <[email protected]>
smira
added a commit
to smira/talos
that referenced
this pull request
Apr 16, 2025
See jsimonetti/rtnetlink#256 See siderolabs#10696 Support setting address priority, this is important to ensure that the prefix route has appropriate priority. For now, we don't have it exposed in the machine config except for the DHCP4 operator, so now both routes created explicitly by DHCP and routes created implicitly have same metric/priority: ``` 172.20.0.2 network RouteStatus inet4//172.20.0.0/24/1024 1 172.20.0.0/24 enp0s2 1024 172.20.0.2 network RouteStatus inet4/172.20.0.1//1024 1 172.20.0.1 enp0s2 1024 ``` Before this change, the first route would have a metric zero. Signed-off-by: Andrey Smirnov <[email protected]>
smira
added a commit
to smira/talos
that referenced
this pull request
Apr 22, 2025
See jsimonetti/rtnetlink#256 See siderolabs#10696 Support setting address priority, this is important to ensure that the prefix route has appropriate priority. For now, we don't have it exposed in the machine config except for the DHCP4 operator, so now both routes created explicitly by DHCP and routes created implicitly have same metric/priority: ``` 172.20.0.2 network RouteStatus inet4//172.20.0.0/24/1024 1 172.20.0.0/24 enp0s2 1024 172.20.0.2 network RouteStatus inet4/172.20.0.1//1024 1 172.20.0.1 enp0s2 1024 ``` Before this change, the first route would have a metric zero. Signed-off-by: Andrey Smirnov <[email protected]> (cherry picked from commit f0ea478)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows to set route priority/metric for prefix routes created automatically when an address is assigned.
E.g.
10.0.0.0/8with metric32would generate a route:The default metric is zero. A custom metric allows to prefer one interface over another when the prefixes overlap.
See siderolabs/talos#10696