Bearbeiten von „VLAN for virtual machines“
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 | + | '''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 | + | '''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 | + | '''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 | + | '''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 | + | '''harley$''' cat qemu.xsl |
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<!-- This stylesheet extracts the VLAN-ID and the target device of the | <!-- This stylesheet extracts the VLAN-ID and the target device of the |