Can't ifup/ifdown alias addresses inside LXC container

Hi,

after the little problem I had in an OVH server with the default IP assignment way for LXC containers in latest Proxmox, they gave me a working temporary (I hope it's) solution, that basically is to only create the NIC from the Proxmox GUI, and configure the IP addresses from within the container. Sadly, that carries another problem with it (at least with an Ubuntu 14.04 container based in the default template downloaded from the GUI):

You can't ifdown/ifup alias interfaces. I'm specially worried about it because I have an address that have a routing problem (happens in OVH sometimes when moving between servers an IP with a vMAC assigned) and I can't "shut it down" without shutting down the whole container, that has 14 addresses..


I've tried to configure the IPs both ways (neither work):


Code:
auto lo eth0
iface lo inet loopback
iface eth0 inet static
        address MAIN_VM_IP
        netmask 255.255.255.255
        broadcast MAIN_VM_IP
        post-up route add FIRST_3_OCTECTS_OF_HOST_IP.254 dev eth0
        post-up route add default gw FIRST_3_OCTECTS_OF_HOST_IP.254
        pre-down route del FIRST_3_OCTECTS_OF_HOST_IP.254 dev eth0
        pre-down route del default gw FIRST_3_OCTECTS_OF_HOST_IP.254
        post-up /sbin/ifconfig eth0:0 SECONDARY_VM_IP netmask 255.255.255.255 broadcast SECONDARY_VM_IP
        post-down /sbin/ifconfig eth0:0 down
        post-up /sbin/ifconfig eth0:1 SECONDARY_VM_IP netmask 255.255.255.255 broadcast SECONDARY_VM_IP
        post-down /sbin/ifconfig eth0:1 down
...


and


Code:
auto lo eth0 eth0:0 eth0:1 eth0:2 eth0:3 eth0:4 eth0:5 eth0:6 eth0:7 eth0:8 eth0:9 eth0:10 eth0:11 eth0:12 eth0:13
iface lo inet loopback
iface eth0 inet static
        address MAIN_VM_IP
        netmask 255.255.255.255
        broadcast MAIN_VM_IP
        post-up route add FIRST_3_OCTECTS_OF_HOST_IP.254 dev eth0
        post-up route add default gw FIRST_3_OCTECTS_OF_HOST_IP.254
        pre-down route del FIRST_3_OCTECTS_OF_HOST_IP.254 dev eth0
        pre-down route del default gw FIRST_3_OCTECTS_OF_HOST_IP.254
iface eth0:0 inet static
        address SECONDARY_VM_IP
        netmask 255.255.255.255
iface eth0:1 inet static
        address SECONDARY_VM_IP
        netmask 255.255.255.255
...




Both give this when trying to ifup/ifdown:


Code:
root@hostname:~# ifup eth0:0
Ignoring unknown interface eth0:0=eth0:0.
root@hostname:~# ifdown eth0:0
ifdown: interface eth0:0 not configured
root@hostname:~# ifup eth0:1
Ignoring unknown interface eth0:1=eth0:1.
root@hostname:~# ifdown eth0:1
ifdown: interface eth0:1 not configured
root@hostname:~# [B]service networking restart[/B]
stop: Job failed while stopping
start: Job is already running: networking


Thanks in advance, hopefully this can help to fix it, I'm voluntary to any test (I have some free IPs) if it does not imply main container downtime.

Best regards!
 
Hi there,

I'm having your problem and I can't figure out how to solve it.

Can you explain how do you change the container configuration?

Thanks in advance.
 
Hey,

if you mean the network to work, you have to ONLY configure the vMAC, and inside the container you configure it normally (/etc/network/interfaces for Debian-based, or /etc/sysconfig/network-scripts/ifcfg-ethX and /etc/sysconfig/network-scripts/route-ethX for RHEL-based, though I haven't still used the latter so don't quote me on how it's needed to be done).


The specific problem of this thread (not being able to ifdown/ifup but the network works), for me it's fixed in updated PVE4.0 with "pvetest" repo, and updated Ubuntu 14.04 container.
 

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!