[systemd-devel] Understanding DHCP, DNS and IPMasquerade
johannes.ernst at gmail.com
Fri Jun 12 17:32:44 PDT 2015
My host obtains an IP address and DNS server via DHCP from upstream via Ethernet like this (systemd 219, Arch Linux)
It has the resolv.conf symlink to /run/systemd/resolve/resolv.conf, and the DNS server from DHCP shows up there.
It also has this test.network file:
My host runs a container like this: (systemd 219, UBOS (just like Arch Linux))
systemd-nspawn -b -D test -n
The container does not have any networkd configuration. It has the resolv.conf symlink, and runs systemd-networkd
I was expecting:
* container gets an IP address from host in some new subnet: WORKS, e.g 10.0.0.2
* container can route to upstream via IPMasquerade: WORKS, after manual 'modprobe iptable_nat'
* container gets the DNS server from the host: FAILS: /etc/resolv.conf points to Google name servers instead (184.108.40.206 etc)
* host and container can ping test (if test is the name of the container machine per machinectl): FAILS, neither can
What am I misunderstanding or doing wrong? If somebody educates me, I’ll put the insights on a wiki somewhere (e.g. Arch)
More information about the systemd-devel