Skip to main content

Module network_device

Module network_device 

Source

Functions§

dev_change_net_namespace
dev_change_netns allows to move a device given by name to a network namespace given by netns_fd and optionally change the device name. The device name will be kept the same if device.Name is None or an empty string. This function ensures that the move and rename operations occur atomically. It preserves existing interface attributes, including IP addresses.
resolve_device_name
Resolves the final name for a network device. If the device has a configured name (non-empty), use it; otherwise use the original name.
setup_addresses_in_network_namespace
Core logic for setting up addresses in the new network namespace This function is extracted to make it testable without system calls