-
Notifications
You must be signed in to change notification settings - Fork 314
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
feat(nm): promiscuous mode configuration via snapshot #4957
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there @fdizazzo
thank you for your contribution and your patience. We're full in the release process of 5.4.0 and it's taking quite a lot of bandwidth.
Your contribution looks great but we have some concerns about setting the OSGi property as "required" without a default. Is this working on the old networking profiles?
Also, can you share the use case for the promiscuous mode?
private static void addPromiscDefinition(Tocd tocd, String ifaceName) { | ||
Tad tad = buildAttributeDefinition(String.format(PREFIX + "%s.config.promisc", ifaceName), | ||
NetworkConfigurationPropertyNames.CONFIG_PROMISC, Tscalar.INTEGER); | ||
tad.setRequired(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if it is not provided? There's no default provided either so I expect bad things to happen in the old networking 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be a .setRequired(false)
. The idea is the Kura should do nothing if the promisc parameter is not populated. And it's actually working fine with required fields being missing 🤔
Should we actually want it as required we can use -1
as the default value, as populated by NetworkManager on newly created connections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 @pierantoniomerlino thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, it is sufficient to add a default value (probably -1 is the right choice).
tad.setDefault("-1");
Sorry I didn't even noticed the feature freeze announcement until yesterday :)
I'm needing this to intercept layer 2 traffic not actually meant for the edge gateway so it can be wrapped in tcp packets |
Hello there @fdizazzo, sorry for taking so long. We were dealing with the long tail of tasks related to the release process. I'll now take a look into this and report back ASAP. Meanwhile, would you consider contributing also the UI part of this PR? Could be a separeted PR if you want. |
Tested working on RPi Bookworm (NetworkManager 1.42.4) Generic ARM64 profile. Taking the Raspberry Pi profile for a spin just to be on the safe side... |
Raspberry Pi 64 bit profile on RPi Bookworm looks ok. Merging as-is! Thanks @fdizazzo let me know what you think about the UI proposal and if you can take care of the documentation side of things :) |
This PR adds promiscuous mode support for ethernet interfaces.
This is achieved by adding a property
net.interface.<interfaceName>.config.promisc
with the possibile values:mapping the possibile values of NetworkManager
NMTernary
enumeration [1] which is then mapped to theaccept-all-mac-addresses
property of 802-3-ethernet settings map [2].This behaviour in only enabled when NetworkManager 1.32 or newer is installed [3].
The following snapshot snippet can be used for testing
and the modification can be checked from either nmcli
802-3-ethernet.accept-all-mac-addresses
property or ifconfigPROMISC
flag[1] https://networkmanager.dev/docs/api/latest/nm-dbus-types.html
[2] https://networkmanager.dev/docs/api/latest/nm-settings-dbus.html
[3] https://networkmanager.dev/blog/networkmanager-1-32/