Skip to content

Commit b3e73b2

Browse files
authored
Merge pull request #262 from KatharaFramework/develop
Kathará v3.7.1
2 parents aaa0b72 + 2d82e45 commit b3e73b2

File tree

80 files changed

+3256
-1410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3256
-1410
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ body:
2222
attributes:
2323
label: Kathará Version
2424
description: "Please provide the Kathará version you are using (`kathara -v`)."
25-
placeholder: "3.7.0"
25+
placeholder: "3.7.1"
2626
validations:
2727
required: true
2828
- type: textarea

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We release patches for security vulnerabilities only for the last version:
66

77
| Version | Supported Versions |
88
|---------|--------------------|
9-
| 3.7.0 | :white_check_mark: |
9+
| 3.7.1 | :white_check_mark: |
1010

1111
## Reporting a Vulnerability
1212

docs/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ build-%: docker-build-image
1111

1212
docker-build-image:
1313
cp ../scripts/Linux-Deb/Docker-Linux-Build/Dockerfile_template ../scripts/Linux-Deb/Docker-Linux-Build/Dockerfile
14-
sed -i -e "s|__DISTRO__|focal|g" ../scripts/Linux-Deb/Docker-Linux-Build/Dockerfile
14+
sed -i -e "s|__DISTRO__|jammy|g" ../scripts/Linux-Deb/Docker-Linux-Build/Dockerfile
15+
sed -i -e "s|__NOKOGIRI__||g" ../scripts/Linux-Deb/Docker-Linux-Build/Dockerfile
1516
cd ../scripts/Linux-Deb/Docker-Linux-Build/ && docker build -t kathara/linux-build-deb .
1617
rm -f ../scripts/Linux-Deb/Docker-Linux-Build/Dockerfile
1718

docs/footer.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ People involved also include:
1818

1919
## COPYRIGHT
2020

21-
Copyright © 2017-2021 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
21+
Copyright © 2017-2024 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
2222
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

docs/kathara-check.1.ronn

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ Should give an output like this:
2323

2424
* Current Manager is: `<your_manager_name>`
2525
* Manager version is: `<your_manager_version>`
26-
* Trying to run `Hello World` container...
27-
* Container run successfully.
2826
* Python version is: `<python_version_used>`
2927
* Kathara version is: `<kathara_version>`
28+
* Operating System version is: `<your_os>`
29+
* Trying to run container with `<your_default_image>` image...
30+
* Container run successfully.
3031

3132
**NOTE:** If you are using the released version, the Python version could be different from the one installed in your system because it is packed into the Kathara binary.
3233

docs/kathara-lab.conf.5.ronn

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,59 @@ The main network scenario configuration file. In this file you can specify the n
88

99
This file is a list of `device[arg]=value` assignments, where `arg` can be an integer value or the name of an option (described below).
1010

11-
If `arg` is an integer value, then `value` is the name of the collision domain to which interface eth`arg` of device `device` must be connected (note that the name of the collision domain must not contain spaces (" "), commas (",") and dots ("."). For example, `pc1[0]=CD1` means that interface eth0 of device pc1 will be connected to collision domain CD1.
11+
In order to establish a uniform convention, comment lines should always start with a hash character (`#`).
1212

13-
If `arg` is an option name, then `device` will be launched with option `arg` set to value `value`.
13+
## DEVICE INTERFACES
1414

15-
In order to establish a uniform convention, comment lines should always start with a hash character (`#`).
15+
If `arg` is an integer value, then `value` is the name of the collision domain to which interface eth`arg` of device `device` must be connected. The syntax is as follows:
16+
17+
- `arg`: An integer value representing the interface number (e.g., 0).
18+
- `CD1`: The name of the collision domain to which the specified interface must be connected. Note that the name of the collision domain must not contain spaces (" "), commas (",") and dots (".").
19+
- `/MAC_ADDR`: An optional parameter to specify the MAC address of the interface of `device` (MAC address must be in the format `XX:XX:XX:XX:XX:XX`). If `MAC_ADDR` is not provided, Kathara will assign a random one.
20+
21+
### EXAMPLES
22+
23+
1. Connect eth0 of `pc1` to collision domain `CD1` with a random MAC address:
24+
```
25+
pc1[0]="CD1"
26+
```
27+
28+
2. Connect eth1 of `pc1` to collision domain `CD2` with the specified MAC address:
29+
```
30+
pc1[1]="CD2/02:42:ac:11:00:02"
31+
```
1632

1733
## DEVICE OPTIONS
1834

35+
If `arg` is an option name, then `device` will be launched with option `arg` set to value `value`.
36+
1937
* `image` (string):
20-
Docker image used for this device.
38+
Docker image used for this device.
2139

2240
* `mem` (string):
23-
Set the amount of available RAM inside the device. If you set this option, the minimum allowed value is 4m (4 megabyte).
41+
Set the amount of available RAM inside the device. If you set this option, the minimum allowed value is 4m (4 megabyte).
2442

25-
This option takes a positive integer, followed by a suffix of "b", "k", "m", "g", to indicate bytes, kilobytes, megabytes, or gigabytes.
43+
This option takes a positive integer, followed by a suffix of "b", "k", "m", "g", to indicate bytes, kilobytes, megabytes, or gigabytes.
2644

2745
* `cpus` (float):
28-
Limit the amount of CPU available for this device.
46+
Limit the amount of CPU available for this device.
2947

30-
This option takes a positive float, ranging from 0 to max number of host logical CPUs. For instance, if the host device has two CPUs and you set `device[cpus]=1.5`, the device is guaranteed at most one and a half of the CPUs.
48+
This option takes a positive float, ranging from 0 to max number of host logical CPUs. For instance, if the host device has two CPUs and you set `device[cpus]=1.5`, the device is guaranteed at most one and a half of the CPUs.
3149

3250
* `port` (string):
33-
Map localhost port HOST to the internal port GUEST of the device for the specified PROTOCOL. The syntax is [HOST:]GUEST[/PROTOCOL].
51+
Map localhost port HOST to the internal port GUEST of the device for the specified PROTOCOL. The syntax is [HOST:]GUEST[/PROTOCOL].
3452

35-
If HOST port is not specified, default is 3000. If PROTOCOL is not specified, default is `tcp`. Supported PROTOCOL values are: tcp, udp, or sctp.
36-
For instance, with this command you can map host's port 8080 to device's port 80 with TCP protocol: `device[port]="8080:80/tcp"`.
53+
If HOST port is not specified, default is 3000. If PROTOCOL is not specified, default is `tcp`. Supported PROTOCOL values are: tcp, udp, or sctp.
54+
For instance, with this command you can map host's port 8080 to device's port 80 with TCP protocol: `device[port]="8080:80/tcp"`.
3755

3856
* `bridged` (boolean):
39-
Connect the device to the host network by adding an additional network interface. This interface will be connected to the host network through a NAT connection.
57+
Connect the device to the host network by adding an additional network interface. This interface will be connected to the host network through a NAT connection.
4058

4159
* `ipv6` (boolean):
42-
Enable or disable IPv6 on this device.
60+
Enable or disable IPv6 on this device.
4361

4462
* `exec` (string):
45-
Run a specific shell command inside the device during the startup phase.
63+
Run a specific shell command inside the device during the startup phase.
4664

4765
* `sysctl` (string):
4866
Set a sysctl option for this device. Only the `net.` namespace is allowed to be set. Can be set multiple times per device, each will add a new entry (unless the same config item is used again).
@@ -51,10 +69,10 @@ In order to establish a uniform convention, comment lines should always start wi
5169
Set an environment variable for the device. Can be set multiple times per device, each will add a new entry (unless the same variable is used again). The format is: ENV_NAME=ENV_VALUE.
5270

5371
* `shell` (string):
54-
Use the specified shell to connect to the device, e.g., when `kathara connect` is called.
72+
Use the specified shell to connect to the device, e.g., when `kathara connect` is called.
5573

5674
* `num_terms` (integer):
57-
Choose the number of terminals to open for this device.
75+
Choose the number of terminals to open for this device.
5876

5977
## NETWORK SCENARIO META INFORMATION
6078

@@ -69,32 +87,33 @@ It is also possible to provide descriptive information about a network scenario
6987

7088
## EXAMPLE
7189

72-
LAB_NAME="Example"
73-
LAB_DESCRIPTION="A simple example of lab.conf"
74-
LAB_VERSION=1.0
75-
LAB_AUTHOR="Kathara Authors"
76-
77-
LAB_WEB=http://www.kathara.org/
90+
Example of a `lab.conf`(5) file.
7891

79-
r1[0]="A"
80-
r1[1]="B"
81-
r1[port]="32000"
82-
r1[image]="namespace/image_name"
83-
r1[sysctl]="net.ipv6.conf.all.forwarding=1"
92+
LAB_NAME="Example"
93+
LAB_DESCRIPTION="A simple example of lab.conf"
94+
LAB_VERSION=1.0
95+
LAB_AUTHOR="Kathara Authors"
96+
97+
LAB_WEB=http://www.kathara.org/
8498

85-
r2[0]="C"
86-
r2[1]="B"
87-
r2[port]="2000:500/udp"
88-
r2[exec]="echo Hi"
99+
r1[0]="A"
100+
r1[1]="B/02:42:ac:11:00:02" # Specify the MAC address assigned to interface eth1 of r1
101+
r1[port]="32000"
102+
r1[image]="namespace/image_name"
103+
r1[sysctl]="net.ipv6.conf.all.forwarding=1"
89104

90-
pc1[0]="A"
91-
pc1[bridged]="true"
105+
r2[0]="C"
106+
r2[1]="B"
107+
r2[port]="2000:500/udp"
108+
r2[exec]="echo Hi"
92109

93-
pc2[0]="C"
94-
pc2[mem]="128m"
95-
pc2[shell]="/bin/sh"
110+
pc1[0]="A"
111+
pc1[bridged]="true"
112+
113+
pc2[0]="C"
114+
pc2[mem]="128m"
115+
pc2[shell]="/bin/sh"
96116

97-
Example of a `lab.conf`(5) file.
98117

99118
m4_include(footer.txt)
100119

docs/kathara-lconfig.1.ronn

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kathara-lconfig(1) -- Attach network interfaces to a running Kathara device of a
44

55
## SYNOPSIS
66

7-
`kathara lconfig` [`-h`] [`-d` <DIRECTORY>] `-n` <DEVICE_NAME> (`--add` <CD> [<CD> ...] \| `--rm` <CD> [<CD> ...])
7+
`kathara lconfig` [`-h`] [`-d` <DIRECTORY>] `-n` <DEVICE_NAME> (`--add` <CD[/MAC_ADDR]> [<CD[/MAC_ADDR]> ...] \| `--rm` <CD> [<CD> ...])
88

99
## DESCRIPTION
1010

@@ -24,25 +24,34 @@ Manage the network interfaces of a running Kathara device in a network scenario.
2424
* `-n` <DEVICE_NAME>, `--name` <DEVICE_NAME>:
2525
Name of the device to configure.
2626

27-
* `--add` <CD> [<CD> ...]:
28-
Specify the collision domain to add.
29-
30-
Equip the device with an additional network interface attached to a (virtual) collision domain whose name is <CD>. The number of the resulting network interface is generated incrementing the number of the last network interface used by the device.
27+
* `--add` <CD[/MAC_ADDR]> [<CD[/MAC_ADDR]> ...]:
28+
Specify the collision domain to be connected to the device:
29+
30+
`CD`: The name of the collision domain to which the specified interface must be connected. Note that the name of the collision domain must not contain spaces (" "), commas (",") and dots (".").
31+
32+
`/MAC_ADDR`: An optional parameter to specify the MAC address of the interface (MAC address must be in the format `XX:XX:XX:XX:XX:XX`). If `MAC_ADDR` is not provided, Kathara will assign a random one.
33+
34+
Equip the device with an additional network interface attached to a (virtual) collision domain whose name is <CD>.
35+
The number of the resulting network interface is generated incrementing the number of the last network interface used by the device.
3136

3237
* `--rm` <CD> [<CD> ...]:
33-
Specify the collision domain to remove.
38+
Specify the collision domain to be disconnected from the device.
3439

3540
Disconnect the device from the collision domain whose name is <CD> and remove the corresponding interface.
3641

3742
## EXAMPLES
3843

44+
Connect `pc1` to collision domain `X` and `Y` (with random MAC addresses):
45+
3946
kathara lconfig -d path/to/network_scenario -n pc1 --add X Y
4047

41-
Two new interfaces will be added to the device pc1 in the network scenario located in "path/to/network_scenario": the first one will be attached to the collision domain named X, while the other one to the collision domain named Y. Both the interfaces will have to be configured by hand inside the device (for example, by using ifconfig).
42-
43-
kathara vconfig -n pc1 --rm X
48+
Connect `pc1` to collision domain `X` with the specified MAC address:
49+
50+
kathara lconfig -d path/to/network_scenario -n pc1 --add X/00:00:00:00:00:01
4451

45-
pc1, in the network scenario located in "path/to/network_scenario", will be disconnected from the collision domain named X and the corresponding network interface will be removed.
52+
Disconnect `pc1` from collision domain `X` and remove the corresponding interface:
53+
54+
kathara lconfig -d path/to/network_scenario -n pc1 --rm X
4655

4756
m4_include(footer.txt)
4857

docs/kathara-vconfig.1.ronn

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kathara-vconfig(1) -- Attach network interfaces to a running Kathara device
44

55
## SYNOPSIS
66

7-
`kathara vconfig` [`-h`] `-n` <DEVICE_NAME> (`--add` <CD> [<CD> ...] \| `--rm` <CD> [<CD> ...])
7+
`kathara vconfig` [`-h`] `-n` <DEVICE_NAME> (`--add` <CD[/MAC_ADDR]> [<CD[/MAC_ADDR]> ...] \| `--rm` <CD> [<CD> ...])
88

99
## DESCRIPTION
1010

@@ -18,26 +18,35 @@ Manage the network interfaces of a running Kathara device. The affected device i
1818
* `-n` <DEVICE_NAME>, `--name` <DEVICE_NAME>:
1919
Name of the device to manage.
2020

21-
* `--add` <CD> [<CD> ...]:
22-
Specify the collision domain to add.
23-
24-
Equip the device with an additional network interface attached to a (virtual) collision domain whose name is <CD>. The number of the resulting network interface is generated incrementing the number of the last network interface used by the device.
21+
* `--add` <CD[/MAC_ADDR]> [<CD[/MAC_ADDR]> ...]:
22+
Specify the collision domain to be connected to the device:
23+
24+
`CD`: The name of the collision domain to which the specified interface must be connected. Note that the name of the collision domain must not contain spaces (" "), commas (",") and dots (".").
25+
26+
`/MAC_ADDR`: An optional parameter to specify the MAC address of the interface (MAC address must be in the format `XX:XX:XX:XX:XX:XX`). If `MAC_ADDR` is not provided, Kathara will assign a random one.
27+
28+
Equip the device with an additional network interface attached to a (virtual) collision domain whose name is <CD>.
29+
The number of the resulting network interface is generated incrementing the number of the last network interface used by the device.
2530

2631
* `--rm` <CD> [<CD> ...]:
27-
Specify the collision domain to remove.
32+
Specify the collision domain to be disconnected from the device.
2833

2934
Disconnect the device from the collision domain whose name is <CD> and remove the corresponding interface.
3035

3136
## EXAMPLES
3237

38+
Connect `pc1` to collision domain `X` and `Y` (with random MAC addresses):
39+
3340
kathara vconfig -n pc1 --add X Y
3441

35-
Two new interfaces will be added to the device pc1: the first one will be attached to the collision domain named X, while the other one to the collision domain named Y. Both the interfaces will have to be configured by hand inside the device (for example, by using ifconfig).
42+
Connect `pc1` to collision domain `X` with the specified MAC address:
43+
44+
kathara vconfig -n pc1 --add X/00:00:00:00:00:01
3645

46+
Disconnect `pc1` from collision domain `X` and remove the corresponding interface:
47+
3748
kathara vconfig -n pc1 --rm X
3849

39-
pc1 will be disconnected from the collision domain named X and the corresponding network interface will be removed.
40-
4150
m4_include(footer.txt)
4251

4352
## SEE ALSO

docs/kathara-vstart.1.ronn

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ kathara-vstart(1) -- Start a new Kathara device
66

77
`kathara vstart` `-n` <DEVICE_NAME>
88
[`-h`] [`--noterminals` | `--terminals` | `--privileged` | `--num_terms` <NUM_TERMS>]
9-
[`--eth` <N\:CD> [<N\:CD> ...]]
9+
[`--eth` <N:CD[/MAC_ADDR]> [<N:CD[/MAC_ADDR]> ...]]
1010
[`-e` [<EXEC_COMMANDS> [<EXEC_COMMANDS> ...]]] [`--mem` <MEM>]
1111
[`--cpus` <CPUS>] [`-i` <IMAGE>] [`--no-hosthome` \| `--hosthome`]
1212
[`--xterm` <XTERM>] [`--print`] [`--bridged`]
@@ -42,9 +42,13 @@ Notice: unless differently stated, command line arguments (DEVICE_NAME) and opti
4242
* `-n` <DEVICE_NAME>, `--name` <DEVICE_NAME>:
4343
Name of the device to be started.
4444

45-
* `--eth` <N\:CD> [<N\:CD> ...]:
45+
* `--eth` <N:CD[/MAC_ADDR]> [<N:CD[/MAC_ADDR]> ...]:
4646
Set a specific interface on a collision domain.
47-
47+
48+
`CD`: The name of the collision domain to which the specified interface must be connected. Note that the name of the collision domain must not contain spaces (" "), commas (",") and dots (".").
49+
50+
`/MAC_ADDR`: An optional parameter to specify the MAC address of the interface (MAC address must be in the format `XX:XX:XX:XX:XX:XX`). If `MAC_ADDR` is not provided, Kathara will assign a random one.
51+
4852
Equip the device with a network interface. `N` is a positive integer starting from 0.
4953
The network interface will be attached to a (virtual) collision domain whose name is `CD`. Attaching interfaces of different devices to the same collision domain allows them to exchange network traffic. <N> should be declared as a sequential number, starting from 0; if any intermediate number is missing an exception is raised.
5054

docs/kathara.conf.5.ronn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ Each Manager specifies additional parameters which are used only when the Manage
9797

9898
Default to `Prompt`.
9999

100-
* `shared_cd` (boolean):
101-
This parameter allows to connect devices of different users to the same collision domains.
100+
* `shared_cds` (integer):
101+
This parameter allows to connect devices of different network scenarios and users to the same collision domains.
102102

103-
Default to `false`.
103+
Default to `1` (enum value for `Not Shared`).
104104

105105
* `remote_url` (string):
106106
This parameter specifies a Remote Docker daemon URL to connect to, instead of a local one.
@@ -154,7 +154,7 @@ Each Manager specifies additional parameters which are used only when the Manage
154154
"hosthome_mount": false,
155155
"shared_mount": true,
156156
"image_update_policy": "Prompt",
157-
"shared_cd": false,
157+
"shared_cds": 1,
158158
"remote_url": null,
159159
"cert_path": null,
160160
"network_plugin": "kathara/katharanp_vde"

0 commit comments

Comments
 (0)