Adam Weremczuk's picture


I'm new to Turnkey and giving LXC host a try.
I'm trying to set up networking in the same manner it's set up on another Debian Wheezy host with LXC.
So I've replaced the default /etc/network/interfaces with the following:

auto lo
iface lo inet loopback

auto bond0
iface bond0 inet manual
    bond_slaves eth0 eth1
    bond_mode 802.3ad
    bond_xmit_hash_policy layer3+4
    bond_miimon 100
    bond_updelay 3000
    bond_downdelay 200
    # Workaround for Debian bug #697357
    pre-up ip link set eth0 promisc on
    pre-up ip link set eth1 promisc on
    post-down ip link set eth0 promisc off
    post-down ip link set eth1 promisc off

# Bridge interfaces for containers

auto br0_lxctest
iface br0_lxctest inet static
    bridge_ports bond0
    bridge_fd 0
    bridge_waitport 0
    bridge_maxwait 0
    bridge_stp off

Bond on the switch is set up using LAG/LACP.
Member links report as up but the LAG bond as down.

Interface br0_lxctest comes up as UP and RUNNING and with the right IP but I'm unable to ping the gateway with "Destination Host Unreachable".

I can't see much in logs, only:

Sep 26 09:42:34 lxc networking[1533]: Configuring network interfaces...
Sep 26 09:42:34 lxc networking[1533]: Waiting for a max of 0 seconds for bond0 to become available.
Sep 26 09:42:35 lxc networking[1533]: interface bond0 does not exist!

I'm also attaching a screenshot of the configuration console error apearing after a reboot.

What's wrong with my config?
Is the installation simply missing ifenslave package?


Adam Weremczuk's picture

Some progress made after installing ifenslave_2.6_all.deb from a USB stick and assigning static address to bond0.

I'm now able to ping both bond0 and  br0_lxctest but not the gateway.

Getting the following /var/log/messages:

Sep 26 15:17:32 lxc kernel: [   11.143092] device eth0 entered promiscuous mode
Sep 26 15:17:32 lxc kernel: [   11.144479] device eth1 entered promiscuous mode
Sep 26 15:17:32 lxc kernel: [   11.169931] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Sep 26 15:17:32 lxc kernel: [   11.173229] bonding: bond0: Setting MII monitoring interval to 100
Sep 26 15:17:32 lxc kernel: [   11.173270] bonding: bond0: Setting down delay to 200
Sep 26 15:17:32 lxc kernel: [   11.173301] bonding: bond0: Setting up delay to 200
Sep 26 15:17:32 lxc kernel: [   11.192219] bonding: bond0: Adding slave eth0
Sep 26 15:17:32 lxc kernel: [   11.192299] bnx2 0000:0b:00.0: Direct firmware load failed with error -2
Sep 26 15:17:32 lxc kernel: [   11.192301] bnx2 0000:0b:00.0: Falling back to user helper
Sep 26 15:17:32 lxc kernel: [   11.195398] bonding: bond0: Adding slave eth1
Sep 26 15:17:32 lxc kernel: [   11.195464] bnx2 0000:0b:00.1: Direct firmware load failed with error -2
Sep 26 15:17:32 lxc kernel: [   11.195466] bnx2 0000:0b:00.1: Falling back to user helper
Sep 26 15:17:32 lxc kernel: [   11.199552] IPv6: ADDRCONF(NETDEV_UP): bond0: link is not ready
Sep 26 15:17:32 lxc kernel: [   11.380018] Bridge firewalling registered
Sep 26 15:17:32 lxc kernel: [   11.454390] device bond0 entered promiscuous mode
Sep 26 15:17:32 lxc kernel: [   11.458050] IPv6: ADDRCONF(NETDEV_UP): br0_lxctest: link is not ready
Sep 26 15:17:33 lxc rsyslogd-2007: action 'action 17' suspended, next retry is Wed Sep 26 15:18:03 2018 [try ]
Sep 26 15:25:35 lxc kernel: [  497.370086] usb 2-6: new high-speed USB device number 4 using ehci-pci

Do I have a problem with the NIC driver?

Jeremy Davis's picture

TBH, you're already way ahead of me on this stuff. Networking config is not really my strong suit. I use the TurnKey LXC containers all the time, but not actually via the TurnKey LXC host appliance (I use Proxmox) so I don't have a ton of experience with our LXC host appliance unfortunately.

The main maintainer/developer of our LXC appliance is a long time TurnKey community member John Carver (aka Dude4Linux). He's still quite involved in development, but in more recent times he's not as active as he has been. Other than testing and involvement in code review, I personally don't have a ton of experience with the TurnKey LXC appliance, nor the sort of networking setup that you are trying to achieve. So unfortunately, I'm not sure how much help I'm going to be.

Having said that, in a more general sense, I know TurnKey very intimately. I can tell you that the current latest release of TurnKey v14.2 LXC appliance is based on Debian Jessie and beyond our pre-configuration, custom packages and helper scripts, is still more-or-less Debian (binary compatible). Anything possible in Debian Jessie, should also be possible in TurnKey v14.2. Whilst I may not be able to provide direct assistance with your concerns/questions, I can clarify what bits are TurnKey specific and what is just vanilla Debian.

FWIW you can see the appliance build code on GitHub. Note though, that that is the development code for our upcoming v15.0 release (based on Debian Stretch), the v14.2 code is visible via the v14.2 tag.

Whilst on face value, it may seem a little dense, to anyone who knows much about Linux in general (and Debian in particular), actually the build code is pretty straight forward. Essentially all our appliances are based on Core and using the v14.2 LXC appliance code as an example; on top of that (as a OS chroot), any packages noted in the plan are pre-installed. Then files included in the overlay are overlayed over the chroot filesystem; relative to / of the installed OS. E.g. overlay/etc/some.conf would end up as /etc/some.conf. Then finally the configuration scripts in conf.d (LXC only has one; conf.d/main) are run within the OS chroot. The last step is to bundle it all up as an ISO. As a bit of an aside, the other builds are then generated from the ISO via buildtasks (to maintain consistency as much as possible).

So if you're interested in testing out the v15.0 code and are perhaps even keen to contribute, then your timing is impeccable! :) I do hope to publish the v15.0 appliance this week or next, but even if you can't get a pull request to me in the next few days, I'd still be more than happy to consider adjustments/improvements for v15.1.

If you want to go down that path, then you'll need to build v15.0 LXC appliance yourself locally. To do that, for starters you'll need a v15.0 TKLDev. There is a tutorial in the docs that should assist to get you going.

Any questions, thoughts, ideas, suggestions etc are all warmly welcomed!

Adam Weremczuk's picture

Hi Jeremy,

What I'm trying to achieve is a HA solution based on 2 identical hosts.
I'm currently looking into Proxmox hypervisors and importing Turnkey pre-baked containers.
What I have in mind is application level sync (LDAP, Samba AD, MySQL replication etc.) and independent storage sync using something similar to:

I'm also familiarising myself with Proxmox VE 5.2 documentation to see what it has to offer natively in the HA department.
I'm open to any suggestions and advice :)


Jeremy Davis's picture

Again, that's all out of my experience, but I' m almost certain that Proxmox could do that for you. IIRC it has native HA features, including DRBD support OOTB. Although I've never actually used any of it so not 100%.

Having said that, if you end up getting any of that going on TurnKey (e.g. without Proxmox) then that would be super cool and I'd love to hear about it. If you get stuck with any of the TurnKey bits, please feel free to ask and I'll do my best to help out.

Regardless, I'd love to hear how it all goes. Good luck with it.

Add new comment