Bearbeiten von „VLAN for virtual machines“

Wechseln zu: Navigation, Suche

Warnung: Du bist nicht angemeldet. Deine IP-Adresse wird öffentlich sichtbar, falls du Bearbeitungen durchführst. Sofern du dich anmeldest oder ein Benutzerkonto erstellst, werden deine Bearbeitungen zusammen mit anderen Beiträgen deinem Benutzernamen zugeordnet.

Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und speichere dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.
Aktuelle Version Dein Text
Zeile 208: Zeile 208:
 
== linux bridge with libvirt hook scripts ==
 
== linux bridge with libvirt hook scripts ==
 
We setup a bridge with VLAN enabled:
 
We setup a bridge with VLAN enabled:
  '''harley$''' cat /etc/systemd/network/08-br0.netdev  
+
  '''harley$''' cat 08-br0.netdev  
 
  [NetDev]
 
  [NetDev]
 
  Name=br0
 
  Name=br0
Zeile 216: Zeile 216:
 
  VLANFiltering=true
 
  VLANFiltering=true
 
  STP=false
 
  STP=false
  '''harley$''' cat /etc/systemd/network/12-br0_add-enp1s0.network  
+
  '''harley$''' cat 12-br0_add-enp1s0.network  
 
  [Match]
 
  [Match]
 
  Name=enp1s0
 
  Name=enp1s0
Zeile 227: Zeile 227:
 
  [BridgeVLAN]
 
  [BridgeVLAN]
 
  VLAN=30
 
  VLAN=30
  '''harley$''' cat /etc/systemd/network/16-br0_up.network  
+
  '''harley$''' cat 16-br0_up.network  
 
  [Match]
 
  [Match]
 
  Name=br0
 
  Name=br0
Zeile 259: Zeile 259:
 
# [[#set VLAN-ID to the dynamic virtual network interface vnet*]]
 
# [[#set VLAN-ID to the dynamic virtual network interface vnet*]]
 
<span id="debug.sh">For debugging the hook-scripts</span> I've made a small script:
 
<span id="debug.sh">For debugging the hook-scripts</span> I've made a small script:
  '''harley$''' cat /etc/libvirt/hooks/debug.sh
+
  '''harley$''' cat debug.sh
 
  #!/bin/bash -e
 
  #!/bin/bash -e
 
  # https://www.libvirt.org/hooks.html
 
  # https://www.libvirt.org/hooks.html
Zeile 290: Zeile 290:
 
=== get information on startup from the runtime XML-config of the domain ===
 
=== get information on startup from the runtime XML-config of the domain ===
 
It seems a little bit difficult to get needed information out of the big XML-config but it's no problem with XSLT. I've made a XSL-stylesheet for this and use xmlstarlet. Start a virtual machine and then its runtime configuration is available with <code>'''harley$''' virsh dumpxml deb9-test | xmlstarlet tr qemu.xsl</code>. With this I can test my stylesheet. Here is it:
 
It seems a little bit difficult to get needed information out of the big XML-config but it's no problem with XSLT. I've made a XSL-stylesheet for this and use xmlstarlet. Start a virtual machine and then its runtime configuration is available with <code>'''harley$''' virsh dumpxml deb9-test | xmlstarlet tr qemu.xsl</code>. With this I can test my stylesheet. Here is it:
  '''harley$''' cat /etc/libvirt/hooks/qemu.xsl  
+
  '''harley$''' cat qemu.xsl  
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  &lt;!-- This stylesheet extracts the VLAN-ID and the target device of the
 
  &lt;!-- This stylesheet extracts the VLAN-ID and the target device of the

Bitte beachte, dass alle Beiträge zu Ingos Wiki von anderen Mitwirkenden bearbeitet, geändert oder gelöscht werden können. Reiche hier keine Texte ein, falls du nicht willst, dass diese ohne Einschränkung geändert werden können.

Du bestätigst hiermit auch, dass du diese Texte selbst geschrieben hast oder diese von einer gemeinfreien Quelle kopiert hast (weitere Einzelheiten unter My wiki:Urheberrechte). ÜBERTRAGE OHNE GENEHMIGUNG KEINE URHEBERRECHTLICH GESCHÜTZTEN INHALTE!

Abbrechen | Bearbeitungshilfe (wird in einem neuen Fenster geöffnet)