NEmu

Network Emulator for Mobile Universes

Documentation - Real Network (VTap)

A VTap is a particular virtual point-to-point link which enables a virtual node to communicate with the real world, i.e. the physical host and Internet through a TUN/TAP kernel network interface.

VTap(name, ifname)

A VTap can be used and manipulated as a standard VLink.
name is the name of the virtual link.
ifname is the system TAP interface name.

Here an example of use of NEmu configuration:

InitNemu()

VHost("alice", hds=[VFs("debian.img", type="raw")]
             , nics=[VNic(hw="0a:55:78:32:e5:7f")])

VTap("tap", ifname="tap0")

SetIface("tap")

Link('alice', 'tap')

You have to setup the TAP first on the real system:

# tunctl -u user -t tap0
# ifconfig tap0 192.168.0.1

Alice can now communicate with the real system:

root\@alice# ifconfig eth0 192.168.0.2
root\@alice# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=255 time=0.252 ms

Please note that a VTap can never be placed as a client in the Link function.