Help:Contents
From Cloonix wiki
Please refer to the documentation inside of the cloonix distribution you have downloaded. Following is the README from the 4.9 release
[snip]
########################################################## 31 Jan 2010 ########################################################## Hello and welcome to you, open-source user! This is a very sparse help, but my mail (clownix@clownix.net) is ready for any questions (Or bug reports).
########################################################## ################# STARTUP #################### ########################################################## The simplest way to proceed is just to call
./start_clownix_net
And Then
./graph
########################################################## ################# NECESSARY PACKAGES #################### ##########################################################
screen (mandatory!)
xterm (optional, used upon double-click on machines
in the graph client)
qemu-kvm (optional, used only for kvm machines)
qemu-img (same as above)
expect and telnet (for Cisco emulation)
For recompilation the cloonix_graph software embeds qemu-gtk and this needs:
gtk-vnc-devel
vte-devel
(Not the same names on a debian, libgtk-vnc-1.0-dev and libvte-dev)
########################################################## ################# SECONDARY NETWORK ############### ########################################################## You can have multiple cloonix networks in your machine: The simplest way to get the second network is just to call
./start_clownix_net_bis
And Then
./graph_bis
########################################################## ################# LINK NETWORKS ############### ########################################################## Your network can be linked by the tap/bridge method, but it is more elegant to use the tux/tip function and the tux2tux process.
Create a tux or tip in graph, then another tux or tip in graph_bis, then call ./tux2tux with the right parameters.
########################################################## ################# VIRTUAL MACHINES ##################### ########################################################## In this package are included OpenWrt based virtual machines, they are very light machines, so light that I have included both an UML instance and a KVM one. These machines are chosen to be the default ones, this makes this package plug-and-play. You can have heavier machine by downloading them and untarring them in the bulk directory: debian_uml ubuntu_uml ubuntu_kvm
I have made the UML-based machines with the debootstrap method
and the KVM-based with a cdrom installation. The KVM is very
big: approx 1G when tarred and 10G untarred.
The debootstrap method gives smaller machines approx 400M
tarred and 4G untarred, with those you can launch graphical
applications such as wireshark, but you do not have the desktop.
Note: The KVM root file-system is self-sufficient whereas the UML
file-system needs to have an associated linux binary running
in the host user world.
The associated linux binary must be put in the bulk directory
with the file-system.
Note: If you own a cisco ios (c7200-advipservicesk9-mz.124-9.T.bin)
put it in the bulk directory where you have the associated
dynamips binary that emulates the cisco hardware. You can
then launch the cisco demo which combines OpenWrt and a cisco
with ospf running between them.
See the how_to_create_vm to see how I created the machines, this help is mostly for me, it has no explanation, just commands that I copy-paste one after the other to be able to remake a machine from scratch. NOTE: For the KVM fedora, debian and ubuntu machines, remember to use the "ctrl-halt" key sequence to get the mouse inside/outside the virtual desktop screen called through the "qemu-gtk" desktop item on the menu. If it is really slow, probably the /dev/kvm part does not work, you have an old-fashion emulated qemu machine.
########################################################## ############# VIRTUAL MACHINES MODIFICATION ############ ########################################################## Basically you must mount and chroot into your file-systems to modify them, your host PC must be connected to internet.
See directory how_to_create_vm for the machine type you want to modify, then find hints in the README.
########################################################## ################# STARTUP CONFIG ################ ########################################################## The start_clownix_net file is a file that you can configure, it creates the following config file:
<cloonix_config>
<network_name> Cloonix-Net-Lab </network_name>
<server_name> /tmp/cloonix_switch/cloonix_unix_sock </server_name>
<server_port> 54321 </server_port>
<admin_tap_name> tap0 </admin_tap_name>
<admin_tux_name> tux0 </admin_tux_name>
<admin_tap_mac> 6A:0D:D9:F5:A9:21 </admin_tap_mac>
<admin_tap_ip> 10.1.1.1 </admin_tap_ip>
<admin_tap_mask> 255.0.0.0 </admin_tap_mask>
<work_dir> /tmp/cloonix_switch </work_dir>
<bulk_dir> __HERE__/bulk </bulk_dir>
<rsa_public_key> __HOME__/.ssh/id_rsa.pub </rsa_public_key>
</cloonix_config>
network_name is used to identify the screen session for this network.
server_name is the server unix socket of the daemon to receive orders.
server_port is the server port of the daemon to receive orders.
admin_tap_name is the host interface used for network administration.
admin_tux_name is not used now, but will be the internet access latter.
admin_tap_mac/admin_tap_ip/admin_tap_mask is tap0 config
admin_tap_ip will be used to create automatically admin adresses for
network guests.
work_dir is where all the working files will be stored.
bulk_dir is where you have to put all machine file-systems.
rsa_public_key is put in the guest's authorized_keys file to have
a system without anoying passwords to give.
########################################################## ################# GRAPH #################### ########################################################## Launch the software with ./graph (it is a script that calls cloonix_graph with parameters).
Drag a lan on the canvas, then double click on the lan.
Drag a machine on the canvas, then simple click on an interface of that machine. You have a half-link.
Double-click again on the lan, drag another machine, the machine runs away, it is part of the game!
simple-click on an interface. You have a full link.
The mouse wheel does a zoom when turned. The first button or mouse wheel when pressed on the canvas outside any object, does the pan function (translation of everything). There are context menus on many of the objects (called items in the software). Context menus are availlable through the right click.
The choice of the machine is a right click on the vm button.
On the real-time plot of the bandwidth, the time cursors can do a temporal zoom if you move those cursors and double-click on one of the cursors. To unzoom, double-click elsewhere than on the cursors.
########################################################## ################# OTHER CLIENTS #################### ########################################################## uml_cloonix_switch is a server, here are its clients:
graph, (gtk gui), is a client ctrl: Command line interface to control the uml_cloonix_switch.
demo_launch: call it with virtual_platform_configs/ospf_demo
as parameter, launches a demo.
event: call it with sys, print or stat, brings back events
from uml_cloonix_switch.
fconf: set or get a topology file, to save/restore a topology.
########################################################## ################# COMPILATION #################### ########################################################## To recompile, if you are in the cloonix source tree, ./doitall should rebuild all.
gtk-vnc-devel and vte-devel are needed for rebuild
For uml machines, linux is also a binary, to recompile it, you can try to use the how_to_create_vm/.../README.
########################################################## ################# KVM ############################### ########################################################## KVM_PORT_OFFSET 57000 is the offset used for the tcp socket used between the uml_clownix_switch and the kvm machines, this is annoying because ports are ressources that should not be taken for dialogs local to a machine, that is why I would like to make the unix sockets work between qemu and my switch. ########################################################## ################# NETWORKING DEMOES ################## ########################################################## From graph, right click on the canvas, "Load Topo" choose "virtual_platform_configs/olsr_demo_openwrt_uml/topology" For the topology syntax, look at topology files, they are xml files and should be easy to understand.
########################################################## ################# SERIAL INTERFACES ################## ########################################################## As the easiest implementation solution, the serial ports of machines are also connected between them with the lan lan drag-drop item. If you want to have the KVM serial interfaces linked, beware they are by default configured with echo and onlcr, if you want to use the serial ttyS1, you must do on both sides: stty -F /dev/ttyS1 -echo stty -F /dev/ttyS1 -onlcr ttyS0 in the KVM is used by the console, it is reserved, and you cannot connect it.
########################################################## ################# TAP, BRCTL AND ETH ON GRAPH ########## ########################################################## The graph software can help you in the making of a bridge to link the virtual network to the outside. A "br" is a lozange and reacts as a lan to connect things, but can link only taps and eths, because it only calls brctl which only works on the host's interfaces. When you link a bridge to an eth of the host, the eth of the host loses its ip address, so be carefull with it. If you are a teacher and do not trust your students on a connected sensible machine, you must forbid this function: go in "uml_cloonix_switch/src/recv_from_client.c", fonction "recv_brctl_req" and uncomment the 2 lines "FORBIDDEN COMMAND". If you really do not trust them at all, you can also forbid the tap creation: go in "uml_cloonix_switch/src/recv_from_client.c", fonction "recv_add_tap" and uncomment the 2 same lines.
########################################################## Great software, I use it all the time! Vincent Perrier ##########################################################
