Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Creating persistent (across reboots) macvtap interface with nmcli

    Posted on

    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!

    1. Create your macvtap interface.

    nmcli connection add type macvlan dev eth0 mode bridge tap yes ifname macvtap0
    Where eth0 is your physical device. Note: I've not tried this with a wireless device.

    1. 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 a
    it was not there which seems odd).


    Does anybody have a constructed nmcli command to create a macvtap interface in nmcli? I can create it with the

    ip
    command:

    ip link add link eth0 name macvtap0 type macvtap mode bridge

    And 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

    ip
    .

    https://access.redhat.com/solutions/4048911

    Thanks for assistance!

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat