Umview+UMlwip

From Virtualsquare
Revision as of 18:46, 27 December 2012 by Renzo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Umview starts the first process running inside the (partial) virtual machine. This process and all its offspring run under the control of umview.

The command:

$ umview xterm

starts an xterm running inside the virtual machine. It is possible to use rxvt or bash instead of xterm.

Before loading any module umview does nothing. Processes running inside the umview machine behave in the same way of all the others processes.

lwipv6

NOTICE. umlwip is being replaced by the umnetlwipv6 submodule of umnet, and umlwip is now deprecated. Until this page gets updated, please read the pages about umnet and the umnet modules for more information about the new implementation.

The lwipv6 module creates virtual interfaces based on the liblwipv6 TCP-IP user mode stack.

The simplest way to start it is:

$ um_add_service lwipv6
$ ip addr
1: lo0: <LOOPBACK,UP> mtu 0 
    link/loopback 
    inet6 ::1/128 scope host 
    inet 127.0.0.1/8 scope host 
2: vd0: <BROADCAST> mtu 1500 
    link/ether 02:02:38:bd:cd:06 brd ff:ff:ff:ff:ff:ff
$

The output of the ip command shows the default interfaces defined by lwipv6: lo0 i.e. localhost and a vde interface. (we support ip for network configuration instead of ifconfig because ip has a complete and consistent management of IPv6 multiple addresses and it is based on the portable AF_NETLINK interface. ifconfig instead uses /proc to read info. ip is usually part of the iproute packet).

Lwipv6 is able to create several interfaces connected to different vde switches, to tun or tap interfaces.

The following commands:

$ um_add_service lwipv6,vd0=/tmp/v1
$ um_add_service lwipv6,vd0=/tmp/v1,vd1=tmp/v2
$ um_add_service lwipv6,vd0=/tmp/v1,tp0=tap2,tn0=tun2
  1. attach a vde interface to a specific switch;
  2. create two vde interfaces connected to two different switches;
  3. create a vde, a tap and a tun interface;

respectively.

In the latter case the user must have the permissions to create virtual interfaces. For kernels 2.6.18 and above this means that the system administrator must have already created the interfaces in advance in this way:

# tunctl -u username -t tap2
# tunctl -u username -t tun2

Setting IP addresses

Lwipv6 interfaces can be configured using the ip command like any other interface. Virtual interfaces start in down state, thus they must be activated.

$ ip link set vd0 up
$ ip addr add 192.168.1.1/24 dev vd0

Lwipv6 supports ipv6 autoconfiguration, thus if there is a radv server running on the virtual network the interface get automagically configured.

It is also possible to run a dhcp client.

For example this is the command to set up a vde interface using the udhcpc tool:

$ ip link set vd0 up
$ /sbin/udhcpc -i vd0 -q -s ~/etc/udhcpc/default.script
udhcpc (v0.9.9-pre) started
Nothing to flush.
Nothing to flush.
Sending discover...
Sending select for 192.168.1.1...
Lease of 192.168.1.1 obtained, lease time 600
Nothing to flush.
Nothing to flush.
adding dns 192.168.1.254
$

The contents of the ~/etc/udhcpc directory can be downloaded here: udhcpc.tar.bz2

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox