Attaching a Guest Directly to a Virtualization Host Network Interface with a macvtap Driver: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:


=Overview=
=Overview=
=Method 1=
The simplest method is to leave the network interface '''unconfigured''' on the virtualization host and to assign it to the guest in configuration with [[virsh edit]] as follows:


<pre>
<pre>
    <interface type='direct'>
...
      <mac address='52:54:00:02:72:ed'/>
<interface type='direct'>
      <source dev='em2' mode='private'/>
    <source dev='eth0' mode='private'/>
      <model type='rtl8139'/>
</interface>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
...
    </interface>
</pre>
</pre>
Note that after saving it, libvirt will update the stored configuration as follows:
<pre>
...
<interface type='direct'>
    <mac address='52:54:00:02:72:ed'/>
    <source dev='em2' mode='private'/>
    <model type='rtl8139'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
...
</pre>
Note that the MAC address declared in the configuration is different from the MAC address declared by <tt>ip addr</tt> on the virtualization host.

Revision as of 01:00, 28 June 2017

Internal

Overview

Method 1

The simplest method is to leave the network interface unconfigured on the virtualization host and to assign it to the guest in configuration with virsh edit as follows:


...
<interface type='direct'>
    <source dev='eth0' mode='private'/>
</interface>
...

Note that after saving it, libvirt will update the stored configuration as follows:

...
<interface type='direct'>
    <mac address='52:54:00:02:72:ed'/>
    <source dev='em2' mode='private'/>
    <model type='rtl8139'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
...

Note that the MAC address declared in the configuration is different from the MAC address declared by ip addr on the virtualization host.