{"id":571,"date":"2015-11-29T21:19:30","date_gmt":"2015-11-29T21:19:30","guid":{"rendered":"http:\/\/blogs.gentoo.org\/lu_zero\/?p=571"},"modified":"2015-11-29T21:19:30","modified_gmt":"2015-11-29T21:19:30","slug":"lxc-ipv6-and-iproute2","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/lu_zero\/2015\/11\/29\/lxc-ipv6-and-iproute2\/","title":{"rendered":"lxc, ipv6 and iproute2"},"content":{"rendered":"<p>Not so recently I got a <a href=\"http:\/\/soyoustart.com\">soyoustart<\/a> system since it is provided with an option to install <a href=\"http:\/\/gentoo.org\">Gentoo<\/a> out of box.<\/p>\n<p>The machine comes with a single <strong>ipv4<\/strong> and a <em>\/64<\/em> amount of <strong>ipv6<\/strong> addresses.<\/p>\n<h2>LXC<\/h2>\n<p>I want to use the box to host some of my <a href=\"http:\/\/flask.pocoo.org\">flask<\/a> applications (<a href=\"http:\/\/github.com\/lu-zero\/plaid\">plaid<\/a> mainly), keep some continuous integration instances for <a href=\"http:\/\/libav.org\">libav<\/a> and some other experiments with compilers and libraries (such as <a href=\"http:\/\/www.musl-libc.org\/\">musl<\/a>, <a href=\"https:\/\/github.com\/MatzeB\/cparser\">cparser<\/a> other).<\/p>\n<p>Since <a href=\"http:\/\/blog.flameeyes.eu\/\">Diego<\/a> was telling me about lxc I picked it. It is simple, requires not much effort and in Gentoo we have at least some <a href=\"https:\/\/wiki.gentoo.org\/wiki\/LXC\">documentation<\/a>.<\/p>\n<h2>Setting up<\/h2>\n<p>I followed the documentation provided and it worked quite well up to a point. The <strong>btrfs<\/strong> integration works as explained, creating new Gentoo instances just worked, setting up the network&#8230; Required some effort.<\/p>\n<h2>Network woes<\/h2>\n<p>I have just 1 single <strong>ipv4<\/strong> and some <strong>ipv6<\/strong> so why not leveraging them? I decided to partition my <strong>\/64<\/strong> and use some, configured the bridge to take <code>::::1::1<\/code> and set up the container configuration like this:<\/p>\n<pre><code>lxc.network.type = veth\nlxc.network.link = br0\nlxc.network.flags = up\nlxc.network.ipv4 = 192.168.1.4\/16\nlxc.network.ipv4.gateway = auto\nlxc.network.ipv6 = ::::1::4\/80\nlxc.network.ipv6.gateway = auto\nlxc.network.hwaddr = 02:00:ee:cb:8a:04\n<\/code><\/pre>\n<p>But the route to my container wasn&#8217;t advertised.<\/p>\n<p>Having no idea why I just kept poking around <strong>sysctl<\/strong> and <strong>iproute2<\/strong> until I got:<\/p>\n<ul>\n<li>sysctl.conf:<\/li>\n<\/ul>\n<pre><code>  net.ipv6.conf.all.forwarding = 1\n  net.ipv6.conf.eth0.proxy_ndp = 1\n<\/code><\/pre>\n<p>And<\/p>\n<pre><code>ip -6 neigh add proxy ::::1::4 dev eth0\n<\/code><\/pre>\n<p>In my container runner script.<\/p>\n<p>I know that at least other people had the problem so here this mini-post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Not so recently I got a soyoustart system since it is provided with an option to install Gentoo out of box. The machine comes with a single ipv4 and a \/64 amount of ipv6 addresses. LXC I want to use the box to host some of my flask applications (plaid mainly), keep some continuous integration &hellip; <a href=\"https:\/\/blogs.gentoo.org\/lu_zero\/2015\/11\/29\/lxc-ipv6-and-iproute2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">lxc, ipv6 and iproute2<\/span><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1aGWH-9d","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/571"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/comments?post=571"}],"version-history":[{"count":1,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/571\/revisions"}],"predecessor-version":[{"id":572,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/571\/revisions\/572"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/media?parent=571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/categories?post=571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/tags?post=571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}