{"id":3842,"date":"2015-10-03T16:37:57","date_gmt":"2015-10-03T16:37:57","guid":{"rendered":"http:\/\/really.zonky.org\/?p=3842"},"modified":"2019-06-05T19:40:30","modified_gmt":"2019-06-05T19:40:30","slug":"linux-containers-dont-configure-the-container-network","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=3842","title":{"rendered":"Linux Containers: Don&#8217;t Configure The Container Network"},"content":{"rendered":"<p><em>More up to date information can be found <a href=\"https:\/\/really.zonky.org\/?p=5553\">here<\/a>.<\/em><\/p>\n<p>One thing that has always puzzled me about Linux Containers was why it is necessary to configure the network address in two places &#8211; the container configuration, and the operating system configuration. The short answer is that it isn&#8217;t.<\/p>\n<p>If you configure network addresses statically within the container configuration :-<\/p>\n<pre>\u00bb grep net \/var\/lib\/lxc\/mango\/config\u00a0\n# networking\nlxc.network.type = veth\nlxc.network.flags = up\nlxc.network.link = br0\nlxc.network.ipv4 = 10.0.0.35\/16\nlxc.network.ipv4.gateway = 10.0.0.1\nlxc.network.ipv6 = \u00a0 \u00a0 \u00a0 \u00a0 2001:0db8:ca2c:dead:0000:0000:0000:000a\/64\nlxc.network.ipv6.gateway = 2001:0db8:ca2c:dead:0000:0000:0000:0001\n<\/pre>\n<p>Then the configuration within the container&#8217;s operating system can simply be :-<\/p>\n<pre>\u00bb cat \/var\/lib\/lxc\/mango\/rootfs\/etc\/network\/interfaces\nauto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet manual\niface eth0 inet6 manual\n<\/pre>\n<p>And that works fine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>More up to date information can be found here. One thing that has always puzzled me about Linux Containers was why it is necessary to configure the network address in two places &#8211; the container configuration, and the operating system configuration. The short answer is that it isn&#8217;t. If you configure network addresses statically within <a href='https:\/\/really.zonky.org\/?p=3842' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[4,209,226],"tags":[163,1017,918],"class_list":["post-3842","post","type-post","status-publish","format-standard","hentry","category-it","category-linux-it","category-working-notes","tag-containers","tag-debian","tag-lxc","category-4-id","category-209-id","category-226-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-ZY","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/3842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3842"}],"version-history":[{"count":2,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/3842\/revisions"}],"predecessor-version":[{"id":5557,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/3842\/revisions\/5557"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}