[SOLVED] Container "eth0" down after boot

jstuyts

New Member
Oct 30, 2015
2
0
1
51
Roosendaal, the Netherlands
Hi,

I can't get a (fully up-to-date) Debian 8 container to bring eth0 up after boot. If I enter the container I can bring eth0 up manually without issues.

The container was created using:
Code:
pct create 105 /var/lib/vz/template/cache/debian-8.0-standard_8.0-1_amd64.tar.gz \
    -description "Proxmox DHCP" \
    -hostname pvedhcp \
    -pool infrastructure \
    -cpulimit 1 \
    -cpuunits 1024 \
    -memory 256 \
    -swap 64 \
    -net0 "name=eth0,bridge=vmbr0,tag=2,ip=dhcp,ip6=dhcp" \
    -rootfs zfs_first-hdd-partial:2 \
    -onboot 1

Here is /etc/network/interfaces that is generated by Proxmox VE:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet6 dhcp

iface eth0 inet dhcp

Here is the output of a session showing the issue:
Code:
root@dev-joy-division:~# pct start 105

root@dev-joy-division:~# pct enter 105

root@pvedhcp:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 32:61:65:62:64:33
          inet6 addr: fe80::3061:65ff:fe62:6433/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:648 (648.0 B)  TX bytes:798 (798.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@pvedhcp:~# ifdown eth0
ifdown: interface eth0 not configured

root@pvedhcp:~# ifup eth0
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/32:61:65:62:64:33
Sending on   LPF/eth0/32:61:65:62:64:33
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.0.1
DHCPACK from 192.168.0.1
bound to 192.168.0.100 -- renewal in 37221 seconds.

root@pvedhcp:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 32:61:65:62:64:33
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::3061:65ff:fe62:6433/64 Scope:Link
          inet6 addr: fd98:b6a5:55:2:ffff::4a0d/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1850 (1.8 KiB)  TX bytes:2434 (2.3 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
Well, this is embarrassing. It seems I should check my configuration using a hex dump from now on. Apparently /etc/network/interfaces contained a character that prevented it from being read correctly, which prevented /etc/init.d/networking from bringing up the interfaces.

I found this out by deleting /etc/network/interfaces and rebooting. After the container came back up, eth0 was up. I checked the file and only the settings for eth0 were there. Adding the settings for lo again, did not break things this time.
 

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!