path: root/doc/forum/Using_ip_address_in_a_container
diff options
authorNicolas.Schodet2017-10-05 20:10:10 +0000
committeradmin2017-10-05 20:10:10 +0000
commitebbc89615830eb0839607b00aba5c306d8cb1bd1 (patch)
tree5a58221d4ad385415d8cb23d39295e59fafc80b3 /doc/forum/Using_ip_address_in_a_container
parent5c36da0cc2c383dbf0b723eb8ce55968db661e2b (diff)
Added a comment: systemd-nspawn with its own network in the container
Diffstat (limited to 'doc/forum/Using_ip_address_in_a_container')
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=""
+ 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
+ auto br0
+ iface br0 inet static
+ address
+ netmask
+ 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.