Work-in-progress!
sudo docker-compose rm --force
# --build
sudo docker-compose up --force-recreate --abort-on-container-exit --scale tofino_model=2
This is only a rough sketch on how to achive it:
- Create
n
tofino-model + Stratum instances - Create the veth pair (
stratumveth000
,stratumveth001
) for every tofino-model port for then
instances. - Leave
stratumveth000
in the "root" namespace in the host system, the other onestratumveth001
in the Docker container network namespace - Bridge the
stratumveth001
inside container toveth0
(= the first port of tofino-model)
Now, the stratumveth000
in the root namespace is connected with veth0
inside the first tofino-model container!
sudo ./link_ports.py --verbose
Voilá, the first port of the tofino-model switch is linked from within the Docker container into a host "root" namespace veth named stratumveth000
.
The stratumvethXXX
interfaces are deleted after you stop the Docker containers.
This is a very nice explanation/guide-through of network namespaces, especially for Docker.