[SOLVED] Proxmox, Hetzner und LXC - Netzwerk

BerndKleinert

Active Member
Feb 14, 2020
43
4
28
42
Hallo,

habe Proxmox auf einem Debian Buster installiert, läuft alles prima. Auch mehrere Debian VM's laufen inkl. Netzwerkanbindung (statische, öffentliche IP) problemlos. Nun wollte ich mal einen LXC Container installieren, was auch klappt, aber das Netzwerk will nicht funktionieren. Wie in diesem Thread: https://forum.proxmox.com/threads/p...ne-netzwerkverbindung-beim-gast-debian.41272/ beschrieben steht habe ich in die /etc/network/interfaces die gleichen Daten eingetragen, wie bei einer normalen Debian VM mit KVM:

Code:
allow-hotplug ens18
iface ens18 inet static
        address 78.46.xxx.124/27
        netmask 255.255.255.255
        pointopoint 78.46.xxx.209
        gateway 78.46.xxx.209
        dns-nameserver 213.133.98.98

Aber im Container heißt das Device:

1582097470747.png

Also habe ich es mit dem Device "eth0@if95" probiert, aber die Zahl ändert sich bei jedem Boot, vorher stand zB. "eth0@if70" da.
Auch nur eth0 habe ich probiert, klappt auch nicht.

Die Netzwerkkonfiguration des Containers in Proxmox:

1582098078567.png

Jemand eine Idee, wie das klappen könnte?
 
Last edited:
Hallo matrix,

huch?! Das wars, aber wieso..? Konfiguriert sich das Interface nicht beim booten aus der /etc/network/interfaces selbst?

Und wie ist der richtige Weg, das Interface beim Booten zu konfigurieren?
 
Last edited:
Erstmal vielen herzlichen Dank dass du mich weitergebracht hast. Ich habe den Container nochmal neu mit der offiziellen Vorlage debian-10.0-standard_10.0-1_amd64.tar.gz installiert und danach nochmal die /etc/network/interfaces geschrieben, das gleiche. Mit ifup eth0 konfiguriert er das Interface korrekt, aber nach einem Reboot ist das Netzwerk wieder weg.

Jemand eine Idee? Ist das ein Bug?

dmesg aus dem Container: https://paste.debian.net/1131080/
syslog: https://paste.debian.net/1131081/

Hakt hier AppArmor dazwischen?

Habe das gefunden: https://discuss.linuxcontainers.org...during-boot-on-debian-buster-not-working/6563
und auf dem Host in die /etc/lxc/lxc-net eingetragen:

USE_LXC_BRIDGE="true"

Danach ein systemctl reload lxc, aber das Problem bleibt.
 
Last edited:
  • Like
Reactions: matrix
OK:

root@server /usr/share/lxc/hooks # pct config 104
arch: amd64
cores: 1
hostname: CT104
memory: 1512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=32:1F:7F:8D:84:4F,type=veth
ostype: debian
rootfs: local:104/vm-104-disk-0.raw,size=20G
searchdomain: 213.133.xx.98
swap: 512
unprivileged: 1
root@server /usr/share/lxc/hooks #

Ich habe auch nochmal einen ganz frischen Container installiert mit einer hohen Zahl (vmid) die ich noch nicht hatte. Alles in die /etc/network/interfaces eingetragen aber auch da ist nach dem reboot das Netzwerk wieder weg.

Edit: ich habe es mit dem Stretch Image (debian-9.0-standard_9.7-1_amd64.tar.gz) probiert, ist das gleiche. Netzwerk funktioniert erst nachdem man ifup eth0 eingegeben hat. Ich könnte es natürlich zB. in die /etc/crontab mit @reboot schreiben, aber wirklich sauber wäre diese Lösung nicht.

Edit2: es kann so einfach sein ... in der /etc/network/interfaces anstatt:

allow-hotplug eth0

ein:

auto eth0

damit funktioniert das Netzwerk auch nach dem Reboot.

Vielen herzlichen Dank matrix! :)
 
Last edited:
  • Like
Reactions: matrix

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!