[systemd-devel] Container IP resolution by name inside another container

Jean-Sébastien Bour jean-sebastien at bour.name
Sun Mar 13 13:42:53 UTC 2016


Hello,

on a host running Fedora 23, with systemd 222, I set up two containers 
(Fedora 23 too) in /var/lib/machines with "dnf --installroot ..." ; the 
host and both containers have systemd-networkd and systemd-resolved 
enabled and started. Containers are started with "machinectl start 
name".

Container one gets 10.0.0.2 address with 10.0.0.1 gateway on ve-one 
interface on host ; container two gets 10.0.0.18 with 10.0.0.17 gateway.

I can ping the internet, wget web pages... from both containers ; from 
host I can "ping one" or "ping two" and nss-mymachines resolution (I 
guess) does its magic and it pings. From container one I can "ping one" 
and it pings itself.

However, if I "ping two" from container one, I get "unknown host two". 
It is not a network problem because I can "ping 10.0.0.18" (two's IP) 
from inside one and it works (it even works with a "nc -l 2626" on two 
and "nc 10.0.0.18 2626" on one, I can netcat-talk between them).

How can I have nss-mymachines (or whoever) resolve other containers' 
names from inside a container ?


More information about the systemd-devel mailing list