NEmu

Network Emulator for Mobile Universes

Documentation - Network Interface Cards (VNic)

A network interface card can be plugged to a virtual node in order to allow it to communicate with other virtual nodes.

VNic(hw, model)

This function creates a new virtual network interface card.
hw is the hardware (or MAC) address of the NIC (default: Autoset).
model is the hardware model of the NIC (default: e1000).

Available values for the model parameter are dependent on the QEMU version. You can run the following command to check supported nic models:

$ qemu-system-x86_64 -net nic,model=?

DumpIface(name)

Dumps the network traffic of the interface name in {session dir}/{element type}/{element name}/{name}.{niface}.{mac}.cap. name should be {element name}:{interface number} or {element name}; in this last case, all interfaces will be dumped. Here is an example:

VHost('alice', nics=[VNic(model='rtl8139'), 
       VNic(hw='0a:55:78:32:e5:7f', model='e1000')],
       cdrom='/tmp/debian7.iso', m=1024, boot='d')
DumpIface('alice:1')

UndumpIface(name)

Stops to dump the network traffic for the interface name. name should be {element name}:{interface number} or {element name}; in this last case, all interfaces will stop to dump.

AddIface(name, iface)

This function allows you to create, offline or online, a new virtual interface and plug it to a virtual element. name is the name of the virtual element and iface is a new VNic. Here is an example:

VHost('alice', nics=[VNic(model='rtl8139'), 
       VNic(hw='0a:55:78:32:e5:7f', model='e1000')],
       cdrom='/tmp/debian7.iso', m=1024, boot='d')
AddIface('alice', VNic(hw='0a:55:78:44:e2:b5'))

For a VLink element, iface should be empty and will be automatically set.