<div dir="ltr"><div><div>hi it's me again ;-),<br><br></div>with options <i>network-bridge</i> or <i>network-veth</i>, you « need » to configure network host card <i>ve-container@if2</i> and network container card <i>host0@if5</i>..<br><br>with my request, <span id="result_box" class="" lang="en"><span class="">the idea would be</span><span class=""> to not disconnect</span> <span class="">the loopback device and so, without network configuration, the container could simply </span></span><span id="result_box" class="" lang="en"><span class="">expose</span> <span class="">network services</span> throught the host...<br></span><br><span id="result_box" class="" lang="en"><span class=""><span id="result_box" class="" lang="en"><span class="">instead of</span></span></span><span class=""></span> <span class="">the option <i>port</i></span> <span class="">to run</span> <span class="">with the option <i>private-network</i></span><span>, this could be</span> <span class="">a new option (lo-network) that</span> <span class="">doesn't</span> <span class="">totally</span> <span class="">disconnect</span> <span class="">the network</span> <span class="">of the two systems, but leaves only loopback device...<br><br></span></span></div><span id="result_box" class="" lang="en"><span class="">regards, lacsaP.</span></span><span class=""><code class=""></code></span><div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">2016-01-25 18:39 GMT+01:00 Pascal <span dir="ltr"><<a href="mailto:patatetom@gmail.com" target="_blank">patatetom@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div>hi again,<br><br></div>some calrification : I'm on archlinux and systemd version is<br>systemd 228<br>+PAM -AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN<br><br></div>the systemd-nspawn <a href="http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html" target="_blank">documentation</a> says<br><i>-p, --port=<br> If <u>private networking is enabled</u>, maps an IP port on the host onto an IP port on the container. Takes a protocol specifier (either "tcp" or "udp"), separated by a colon from a host port number in the range 1 to 65535, separated by a colon from a container port number in the range from 1 to 65535. The protocol specifier and its separating colon may be omitted, in which case "tcp" is assumed. The container port number and its colon may be omitted, in which case the same port as the host port is implied. <u>This option is only supported if private networking is used</u></i>, such as with --network-veth or --network-bridge=.<br><br></div>with <span lang="en"><span>"systemd-nspawn -b -D my_container --private-network --port 1234", <u>private networking is enabled</u> and </span></span><br><span lang="en"><span>we could imagine that</span> <span>the</span> <span>port</span> <span>association is</span> <span>done on</span> <span>the loopback interface, no ?<br></span></span><br><span lang="en"><span>it would be good</span> <span>for isolating</span> <span>container</span> <span>without</span> <span>having to set a network configuration (</span></span><span lang="en"><span>bridge or other)...<br><br></span></span></div><span lang="en"><span>for example, in my container, I've redis and nodebb, with redis listening on <a href="http://127.0.0.1:6379" target="_blank">127.0.0.1:6379</a> and nodebb on </span></span><span lang="en"><span><span lang="en"><span>127.0.0.1</span></span>:4567, and, on my host, nginx which listening on <a href="http://0.0.0.0:80" target="_blank">0.0.0.0:80</a> and act as reverse proxy for nodebb : with </span></span><span lang="en"><span>"systemd-nspawn -b -D nodebb --private-network --port 4567" and without other network setting, I could access nodebb just with "proxy_pass <a href="http://127.0.0.1:4567" target="_blank">http://127.0.0.1:4567</a>;" in nginx.<br><br></span></span></div><span lang="en"><span>regards, lacsaP.<br></span></span><div><div class="h5"><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-25 0:10 GMT+01:00 Pascal <span dir="ltr"><<a href="mailto:patatetom@gmail.com" target="_blank">patatetom@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>hi,<br><br><span lang="en"><span>I'm</span> <span>discovering</span> <span>and </span><span>playing</span> <span>with systemd-nspawn </span></span><span lang="en"><span>and I</span> <span>must say it</span><span>'s pretty cool !<br></span></span><span lang="en"><span><br>I have a question</span> <span>about the</span> <span>--port</span> <span>option : </span></span><span lang="en"><span>why it does</span><span>n't</span> <span>work</span> <span>on the loopback</span> <span>with</span> <span>--private</span><span>-network</span> <span>option ?<br><br></span></span></div><span lang="en"><span>eg "systemd-nspawn -b -D my_container --private-network --port 1234" doesn't connect the port 1234 of the loopback host with the port 1234 of the loopback container.<br><br></span></span></div><span lang="en"><span>regards, lacsaP.<br></span></span></div>
</blockquote></div><br></div></div></div></div></div></div>
</blockquote></div><br></div></div></div>