[SOLVED] LXC-Container Ubuntu 24.04 - Wo liegt die Netzwerkkonfiguration? Ping nur mit sudo?

matt69

Member
Nov 12, 2023
99
12
13
Hallo,

ich habe Ubuntu 24.04 mit dem Template "ubuntu-24.04-standard" als LXC-Container installiert.
Der LXC-Container hat eine statische IP erhalten.

Screenshot_2024-12-26_11-19-15.jpg

Aber wo findet man im LXC-Container die Netzwerkkonfiguration?

Der Order /etc/netplan/ ist leer.
Normalerweise müsste doch dort eine yaml-Datei liegen.
Oder wurde das in Ubuntu 24.04 wieder geändert?

Code:
$ sudo ls -lha /etc/netplan/
total 8,0K
drwxr-xr-x  2 root root 4,0K Apr 18  2024 .
drwxr-xr-x 92 root root 4,0K Dez 26 10:22 ..


Außerdem kann man von Ubuntu aus nur mit sudo pingen.
Warum?

Code:
$ sudo ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=11.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=9.17 ms

Code:
$ ping 8.8.8.8
ping: socktype: SOCK_RAW
ping: socket: Operation not permitted
ping: => missing cap_net_raw+p capability or setuid?


Von Debian 12 aus kann man auch ohne sudo pingen.

Code:
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=11.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=9.17 ms

VG
 
ich habe Ubuntu 24.04 mit dem Template "ubuntu-24.04-standard" als LXC-Container installiert.
Der LXC-Container hat eine statische IP erhalten.

View attachment 79745

Aber wo findet man im LXC-Container die Netzwerkkonfiguration?
Hier steht die Lösung:

Zitat:
We use systemd network manager /etc/systemd/network/

Code:
$ ls -lh /etc/systemd/network/
total 4,0K
-rw-r--r-- 1 root root 163 Dez 21 16:54 eth0.network

Code:
$ cat /etc/systemd/network/eth0.network
[Match]
Name = eth0

[Network]
Description = Interface eth0 autoconfigured by PVE
Address = 192.168.123.88/24
Gateway = 192.168.123.1
DHCP = no
IPv6AcceptRA = false