[lxc-users] How to get rid of pesky extra dhcp IP

jjs - mainphrame jjs at mainphrame.com
Tue Apr 10 16:12:56 UTC 2018


Thanks Simos,

The host has a bridge, br0, but not an lxc-specific one
(USE_LXC_BRIDGE="false" in /etc/default/lxc-net)

The 192.168.111 range is from the pool on the local dhcp box. However, this
container is configured to use a static IP in /etc/network/interfaces:
--
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d

auto eth0
iface eth0 inet static
  address 192.168.111.44
  netmask 255.255.255.0
  gateway 192.168.111.1
  dns-nameservers 192.168.111.1
  dns-search mainphrame.net
--

I'm not seeing where a dhcp address is being requested for this container.
Is there some systemd magic going on behind the scenes?

Jake



On Mon, Apr 9, 2018 at 11:36 PM, Simos Xenitellis <
simos.lists at googlemail.com> wrote:

> These 192.168.111.x IP addresses are not LXD default private IP addresses.
> Have you configured a bridge or a macvlan?
>
> Simos
>
> On Sat, Apr 7, 2018 at 11:16 PM, jjs - mainphrame <jjs at mainphrame.com>
> wrote:
> > Greetings,
> >
> > Running lxd-3.0.0 on ubuntu 18.04 beta
> >
> > I've set up a couple of new 16.04 cts and they act as I expect.
> >
> > I set up an 18.04 ct and a persistent unwanted dhcp IP appears in the lxc
> > list:
> >
> > root at ronnie:~# lxc list
> > +-----------+---------+------------------------+------+-----
> -------+-----------+
> > |   NAME    |  STATE  |          IPV4          | IPV6 |    TYPE    |
> > SNAPSHOTS |
> > +-----------+---------+------------------------+------+-----
> -------+-----------+
> > | dbserv111 | RUNNING | 192.168.111.221 (eth0) |      | PERSISTENT | 0
> > |
> > +-----------+---------+------------------------+------+-----
> -------+-----------+
> > | kangal    | RUNNING | 192.168.111.44 (eth0)  |      | PERSISTENT | 0
> > |
> > |           |         | 192.168.111.239 (eth0) |      |            |
> > |
> > +-----------+---------+------------------------+------+-----
> -------+-----------+
> > | mg111     | RUNNING | 192.168.111.222 (eth0) |      | PERSISTENT | 0
> > |
> > +-----------+---------+------------------------+------+-----
> -------+-----------+
> >
> > However, inside the 18.04 container (kangal), only the static IP is
> listed:
> > root at kangal:~# ifconfig
> > eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
> >         inet 192.168.111.44  netmask 255.255.255.0  broadcast
> > 192.168.111.255
> >         inet6 fe80::216:3eff:fef3:857e  prefixlen 64  scopeid 0x20<link>
> >         ether 00:16:3e:f3:85:7e  txqueuelen 1000  (Ethernet)
> >         RX packets 80658  bytes 97973222 (97.9 MB)
> >         RX errors 0  dropped 0  overruns 0  frame 0
> >         TX packets 56964  bytes 5320056 (5.3 MB)
> >         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> >
> > lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
> >         inet 127.0.0.1  netmask 255.0.0.0
> >         inet6 ::1  prefixlen 128  scopeid 0x10<host>
> >         loop  txqueuelen 1000  (Local Loopback)
> >         RX packets 1400  bytes 115581 (115.5 KB)
> >         RX errors 0  dropped 0  overruns 0  frame 0
> >         TX packets 1400  bytes 115581 (115.5 KB)
> >         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> >
> > root at kangal:~#
> >
> > However I can ssh to this dhcp IP and gain access to the box.
> >
> > Any clues as to how to get rid of this unwanted extra IP?
> >
> > Jake
> >
> >
> > _______________________________________________
> > lxc-users mailing list
> > lxc-users at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-users
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180410/0152f2c2/attachment.html>


More information about the lxc-users mailing list