VLAN mit Linux und Cisco Nexus
Version vom 13. April 2025, 17:04 Uhr von Thomas.will (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „=== Zielbeschreibung === * Der Cisco-Port '''Ethernet1/1''' ist als '''802.1Q-Trunk''' konfiguriert. * Der Linux-Rechner verwendet das Interface '''enp0s10'''.…“)
Zielbeschreibung
- Der Cisco-Port Ethernet1/1 ist als 802.1Q-Trunk konfiguriert.
- Der Linux-Rechner verwendet das Interface enp0s10.
- Zwei VLANs werden getaggt übertragen:
- VLAN 22 → 172.17.113.1/24
- VLAN 23 → 172.18.113.1/24
Voraussetzungen auf Debian/Linux
- VLAN-Paket installieren
- apt install vlan
- VLAN-Modul laden
- sudo modprobe 8021q
- Modul beim Booten automatisch laden
- echo 8021q | sudo tee -a /etc/modules
/etc/network/interfaces
auto lo iface lo inet loopback auto enp0s10 iface enp0s10 inet manual auto enp0s10.22 iface enp0s10.22 inet static address 172.17.113.1 netmask 255.255.255.0 vlan-raw-device enp0s10 auto enp0s10.23 iface enp0s10.23 inet static address 172.18.113.1 netmask 255.255.255.0 vlan-raw-device enp0s10
Cisco-Konfiguration für Ethernet1/1
interface Ethernet1/1 description Trunk zu Linux-Host switchport mode trunk switchport trunk allowed vlan 22,23 spanning-tree port type edge trunk
Aktivierung der Konfiguration
Nach den obigen Anpassungen auf dem Linux-System die Netzwerkschnittstellen neu starten:
- sudo systemctl restart networking
- ip addr show
- Sicherstellen, dass die IP-Adressen korrekt zugewiesen wurden und die Kommunikation innerhalb der VLANs funktioniert.