Borjand / lightning-2.0

Lightning 2.0 - Extension of Lightning, a simple and lightweight network simulator based on Docker containers
GNU General Public License v3.0
0 stars 1 forks source link

:zap: lightning :zap:

Lightning 2.0 is a fork of the ptoribi/lightning repository, with the objective of including more network appliances to the network emulator based on Docker containers

Preview

Preview

About lightning

Lightning is a simple and lightweight network simulator based on Docker containers. Network scenarios are described in XML files that the program parses and interprets for launching the networks and containers desired. Direct execution of the lightning functions is also allowed. Two Docker images are set by default, called "host" and "router":

Compatibility

Debian 9 x86_64 (compatibility with more OS will be checked in the nearly future)

Before the installation

Before installing Lightning please check that your OS counts with the following dependencies:

Install the program

Please ensure before installing that those paths are included in your system's PATH variable. If you have no special needs the default values just work well.

After the installation:

The user "root" should not execute Lightning directly, only regular users should. Regular users must execute Lightning with root privileges, this can be done by using one of these four different ways:

Uninstall the program

$ sudo $(dirname $(readlink -f $(which lightning)))/uninstall

How to use the program

The XML files describing the scenarios must be stored in the folder "scenarios" inside the lightning installation folder, some default examples are provided. You can access it by executing:

$ cd $(dirname $(readlink -f $(which lightning)))/scenarios

For executing lightning, just type as a regular user in a shell:

$ lightning

For starting a network scenario:

$ lightning start SCENARIO_NAME

For stopping the last executed network scenario:

$ lightning stop

Author

Pablo Toribio (under supervision of Dr. C.J. Bernardos Cano)

EXTRAS (paaguti)

Remote execution of lightning

In specific cases, the terminals to access the lightning devices need to be launched from outside the VM.

In this case, when executing lightning start <scenario>, the Docker commands to access the different devices will be printed out to the console and to the file $HOME/commands. You can then feed this file into a script that launches local terminals in the host, which docker through SSH into the VM and access the different containers. Additionally, lightning will create the file $HOME/description.txt with a textual description of the scenario (in Spanish currently).

Check the value for REMOTE in variables.conf. If set to 0, it will work inside the VM, launching the terminals and presenting the scenario wallpaper. If set to 1 lightning will start inside the VM, but expect the terminals to access the containers to be executed in the host.

You can change the value of the REMOTE variable by launching lightning with the -R flag:

lightning -R <value for REMOTE> start <scenario>

The value should be 0 or 1 and will be kept until the next lightning update.

The default value for REMOTE is 0

sysctl customisation

Customisation for the sysctl.conf files inside the containers is provided by /usr/local/lightning/sysctl-router.conf for router containers and /usr/local/lightning/sysctl-host.conf for host containers. These files provide a way to define the default values of specific variables. Manipulation is still handled by lightning.