diff options
| author | Nicolas.Schodet <Nicolas.Schodet@web> | 2017-10-05 20:10:10 +0000 |
|---|---|---|
| committer | admin <admin@branchable.com> | 2017-10-05 20:10:10 +0000 |
| commit | ebbc89615830eb0839607b00aba5c306d8cb1bd1 (patch) | |
| tree | 5a58221d4ad385415d8cb23d39295e59fafc80b3 | |
| parent | 5c36da0cc2c383dbf0b723eb8ce55968db661e2b (diff) | |
Added a comment: systemd-nspawn with its own network in the container
| -rw-r--r-- | doc/forum/Using_ip_address_in_a_container/comment_2_520c00ed10ead57bc46940f98a2fae01._comment | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/forum/Using_ip_address_in_a_container/comment_2_520c00ed10ead57bc46940f98a2fae01._comment b/doc/forum/Using_ip_address_in_a_container/comment_2_520c00ed10ead57bc46940f98a2fae01._comment new file mode 100644 index 00000000..78b7563a --- /dev/null +++ b/doc/forum/Using_ip_address_in_a_container/comment_2_520c00ed10ead57bc46940f98a2fae01._comment @@ -0,0 +1,30 @@ +[[!comment format=mdwn + username="Nicolas.Schodet" + avatar="http://cdn.libravatar.org/avatar/0d7ec808ec329d04ee9a93c0da3c0089" + subject="systemd-nspawn with its own network in the container" + date="2017-10-05T20:10:10Z" + content=""" +If you use networkd, things are quite simple, you can use +`--network-zone=something` and it will create a bridge, add the host interface +to it and add an interface in the container. Default networkd configuration +will choose an IP network for the zone (it use the interface name to recognize +what must be done), use DHCP in the container, handle DHCP request on host and +route packets to the external interface. The bridge is automatically removed +when all containers are shut down. + +Without networkd, you can create a bridge on the host in +`/etc/network/interface`: + + auto br0 + iface br0 inet static + address 10.42.0.1 + netmask 255.255.0.0 + pre-up brctl addbr br0 + post-down brctl delbr br0 + bridge_fd 0 + +Then use the `--network-bridge=br0` option. It will add the host interface +automatically to the bridge and you need a way to configure the containers +interface, either using networkd or the traditional ifupdown. + +"""]] |
