admin_grundlagen:networkd
systemd-networkd
Voraussetzung: Falls NetworkManager läuft, Interfaces aus der Konfiguration herausnehmen:
- /etc/NetworkManager/NetworkManager.conf
[device] match-device=interface-name:enp0s31f6 managed=0
Datei(en) anlegen
*.netdev= Gerätdefinitonen, z.B bridges und bonding*.link= Link Layer, z.B. Namen, MAC und MTU*.network= Netzwerk (L3)
automatisch (DHCP)
- /etc/systemd/network/ethauto.network
[Match] Name=enp0s31f6 [Network] DHCP=ipv4 # nur optional zum Spass ;-) [DHCPv4] RouteMetric=100
statisch
- /etc/systemd/network/ethstatic.network
[Match] Name=enp0s31f6 [Network] Address=192.168.1.242/24 Gateway=192.168.1.5 LinkLocalAddressing=no ConfigureWithoutCarrier=yes
hybrid
- /etc/systemd/network/ethybrid.network
[Match] Name=enp0s31f6 [Network] DHCP=ipv4 Address=10.12.9.42/24
Distributionsspezifische Netzwerkkonfiguration ausschalten:
Debian:
systemctl disable --now networking.service
systemd-networkd einschalten
systemctl enable --now systemd-networkd.service
Fallstricke:
- Interfaces, die in der
/etc/network/interfacesalsallow-hotplugeingetragen sind, führen dazu, dass automatisch systemd-Instanzen erzeugt werden.- Abhilfe (soft): auskommentieren
- Abhilfe (hart):
apt-get purge ifupdown
Übersicht:
networkctl
VLAN
- 10-enp1s0f1.network
[Match] Name=enp1s0f1 [Network] Address=172.16.240.238/24 LinkLocalAddressing=no ConfigureWithoutCarrier=yes VLAN=enp1s0f1.6 VLAN=enp1s0f1.11 [Link] ActivationPolicy=On
- 20-enp1s0f1.6.netdev
[NetDev] Name=enp1s0f1.6 Kind=vlan [VLAN] Id=6
- 22-enp1s0f1.11.netdev
[NetDev] Name=enp1s0f1.11 Kind=vlan [VLAN] Id=11
- 30-enp1s0f1.6.network
[Match] Name=enp1s0f1.6 [Network] LinkLocalAddressing=no ConfigureWithoutCarrier=yes [Address] Address=192.168.6.238/24
- 32-enp1s0f1.11.network
[Match] Name=enp1s0f1.11 [Network] LinkLocalAddressing=no ConfigureWithoutCarrier=yes [Address] Address=192.168.11.238/24
admin_grundlagen/networkd.txt · Zuletzt geändert: 2024/04/25 09:58 von sh
