[libvirt-users] Fake Network Interface

Andrew Martin amartin at xes-inc.com
Mon Jan 13 22:54:44 UTC 2014


I found the answer to this question:
1. create an XML file with a fake configuration (including a subnet not in use elsewhere):
<network>
  <name>fake</name>
  <bridge name='virbr1' stp='on' delay='0' />
  <ip address='192.168.0.1' netmask='255.255.0.0'></ip>
</network>

2. define the network: virsh net-define /path/to/fake.xml
3. autostart the network: virsh net-autostart fake
4. start the network now: virsh net-start fake

Once done, you can add this block of XML to your VM config with "virsh edit <vm_name>":
     <interface type='network'>
       <mac address='aa:aa:aa:aa:aa:aa'/>
       <source network='fake'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
       function='0x0'/>
     </interface>
Note that you should adjust the "slot" and "mac" arguments to avoid conflicts.

Thanks,

Andrew

----- Original Message -----
> From: "Andrew Martin" <amartin at xes-inc.com>
> To: libvirt-users at redhat.com
> Sent: Monday, December 30, 2013 11:25:29 AM
> Subject: [libvirt-users] Fake Network Interface
> 
> Hello,
> 
> Is there a supported method for creating a fake network interface in a VM's
> configuration file? I was using the below construct, however it is no longer
> working for me in recent versions of libvirt (libvirt 1.0.2 with qemu-kvm
> 1.4.0). Is there a different, preferred method for creating a fake virtual
> interface on the guest which does not exist on the host?
>     <interface type='network'>
>       <mac address='aa:aa:aa:aa:aa:aa'/>
>       <source network='fake'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
>       function='0x0'/>
>     </interface>
> 
> Thanks,
> 
> Andrew
> 
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
> 




More information about the libvirt-users mailing list