-
Notifications
You must be signed in to change notification settings - Fork 802
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
sbr: Add rule for outbound interface when there is a single interface IP #1144
Open
neilcook
wants to merge
9
commits into
containernetworking:main
Choose a base branch
from
neilcook:oif_rule
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+37
−14
Conversation
This file contains 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
a435c72
to
6dfec7f
Compare
squeed
reviewed
Mar 3, 2025
Adding the outbound interface rule allows applications to bind to an interface name rather than only the interface IP. This allows applications in a multus environment to be configured with the interface name, which can be configured, rather than the interface IP address, which is not known in advance. The outbound interface rule is on;y added if the interface is configured with 1 IP address, because when there are multiple, only one will be selected, depending on the rule order, which is non-deterministic. Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
The outbound interface rule does not reference anything from ipCfg so should not be in the loop. Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
…able no is correct The previous commit moved the rule creation to after the ipCfg loop, but since the loop increments the table number, the rule gets added to the wrong table. Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
Moving the outbound interface rule creation to before the ipCfg loop means that tests need to reflect the changed order of rules. Signed-off-by: Neil Cook <neil.cook@noware.co.uk>
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.
When using the sbr plugin with a CNI plugin such as multus, applications have to bind to the source IP address of the interface for the str plugin to work correctly. They cannot bind to the interface name, because the sbr plugin doesn't currently add a rule for the interface name.
This is problematic because it is straightforward to configure the name of a multus interface, however the IP address is usually assigned from a range, so the exact interface IP address to use is not known in advance unlike the interface name. It would thus be much easier for applications if the sbr plugin added a rule with the interface name in addition to the rule with the interface address.
This PR does exactly that - adds an additional rule with the outbound interface name, so that applications can configure the name of the interface to bind to, rather than having to know the interface IP address.
Obviously, this approach does not work if there are multiple IP addresses for the interface, so this change only adds the rule for the outbound interface name if there is a single IP address on that interface.
I have added tests for the new rule, which all pass.