<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hello</div><div><br></div>I think it will be routed, I tied ping 169.254.x.x container to container, and it's successed.<br>And, I created the systemd-nspawn container after 5 minus ago, the container's host0 network auto turns ip on 169.254.x.x rather than 10.0.0.x .<br><div style="position:relative;zoom:1"><br><div>------</div><div><span style="line-height: 15.8667px;">Yours Sincerely</span></div><div>Han</div><div style="clear:both"></div></div><div id="divNeteaseMailCard"></div><br>At 2016-02-29 15:40:10, "Kai Krakow" <hurikhan77@gmail.com> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div dir="ltr">Hello!<div><br></div><div>This is link local IP. You can see it like <a href="http://127.0.0.0/8">127.0.0.0/8</a> but for the whole network segment: it won't be route thus it never leaves the bridge. I think you can safely ignore it tho I also think there is a way to deactivate assigning such addresses in networkd. AFAIK it's called APIPA.</div><div><br></div><div>Regards,</div><div>Kai</div></div><br><div class="gmail_quote"><div dir="ltr">kennedy <<a href="mailto:kennedyhan@163.com">kennedyhan@163.com</a>> schrieb am Mo., 29. Feb. 2016 um 07:43 Uhr:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Thanks! it works!</div><div>but I had a little question.</div><div>In my container, I run `route -n` it show me 3 result ,they are:</div><br><div>Kernel IP routing table</div><div>Destination Gateway Genmask Flags Metric Ref Use Iface</div><div>0.0.0.0 0.0.0.0 0.0.0.0 U 2048 0 0 host0</div><div>10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 host0</div><div>169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 host0</div><div><br></div><div>What's the "169.254.0.0" comes from ? I'v never configured that.</div><div><br></div><div>and when I add the "--network-veth" option on systemd-nspawn, the "169.254.0.0" it's disappeared.</div><div><br></div><div style="zoom:1"><div>------</div><div><span style="line-height:15.8667px">Yours Sincerely</span></div><div>Han</div><div style="clear:both"></div></div><div></div><br><pre><br>At 2016-02-29 00:26:54, "Kai Krakow" <<a href="mailto:hurikhan77@gmail.com" target="_blank">hurikhan77@gmail.com</a>> wrote:
>Am Sun, 28 Feb 2016 23:41:22 +0800 (CST)
>schrieb kennedy <<a href="mailto:kennedyhan@163.com" target="_blank">kennedyhan@163.com</a>>:
>
>> how to ping container to container each other in systemd-nspawn ?
>> I've tried --network-veth option but it doesn't work enough.
>
>You need to join all host-side veth interfaces into the same bridge.
>Make two files for systemd-networkd:
>
># 99-bridge-cn.netdev
>[NetDev]
>Name=br-containers
>Kind=bridge
>[Match]
>Name=br-containers
>
># 99-bridge-cn.network
>[Network]
>Address=<a href="http://10.0.0.1/24" target="_blank">10.0.0.1/24</a>
>DHCPServer=yes
>IPForward=yes
>IPMasquerade=yes
>
>Then "systemctl --edit systemd-nspawn@.service" to contain the
>following:
>
>############
>[Service]
>ExecStart=
>ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --boot \
>--link-journal=try-guest --private-network \
>--network-bridge=br-containers --machine=%I
>############
>
>This will add all your container veth devices to the same bridge which
>you configured in systemd-networkd. You should now be able to ping each
>other.
>
>You may need to adjust a few more settings for your needs. I'd
>recommend to add nss-mymachines (see man page).
>
>
>--
>Regards,
>Kai
>
>Replies to list-only preferred.
>
>_______________________________________________
>systemd-devel mailing list
><a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a>
><a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a>
</pre></div></blockquote></div>
</blockquote></div>