Creating persistent (across reboots) macvtap interface with nmcli
It's REALLY strange how posting a question sometimes makes a solution appear out of nowhere. ;) Here is is for posterity and searching in case somebody else needs this.
Anyway. Here is the solution. If anybody has suggestions on making it easier or simpler or doing it another way I'm all ears!
- Create your macvtap interface.
nmcli connection add type macvlan dev eth0 mode bridge tap yes ifname macvtap0- Remove automatic ipv4 and ipv6 assignment to the parent macvtap device you just created (unless you need it for some reason).
nmcli connection modify macvlan-macvtap0 ipv6.method "disabled"nmcli connection modify macvlan-macvtap0 ipv4.method "disabled"You should now have a fully functioning macvtap adapter you can use with virt-manager (just change the network source dropdown to Mactap device and change the device name to macvtap0 or whatever you chose). Boot up and bam...bridged ethernet.
Also, if you want to access the VM from your host, you will need to add another adapter to the VM. I just use the default network provided by virt-manager and use that IP when sshing in. I'm pretty sure some of the above steps can be combined. I tried disabling ipv4 and ipv6 on the same line as creating the adapter but it failed (it actually created the interface, but when I listed it with
ip aDoes anybody have a constructed nmcli command to create a macvtap interface in nmcli? I can create it with the
ipip link add link eth0 name macvtap0 type macvtap mode bridgeAnd can use it in virt-manager to bridge my VM to the physical network. But of course it's not persistent across rebooting.
I found this knowledgebase solution for a standard macvlan interface. But I'm having problems simplifying it to create a macvtap device equivelent to what I'm doing in with
iphttps://access.redhat.com/solutions/4048911
Thanks for assistance!
Responses