cockpit-project / cockpit-machines

Cockpit UI for virtual machines
GNU Lesser General Public License v2.1
289 stars 74 forks source link

Allow configuration of target device name for bridge interfaces #1627

Open JeffWDH opened 5 months ago

JeffWDH commented 5 months ago

Libvirt supports overriding the name of tap devices used for bridge interfaces. I propose adding this functionality to Cockpit-machines as telling the difference between dozens of vnetX interfaces is not a great experience.

Example config:

<interface type='bridge'>
  <mac address='52:54:00:ae:f7:f2'/>
  <source bridge='LAN'/>
  <target dev='VM_TestVM'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>

Resulting device:

42: VM_TestVM: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master LAN state UNKNOWN group default qlen 1000
    link/ether fe:54:00:ae:f7:f2 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:feae:f7f2/64 scope link
       valid_lft forever preferred_lft forever

Restrictions:

Libvirt documentation: https://libvirt.org/formatdomain.html#overriding-the-target-element