Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


admin_grundlagen:networkd

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
admin_grundlagen:networkd [2021/12/09 15:04]
sh
admin_grundlagen:networkd [2024/04/25 09:58] (aktuell)
sh [systemd-networkd]
Zeile 1: Zeile 1:
 ====== systemd-networkd ====== ====== systemd-networkd ======
  
-Voraussetzung:​ Falls NetworkManager,​ Interfaces aus der +Voraussetzung:​ Falls [[network-manager|NetworkManager]] läuft, Interfaces aus der 
-Autokonfiguration ​herausnehmen+Konfiguration ​herausnehmen:
 <file txt /​etc/​NetworkManager/​NetworkManager.conf>​ <file txt /​etc/​NetworkManager/​NetworkManager.conf>​
-[main+[device
-no-auto-default=enp0s31f6+match-device=interface-name:​enp0s31f6 
 +managed=0
 </​file>​ </​file>​
  
 Datei(en) anlegen Datei(en) anlegen
-  * .netdev = Gerätdefinitonen,​ z.B bridges und bonding +  ​* ''​*.netdev'' ​= Gerätdefinitonen,​ z.B bridges und bonding 
-  * .link = Link Layer, z.B. Namen, MAC und MTU +  ​* ''​*.link'' ​= Link Layer, z.B. Namen, MAC und MTU 
-  * .network = Netzwerk (L3)+  ​* ''​*.network'' ​= Netzwerk (L3)
  
-=== automatische ​DHCP ===+=== automatisch (DHCP===
 <file txt /​etc/​systemd/​network/​ethauto.network>​ <file txt /​etc/​systemd/​network/​ethauto.network>​
 [Match] [Match]
Zeile 22: Zeile 23:
  
 # nur optional zum Spass ;-) # nur optional zum Spass ;-)
-[DHCP]+[DHCPv4]
 RouteMetric=100 RouteMetric=100
 </​file>​ </​file>​
Zeile 34: Zeile 35:
 Address=192.168.1.242/​24 Address=192.168.1.242/​24
 Gateway=192.168.1.5 Gateway=192.168.1.5
 +LinkLocalAddressing=no
 +ConfigureWithoutCarrier=yes
  
 </​file>​ </​file>​
Zeile 48: Zeile 51:
 </​file>​ </​file>​
  
-Distributionsspezifischen Networking ​ausschalten ​und systemd-networkd einschalten+Distributionsspezifische Netzwerkkonfiguration ​ausschalten
 + 
 +Debian:
   systemctl disable --now networking.service   systemctl disable --now networking.service
 +
 +systemd-networkd einschalten
   systemctl enable --now systemd-networkd.service   systemctl enable --now systemd-networkd.service
  
 +Fallstricke:​
 +  * Interfaces, die in der ''/​etc/​network/​interfaces''​ als ''​allow-hotplug''​ eingetragen sind, führen dazu, dass automatisch systemd-Instanzen erzeugt werden.
 +    * Abhilfe (soft): auskommentieren
 +    * Abhilfe (hart): ''​apt-get purge ifupdown''​
  
 +Übersicht:
 +  networkctl
  
 +====== VLAN ======
 +<file txt 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
 +</​file>​
 +
 +<file txt 20-enp1s0f1.6.netdev>​
 +
 +[NetDev]
 +Name=enp1s0f1.6
 +Kind=vlan
 +
 +[VLAN]
 +Id=6
 +</​file>​
 +
 +<file txt 22-enp1s0f1.11.netdev>​
 +
 +[NetDev]
 +Name=enp1s0f1.11
 +Kind=vlan
 +
 +[VLAN]
 +Id=11
 +</​file>​
 +
 +<file txt 30-enp1s0f1.6.network>​
 +
 +[Match]
 +Name=enp1s0f1.6
 +
 +[Network]
 +LinkLocalAddressing=no
 +ConfigureWithoutCarrier=yes
 +
 +[Address]
 +Address=192.168.6.238/​24
 +</​file>​
 +
 +<file txt 32-enp1s0f1.11.network>​
 +
 +[Match]
 +Name=enp1s0f1.11
 +
 +[Network]
 +LinkLocalAddressing=no
 +ConfigureWithoutCarrier=yes
 +
 +[Address]
 +Address=192.168.11.238/​24
 +</​file>​
  
admin_grundlagen/networkd.1639062274.txt.gz · Zuletzt geändert: 2021/12/09 15:04 von sh