LXC不能从DHCP获取IP

我试图给lxc分配一个IP,这样它就可以在networking上的其他机器上看到。 主机:〜$ / etc / network / interfaces

auto lo iface lo inet loopback auto enp4s0 iface enp4s0 inet manual auto br0 iface br0 inet dhcp bridge_ports enp4s0 bridge_stp off bridge_fd 0 bridge_maxwait 0 

主机:〜$ cat .local / share / lxc / elastic / config

 lxc.include = /usr/share/lxc/config/ubuntu.common.conf lxc.include = /usr/share/lxc/config/ubuntu.userns.conf lxc.arch = x86_64 # Container specific configuration lxc.id_map = u 0 100000 65536 lxc.id_map = g 0 100000 65536 # Network configuration lxc.network.type = veth lxc.network.flags = up lxc.network.link = br0 lxc.network.name = eth0 lxc.network.mtu = 1500 lxc.network.hwaddr = 00:16:3e:c9:7a:92 lxc.rootfs = /home/nitigyasharma/.local/share/lxc/elastic/rootfs lxc.rootfs.backend = dir lxc.utsname = elastic 

host-machine:〜$ cat .local / share / lxc / elastic / rootfs / etc / network / interfaces

 auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp 

我的networking接口是

 2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000 link/ether c8:5b:76:fa:6d:93 brd ff:ff:ff:ff:ff:ff inet 10.1.5.214/16 brd 10.1.255.255 scope global dynamic enp4s0 valid_lft 3569sec preferred_lft 3569sec inet 10.1.6.11/16 brd 10.1.255.255 scope global secondary enp4s0 valid_lft forever preferred_lft forever 3: wlp5s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 3c:95:09:43:7e:c7 brd ff:ff:ff:ff:ff:ff 25: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether c8:5b:76:fa:6d:93 brd ff:ff:ff:ff:ff:ff inet 10.1.6.11/16 brd 10.1.255.255 scope global br0 valid_lft forever preferred_lft forever inet6 fe80::ca5b:76ff:fefa:6d93/64 scope link valid_lft forever preferred_lft forever 

但是我无法从主机ping 10.1.0.1,而lxc根本就没有得到networkingIP

路线

 Destination Gateway Genmask Flags Metric Ref Use Iface default 10.1.0.1 0.0.0.0 UG 0 0 0 br0 10.1.0.0 * 255.255.0.0 U 0 0 0 enp4s0 10.1.0.0 * 255.255.0.0 U 0 0 0 br0 

输出lxc-info

 host-machine-:~$ lxc-info -n elastic Name: elastic State: RUNNING PID: 3772 Memory use: 31.73 MiB KMem use: 0 bytes Link: veth1VQMEE TX bytes: 1.63 KiB RX bytes: 4.76 KiB Total bytes: 6.40 KiB