Network Namespace Implementation#1805
Conversation
Add support for Target to be used in a `with` statement. When the statement exits, the target will automatically cleanup Signed-off-by: Joshua Watt <Joshua.Watt@garmin.com>
Add support for network namespaces that can be used to give a client access to a NetworkInterface on an exporter. The data is streamed over SSH between a tap in the netns on the client and a macvtap on the exporter. An agent process is used to initialize the user and network namespaces and to keep them open for further operations. This is not optimised for high throughput or low latency, but for flexibility and ease-of-use. For cases where performance is more important, this could be extended to support a macvlan interface in a network namespace on the exporter. The approach is still a bit experimental, so we might need to change things in incompatible ways. Co-developed-by: Joshua Watt <Joshua.Watt@garmin.com> Co-developed-by: Rouven Czerwinski <rouven.czerwinski@linaro.org> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This makes it easy to enter a netns from multiple shells. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
|
@JPEWdev As discussed via matrix, I've squashed our commits. I've squashed some minor fixes and doc updates as well. Support for socks5 is still as separate commits. The tests fail because autodoc can't import the netns agent (due to the missing s2py globals in Also, the netns tests are currently skipped in CI, as we seem to be missing privileges for the mount namespace. Perhaps we can adjust the workflow configuration to allow that. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1805 +/- ##
========================================
- Coverage 46.7% 45.8% -1.0%
========================================
Files 179 182 +3
Lines 14198 14718 +520
========================================
+ Hits 6635 6743 +108
- Misses 7563 7975 +412
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Probably just inline them instead of share them. I'll take a look
|
Using the definition from the agent module breaks documentation building. Since these functions aren't very complicated, move them into the module. Signed-off-by: Joshua Watt <Joshua.Watt@garmin.com>
Unprivledged user namespaces are required for the netns tests to run Signed-off-by: Joshua Watt <Joshua.Watt@garmin.com>
Removes creating a separate mount namespace with the network namespace. The mount namespace is not technically required to use the networking portion of the namespace, and it can fail depending on the mount propagation settings of the system, which would require system administration to fix. Signed-off-by: Joshua Watt <Joshua.Watt@garmin.com>
Updates the man pages for the new wrapper script Signed-off-by: Joshua Watt <Joshua.Watt@garmin.com>
|
@jluebbe Ok, it's working now. FYI, the reason for the unshare failure was two fold:
|
|
Thanks! The sysfs mount was needed to find the tap interface name in the namespace so that it could be opened. As we no longer need that, don't need to mount sysfs in the namespace. |
Description
Adds support for network namespaces that can be used to give a client access to a
NetworkInterfaceon an exporter. The data is streamed between a tap on client and exporter over SSHChecklist