From 1321c1bd8fe921986c4eb39c3783ddd827b79543 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 30 Dec 2019 14:57:47 +0200 Subject: add basic support for jail network namespaces Prepare netifd for handling procd service jails having their own network namespace. Intefaces having the jail attribute will only be brought inside the jail's network namespace by procd calling the newly introduced ubus method 'netns_updown'. Currently proto 'static' is supported and configuration changes are not yet being handled (ie. you'll have to restart the jailed service for changes to take effect). Example /etc/config/network snippet: config device 'veth0' option type 'veth' option name 'vhost0' option peer_name 'virt0' config interface 'virt' option type 'bridge' list ifname 'vhost0' option proto 'static' option ipaddr '10.0.0.1' option netmask '255.255.255.0' config interface 'virt0' option ifname 'virt0' option proto 'static' option ipaddr '10.0.0.2' option netmask '255.255.255.0' option gateway '10.0.0.1' option dns '10.0.0.1' option jail 'transmission' Signed-off-by: Daniel Golle --- system.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'system.h') diff --git a/system.h b/system.h index 61c4046..fe4497e 100644 --- a/system.h +++ b/system.h @@ -243,4 +243,8 @@ void system_fd_set_cloexec(int fd); int system_update_ipv6_mtu(struct device *dev, int mtu); +int system_link_netns_move(const char *ifname, const pid_t target_ns); +int system_netns_open(const pid_t target_ns); +int system_netns_set(int netns_fd); + #endif -- cgit v1.2.1