Network Emulator for Mobile Universes

Documentation - Real Network (VSlirp)

A Slirp 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 NATed system. Slirp link already contains internal DHCP and DNS servers.

VSlirp(name, net, restrict, forwards)

A Slirp can be used and manipulated as a standard VLink.
name is the name of the virtual link.
net is the network address managed by the Slirp (default:
restrict is a boolean which enables/disables the virtual node isolation from the external world. If this flag is activated, only forward rules will be authorized (default: False).
forwards is a list of Forward elements (default: empty list).

Forward(host, guest, proto)

Enables a port forwarding between the physical machine to a virtual node linked to a Slirp.
host is the {ip address}:port on the physical host.
guest is the {ip address}:port on the virtual node.
proto is the protocole of the Slirp port forwarding, i.e. udp or tcp (default: tcp).

Here an example of use of NEmu configuration:


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

VSlirp("slirp", net='
              , forwards=[Forward(host=2222, guest=22)])


Link('alice', 'slirp')

And, here is the result inside the virtual machine:

root\@alice# dhclient eth0
root\@alice# ifconfig eth0 |head -n 2
eth0      Link encap:Ethernet  HWaddr 0a:55:78:32:e5:7f 
          inet adr:  Bcast: 
root\@alice# ls
root\@alice# wget --quiet
root\@alice# ls
root\@alice# /usr/sbin/services sshd start

You can now access to the virtual machine from the real physical host:

$ ssh -p 2222 root\@

Please note that a VSlirp can never be placed as a client in the Link function. Also, it can only be linked with a VNode.