#651919 Support of network namespaces (netns)

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
Vincent Bernat
Date:
2017-11-25 04:15:03 UTC
Severity:
wishlist
#651919#5
Date:
2011-12-13 08:13:36 UTC
From:
To:
Hi!

iproute has now support for network namespaces. For example:

 # ip netns create ns1
 # ip link set eth1 netns ns1
 # ip netns exec ns1 ip addr add 192.168.1.1/24 dev eth1

It would be great if ifupdown had support for netns as well. It would need to:
 1. move the given interface into the appropriate namespace (like with "ip link")
 2. configure the interface as usual (but is now in another namespace)
 3. execute any up/down script into the appropriate namespace

Either we could rely on "ip netns" to do all that or do it ourselves
(but with compatibility with "ip netns") by issuing the appropriate
setns() call before handling the interface. As ifupdown uses ifconfig,
it seems easier to use the first approach. Each call could be wrapped
in "ip netns exec" when the "netns" keyword is present.

- -- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ifupdown depends on:
ii  libc6      2.13-22
ii  lsb-base   3.2-28
ii  net-tools  1.60-24.1

ifupdown recommends no packages.

Versions of packages ifupdown suggests:
ii  iproute          20111117-1
ii  isc-dhcp-client  4.1.1-P1-17
ii  ppp              2.4.5-5

- -- debconf information:
  ifupdown/convert-interfaces: true
iEYEARECAAYFAk7nCSwACgkQKFvXofIqeU4JXACgm/Wpi7ghY31q+dCiunZEHeHp
OzUAoLS0eQWSq3tt9IQ2FF/TRZSbfXwk
=TR1t
-----END PGP SIGNATURE-----

#651919#10
Date:
2011-12-13 08:18:34 UTC
From:
To:
Hello,

I will look at this a bit later --- I have much work to do now;
meanwhile, check the newest experimental version out; it uses iproute2
already, so if you provide any ideas or even patches it'd be great.

Thanks for you mail!

#651919#15
Date:
2011-12-13 08:22:41 UTC
From:
To:
OoO En cette matinée ensoleillée  du mardi 13 décembre 2011, vers 09:18,
Andrew Shadura <bugzilla@tut.by> disait :

I will try to provide you some patches.

#651919#20
Date:
2017-11-25 04:00:04 UTC
From:
To:
Hi,

What is the recommended way to use netns with ifupdown?

Benda