Cannot specify Mac address for bridge
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
uvtool |
Fix Committed
|
Wishlist
|
Unassigned |
Bug Description
My hosting provider requires me to use Mac addresses provided by themselves so that their network will accept my ethernet packets. They also require a strict proscribed static IP allocation. Without the correct Mac address, my VM cannot send/receive data to/from the network.
I am running uvt-kvm like this:
uvt-kvm create --password changeme --memory 4096 --disk 40 --cpu 2 --bridge br0 --packages openssh-
With a meta-data file that looks like:
instance-id: 22720db9-
local-hostname: my-vm123
network-interfaces: |
iface ens3 inet static
hwaddress ether 06:00:00:42:9b:44
address 54.36.67.139
network 54.36.67.139
netmask 255.255.255.255
broadcast 5.196.205.132
gateway 91.121.89.254
dns-nameservers 213.186.33.99
dns-search mydomain.com
However, the problem that I have when using the `--bridge br0` is that the Mac address for the vnet adapter created for that bridge is seemingly randomly assigned.
I attach a patch that adds a `--mac` parameter to uvt-kvm which allows the user to specify the Mac address for the interface. I have tested it here and it sets the Mac correctly, both when using a bridge and when not using a bridge.
With the patch I can execute uvt-kvm like:
uvt-kvm create --password changeme --memory 4096 --disk 40 --cpu 2 --bridge br0 --mac 06:00:00:42:9b:44 --packages openssh-
Related branches
- Christian Ehrhardt : Approve
-
Diff: 96 lines (+32/-7)2 files modifiedman/uvt-kvm.1 (+5/-0)
uvtool/libvirt/kvm.py (+27/-7)
Changed in uvtool: | |
status: | Triaged → Fix Committed |
Thank you for the patch! This looks reasonable. I'll add this to my review queue.