NEmu

Network Emulator for Mobile Universes

Documentation - Remote Connections

NEmu provides the possibility to interact with another NEmu session laying on a distant physical host through a SSH tunnel. The remote connection authentication is performed through a ssh-agent.

RemoteNemu(name, user, host, port, path, **opts)

Creates a NEmu remote connection configuration through SSH. name is the name of the remote connection, user is the SSH username, host is the SSH server hostname or IP address and port is the SSH server listening port (default: 22). The remote NEmu instance will be launched in path. opts represent SSH program options (arg=val in opts will become -arg val for SSH).
Configurations of remote connections are set in symlink.{session name}/rcon/.

StartRemoteNemu(*names)

Starts several remote connections (Default: starts all).

StopRemoteNemu(*names)

Stops several remote connections (Default: halts all).

DelRemoteNemu(*names)

Deletes several remote connections configuration. These ones will be stopped if they are currently running (Default: deletes all).

FileRemoteNemu(name, *files)

Sends and executes all files listed in files on the remote session called name. If the connection is not started yet, the remote commands are buffered until the connection was made.

ComRemoteNemu(name, *coms)

Sends and executes commands listed in coms on the remote session called name. If the connection is not started yet, the remote commands are buffered until the connection was made.

ShellRemoteNemu(name)

Gets a command line shell to a remote connections configuration. Pressing ESC exits the shell mode.

MountRemoteNemu(*names)

Remotly mounts several distant NEmu session directories in the current scope (Default: mounts all).

UmountRemoteNemu(*names)

Remotly un-mounts several distant NEmu session directories from the current scope (Default: un-mounts all).

Here is a short example of use on a physical host of address 192.168.0.1 which uses a remote connection to another host of address 192.168.0.2:

# File: /var/nemu/dist/dist.py

InitNemu(workspace="/tmp")

VHost("bob", hds=[VFs("debian.img", "cow")], nics=[VNic()]
           , vnc=":1", enable_kvm=None, localtime=None, k="fr")

VRemote("rlink")

SetIface("rlink", addr="192.168.0.1", port=7010)

Link("bob", "rlink")

StartNemu()
# File: /var/nemu/core/base.py

InitNemu(workspace="/tmp")

VHost("alice", hds=[VFs("debian.img", "cow")], nics=[VNic()]
             , sdl=None, enable_kvm=None, localtime=None, k="fr")

RemoteNemu("dist", user="user", host="192.168.0.2"
                 , path="/var/nemu/dist")

StartRemoteNemu("dist")

VLine("link")

SetIface("link:0", addr="192.168.0.2", port=7010)

Link("a", "link:1")

StartNemu()

FileRemoteNemu("dist", "dist.py")

WaitNemu('alice')

ComRemoteNemu("dist", "StopNemu()")
ComRemoteNemu("dist", "DelNemu()")

StopNemu()

DelNemu()

The following commands line will launch the distributed virtual network:

$ nemu -f base.py

A remote connection can be directly established:

$ nemu --remote user\@host
Welcome to the Network Emulator for Mobile Universes [NEmu]
Init session in
/tmp/nemu.session.KB9hwZ
Init log in
/tmp/nemu.session.KB9hwZ/nemu.log
Link point is
symlink.nemu.session.KB9hwZ
Done.
Setting up the remote connection host
Done.
Launching the remote connection host
Launching ssh
Connected to user\@host:22
[nemu:host]~>