Format markdown

This commit is contained in:
Pim van Pelt
2025-05-02 15:36:16 +02:00
parent fa26fad53c
commit f80bcaa570

View File

@ -1,23 +1,27 @@
# VPP Containerlab Docker image # VPP Containerlab Docker image
This docker container creates a VPP instance based on the latest release. This docker container creates a VPP instance based on the latest release. It starts up as per
It starts up as per normal, using /etc/vpp/startup.conf (which Containerlab normal, using /etc/vpp/startup.conf (which Containerlab will replace), and once started, it'll
will replace), and once started, it'll execute /etc/vpp/bootstrap.vpp within execute /etc/vpp/bootstrap.vpp within the dataplane. There are three relevant files:
the dataplane. There are three relevant files:
1. manual-pre.vpp -- can be supplied by the user, to run any configuration 1. `manual-pre.vpp` -- can be supplied by the user, to run any configuration statements before
statements before containerlab takes control. containerlab takes control.
1. clab.vpp -- generated by containerlab. It will bind the vethpair interfaces
into the dataplane. 1. `clab.vpp` -- generated by containerlab. Its purpose is to bind the `vethpair` interfaces
1. manual-post.vpp -- can be supplied by the user, to run any configuration into theo dataplane (see below).
statements after containerlab is finished with its per-lab statements.
1. `manual-post.vpp` -- can be supplied by the user, to run any configuration statements after
containerlab is finished with its per-lab statements.
## Building ## Building
```bash
docker build -f Dockerfile.bookworm . -t pimvanpelt/vpp-containerlab docker build -f Dockerfile.bookworm . -t pimvanpelt/vpp-containerlab
```
## Starting the container ## Starting the container
```
docker network create --driver=bridge network2 --subnet=172.19.1.0/24 docker network create --driver=bridge network2 --subnet=172.19.1.0/24
docker rm clab-pim docker rm clab-pim
docker run --cap-add=NET_ADMIN --cap-add=SYS_NICE --cap-add=SYS_PTRACE \ docker run --cap-add=NET_ADMIN --cap-add=SYS_NICE --cap-add=SYS_PTRACE \
@ -26,21 +30,21 @@ docker run --cap-add=NET_ADMIN --cap-add=SYS_NICE --cap-add=SYS_PTRACE \
--privileged=True --name clab-pim \ --privileged=True --name clab-pim \
docker.io/pimvanpelt/vpp-containerlab docker.io/pimvanpelt/vpp-containerlab
docker network connect network2 clab-pim docker network connect network2 clab-pim
```
## Configuring VPP ## Configuring VPP
```
docker exec -it clab-pim vppctl docker exec -it clab-pim vppctl
```
and then within the VPP control shell:
```
vpp-clab# create host-interface v2 name eth1 vpp-clab# create host-interface v2 name eth1
vpp-clab# set interface name host-eth1 eth1 vpp-clab# set interface name host-eth1 eth1
vpp-clab# set interface mtu 1500 eth1 vpp-clab# set interface mtu 1500 eth1
vpp-clab# set interface ip address eth1 172.19.1.2/24 vpp-clab# set interface ip address eth1 172.19.1.2/24
vpp-clab# set interface ip address eth1 fec0::2/64 vpp-clab# set interface ip address eth1 fec0::2/64
vpp-clab# set interface state eth1 up vpp-clab# set interface state eth1 up
```
## References
https://s3-docs.fd.io/vpp/22.02/usecases/vpp_testbench/index.html
https://git.ipng.ch/ipng/drone-hugo
https://github.com/ligato/vpp-base/tree/master