Open Vswitch Projekt VM: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(49 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
= Open vSwitch Lab VM in VirtualBox anlegen =
+
== Open vSwitch Lab VM in VirtualBox anlegen ==
  
 
== Ziel ==
 
== Ziel ==
Es soll eine Debian 12 VM mit dem Namen '''ovs-lab''' in VirtualBox erstellt werden.   
+
Es soll eine Debian 13 VM mit dem Namen '''ovs-lab''' in VirtualBox erstellt werden.   
Die VM nutzt den ICH9-Chipsatz, 2 vCPUs, 2 GB RAM, eine 20 GB Festplatte und 8 VirtIO-Netzwerkkarten.
+
Die VM wird aus dem bestehenden Template '''debian-template''' geklont und anschließend mit 18 VirtIO-Netzwerkkarten ausgestattet.
 +
* NIC 1: Bridged auf Host-'''br0''' (temporär für die Installation)
 +
* NIC 2–17: interne Netze port2–port17 für den OVS-Switch
 +
* NIC 18: NAT mit SSH-Portforwarding (Konsolen-Port)
  
== VM erstellen ==
+
== Template klonen ==
* '''VBoxManage createvm --name ovs-lab --ostype Debian_64 --register'''
+
<pre>
 +
vboxmanage clonevm debian-template --name ovs --register
 +
</pre>
  
== Basis-Hardware konfigurieren ==
+
== VM anpassen ==
* '''VBoxManage modifyvm ovs-lab --chipset ich9 --memory 2048 --cpus 2 --vram 16'''
+
<pre>
 +
vboxmanage modifyvm ovs --cpus 2 --memory 2048 --chipset ich9
 +
</pre>
  
== Storage-Controller hinzufügen ==
+
== NIC 1 für die Installation vorbereiten ==
* '''VBoxManage storagectl ovs-lab --name "SATA Controller" --add sata --controller IntelAHCI'''
+
NIC 1 wird temporär als Bridged-Adapter auf das Host-Interface '''br0''' gesetzt, damit die VM während der Installation erreichbar ist:
 +
<pre>
 +
vboxmanage modifyvm ovs-lab --nic1 bridged --nictype1 virtio \
 +
    --bridgeadapter1 br0 --cableconnected1 on
 +
</pre>
  
== Festplatte anlegen ==
+
== NICs 1–23 als interne Netze konfigurieren ==
* '''VBoxManage createmedium disk --filename "C:\Users\<BENUTZER>\VirtualBox VMs\ovs-lab\ovs-lab.vdi" --size 20480 --format VDI'''
+
<pre>
 +
for k in $(seq 1 23); do
 +
    vboxmanage modifyvm ovs --nic$k intnet --nictype$k virtio \
 +
        --intnet$k "port$k" --cableconnected$k on --nicpromisc$k allow-all
 +
done
 +
</pre>
  
== Festplatte anhängen ==
+
== NIC 24 als NAT-Konsolen-Port konfigurieren ==
* '''VBoxManage storageattach ovs-lab --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "C:\Users\<BENUTZER>\VirtualBox VMs\ovs-lab\ovs-lab.vdi"'''
+
NIC 24 dient als Konsolen-Port (analog zum Konsolen-Port eines echten Switches):
 +
<pre>
 +
vboxmanage modifyvm ovs --nic24 nat --nictype24 virtio --cableconnected18 on
 +
vboxmanage modifyvm ovs --natpf24 "ssh,tcp,,2222,,22"
 +
</pre>
  
== Debian 12 ISO einbinden ==
+
== Kontrolle ==
* '''VBoxManage storageattach ovs-lab --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium "C:\Pfad\zu\debian-12.iso"'''
 
 
 
== Netzwerkadapter (8 VirtIO-NICs) hinzufügen ==
 
 
<pre>
 
<pre>
for k in $(seq 11)
+
vboxmanage showvminfo ovs-lab
do
 
  VBoxManage modifyvm ovs-lab --nic$k bridged --nictype$k virtio --bridgeadapter$k "eth$k"
 
done
 
 
</pre>
 
</pre>
  
 
== Ergebnis ==
 
== Ergebnis ==
 
* VM-Name: '''ovs-lab'''
 
* VM-Name: '''ovs-lab'''
* OS: Debian 12 (64-Bit)
+
* OS: Debian 13 (64-Bit)
 
* CPU: 2 vCPUs
 
* CPU: 2 vCPUs
* RAM: 4 GB
+
* RAM: 2 GB
* Disk: 20 GB VDI
 
* Netz: 10 VirtIO-NICs (bridged)
 
 
* Chipsatz: ICH9
 
* Chipsatz: ICH9
 +
* NIC 1–23: interne Netze port1–port23
 +
* NIC 24: NAT, SSH-Portforwarding Host 2222 → Guest 22 (Konsolen-Port)
  
 
Die VM ist nun bereit für die Debian-Installation.
 
Die VM ist nun bereit für die Debian-Installation.
 +
 +
==Maschine starten==
 +
;In der Maschine letzte Schnittstelle auf DHCP setzen
 +
dhcpcd enp2s15
 +
 +
== SSH-Config anlegen ==
 +
;Der Pseudo-Konsolenport
 +
~/.ssh/config
 +
<pre>
 +
Host ovs
 +
    Hostname 127.0.0.1
 +
    Port 2222
 +
    User kit
 +
</pre>
 +
 +
== SSH-Key kopieren ==
 +
<pre>
 +
ssh-copy-id ovs
 +
</pre>
 +
 +
== Einloggen ==
 +
<pre>
 +
ssh ovs
 +
</pre>

Aktuelle Version vom 14. Mai 2026, 17:45 Uhr

Open vSwitch Lab VM in VirtualBox anlegen

Ziel

Es soll eine Debian 13 VM mit dem Namen ovs-lab in VirtualBox erstellt werden. Die VM wird aus dem bestehenden Template debian-template geklont und anschließend mit 18 VirtIO-Netzwerkkarten ausgestattet.

  • NIC 1: Bridged auf Host-br0 (temporär für die Installation)
  • NIC 2–17: interne Netze port2–port17 für den OVS-Switch
  • NIC 18: NAT mit SSH-Portforwarding (Konsolen-Port)

Template klonen

vboxmanage clonevm debian-template --name ovs --register

VM anpassen

vboxmanage modifyvm ovs --cpus 2 --memory 2048 --chipset ich9

NIC 1 für die Installation vorbereiten

NIC 1 wird temporär als Bridged-Adapter auf das Host-Interface br0 gesetzt, damit die VM während der Installation erreichbar ist:

vboxmanage modifyvm ovs-lab --nic1 bridged --nictype1 virtio \
    --bridgeadapter1 br0 --cableconnected1 on

NICs 1–23 als interne Netze konfigurieren

for k in $(seq 1 23); do
    vboxmanage modifyvm ovs --nic$k intnet --nictype$k virtio \
        --intnet$k "port$k" --cableconnected$k on --nicpromisc$k allow-all
done

NIC 24 als NAT-Konsolen-Port konfigurieren

NIC 24 dient als Konsolen-Port (analog zum Konsolen-Port eines echten Switches):

vboxmanage modifyvm ovs --nic24 nat --nictype24 virtio --cableconnected18 on
vboxmanage modifyvm ovs --natpf24 "ssh,tcp,,2222,,22"

Kontrolle

vboxmanage showvminfo ovs-lab

Ergebnis

  • VM-Name: ovs-lab
  • OS: Debian 13 (64-Bit)
  • CPU: 2 vCPUs
  • RAM: 2 GB
  • Chipsatz: ICH9
  • NIC 1–23: interne Netze port1–port23
  • NIC 24: NAT, SSH-Portforwarding Host 2222 → Guest 22 (Konsolen-Port)

Die VM ist nun bereit für die Debian-Installation.

Maschine starten

In der Maschine letzte Schnittstelle auf DHCP setzen
dhcpcd enp2s15

SSH-Config anlegen

Der Pseudo-Konsolenport
~/.ssh/config
Host ovs
    Hostname 127.0.0.1
    Port 2222
    User kit

SSH-Key kopieren

ssh-copy-id ovs

Einloggen

ssh ovs