我正在使用命名空间来分隔服务器上的一些物理接口。路由工作得非常完美。 另外,我在/etc/netns/中为每个命名空间设置了一个文件夹,例如/etc/netns/namespaceA/resolv.conf,这样DNS也可以正常工作。
当使用dhclient进行DHCP时出现问题。 我正在从命名空间内运行dhclient,并收到此错误。
(namespaceA)root@tc-vm:~#dhclient
RTNETLINK answers: File exists
mv: cannot move '/etc/resolv.conf.dhclient-new.2740' to '/etc/resolv.conf': Device or resource busy
我发现 /etc/resolvconf/update.d/libc 中的 mv 命令可能会引起问题。
如何使 dhclient 具备命名空间感知能力?