linux-vserver / util-vserver

http://linux-vserver.org/
GNU General Public License v2.0
15 stars 14 forks source link

improve netns integration #25

Open ensc opened 8 years ago

ensc commented 8 years ago

Patchset allows to do create a netns enabled vserver without extra scripts.

Example:

/etc/vservers/.../
|- noncontext           # flag
|- netns/
|  |- ip4tables.rules
|  |- ip6tables.rules
|  `- interfaces/
|     `- 0/
|        |- host        # content: 'eth1'
|        `- type        # content: 'macvlan'
`- interfaces/
   |- dev               # content: 'geth0'
   |- 0/
      |- ip             # content: '192.168.12.77'
      |- gw             # content: '192.168.12.65'
      `- prefix         # content: '28'
# vserver mail-msa exec-netns ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
7: geth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/ether b6:16:fc:30:df:17 brd ff:ff:ff:ff:ff:ff