LXC secondary NIC

SamTzu

Renowned Member
I have a weird problem with LXC containers. I can't seem to get up the secondary VM NIC IP's with out restarting networking inside the container. Any ideas? Everything seems to be ok but the secondary IP's never "take hold" without /etc/init.d/networking restart inside the VM.
 
I'm running Ubuntu 16 LXC container with 2 NIC's. One on public net and one on the private net with 192.168.14.z address. Both NIC's have static IP's but only the public one comes up after VM is started. I have to manually go in the VM and restart the networking before the second IP comes UP.

Before...
Code:
44: eth1@if45: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 8a:33:50:52:97:9c brd ff:ff:ff:ff:ff:ff link-netnsid 0
After...
Code:
44: eth1@if45: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 8a:33:50:52:97:9c brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.14.14/24 brd 192.168.14.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::8833:50ff:fe52:979c/64 scope link
       valid_lft forever preferred_lft forever
 
Last edited:
I don't have that issue on my containers that have two NICs, but all of my containers that have two NICs are mostly CentOS with some Debian (my Ubuntu ones only have one NIC). I have two tables in /etc/iproute2/rt_tables (one for each interface) with pre-up commands for routes and rules on each interface. Both interfaces come up but sometimes the service on that container fails. My CentOS container that hosts HAProxy will start successfully on boot about 50% of the time; my CentOS container for nginx will start successfully 0%. Once I go in and "systemctl restart <service>" then everything is good to go.
 
Today we lost secondary interface all by it self while VM was running normally. /etc/networking/interfaces restart fixed the problem but this is getting kind of silly. Any ideas what could be causing these?

The primary public Interface always works.
 
Issue in my case was the eth0 ipv6 being set to DHCP, which I don't have set up. eth0 ipv4 was starting, then it was timing out on ipv6, never moving on to bringing eth1 up. Disabled ipv6, et voila.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!