Skip to content

Instantly share code, notes, and snippets.

@lixit
Created November 26, 2019 07:17
Show Gist options
  • Save lixit/a3ab790b9102dc211eceb0999a138c66 to your computer and use it in GitHub Desktop.
Save lixit/a3ab790b9102dc211eceb0999a138c66 to your computer and use it in GitHub Desktop.

WHAT IS VECTOR PACKET PROCESSING (VPP)?
FD.io VPP is the Swiss Army knife of networking toolchains - enabling astounding software packet processing.

Switching

Start VPP

cat startup1.conf
unix {cli-listen /run/vpp/cli-vpp1.sock}
api-segment { prefix vpp1 }
plugins { plugin dpdk_plugin.so { disable } }

cat startup2.conf
unix {cli-listen /run/vpp/cli-vpp2.sock}
api-segment { prefix vpp2 }
plugins { plugin dpdk_plugin.so { disable } }

sudo /usr/bin/vpp -c startup1.conf
sudo vppctl -s /run/vpp/cli-vpp1.sock

sudo /usr/bin/vpp -c startup2.conf

# kill all
ps -eaf | grep vpp
ps -ef | grep vpp | awk '{print $2}'| xargs sudo kill

Create veth interfaces on host

sudo ip link add name vpp1out type veth peer name vpp1host

sudo ip link set dev vpp1out up
sudo ip link set dev vpp1host up

sudo ip addr add 10.10.1.1/24 dev vpp1host
ip addr show vpp1host

Create vpp host-interface

sudo vppctl -s /run/vpp/cli-vpp1.sock

vpp# create host-interface name vpp1out
vpp# show hardware
vpp# set int state host-vpp1out up
vpp# show int

vpp# set int ip address host-vpp1out 10.10.1.1/24
vpp# show int addr
sudo ip link add name vpp1vpp2 type veth peer name vpp2vpp1

sudo vppctl -s /run/vpp/cli-vpp1.sock
vpp# create host-interface name vpp1vpp2
vpp# set int state host-vpp1vpp2 up

sudo vppctl -s /run/vpp/cli-vpp2.sock
vpp# create host-interface name vpp2vpp1
vpp# set int state host-vpp2vpp1 up

Configure Bridge Domain on vpp1

sudo vppctl -s /run/vpp/cli-vpp1.sock

vpp# show bridge-domain
vpp# set int l2 bridge host-vpp1out 1
vpp# set int l2 bridge host-vpp1vpp2  1

vpp# show bridge-domain 1 detail

Configure loopback interface on vpp2

sudo vppctl -s /run/vpp/cli-vpp2.sock

vpp# create loopback interface
vpp# set int ip address loop0 10.10.1.2/24
vpp# set int state loop0 up

Configure bridge domain on vpp2

sudo vppctl -s /run/vpp/cli-vpp2.sock

vpp# show bridge-domain
vpp# set int l2 bridge loop0 1 bvi
vpp# set int l2 bridge host-vpp2vpp1  1

Install in Ubuntu

apt-get update

# create the file `/etc/apt/sources.list.d/99fd.io.list` that contain the following contents:
# deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu bionic main

curl -L https://packagecloud.io/fdio/release/gpgkey | sudo apt-key add -

sudo apt-get update
sudo apt-get install vpp vpp-plugin-core vpp-plugin-dpdk

# install optional packages
sudo apt-get install vpp-api-python python3-vpp-api vpp-dbg vpp-dev

# uninstall the packages
sudo apt-get remove --purge vpp*

Building VPP

git clone https://gerrit.fd.io/r/vpp
cd vpp

# install ninja - Small build system with a focus on speed
# Arch Linux: pacman -S ninja

# install libnuma package:
# Arch: pacman -S numactl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment