Skip to content

Instantly share code, notes, and snippets.

@garyachy
Last active July 7, 2023 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save garyachy/0158bfee80274e2713acbedf79511706 to your computer and use it in GitHub Desktop.
Save garyachy/0158bfee80274e2713acbedf79511706 to your computer and use it in GitHub Desktop.
VPP testing using TAPs
#!/bin/bash
./build-root/build-vpp-native/vpp/bin/vppctl tap connect vpp1
./build-root/build-vpp-native/vpp/bin/vppctl tap connect vpp2
./build-root/build-vpp-native/vpp/bin/vppctl set interface state tapcli-0 up
./build-root/build-vpp-native/vpp/bin/vppctl set interface state tapcli-1 up
ip netns delete vpp1
ip netns delete vpp2
ip netns add vpp1
ip netns add vpp2
ip link set dev vpp1 netns vpp1
ip link set dev vpp2 netns vpp2
ip netns exec vpp1 ip link set vpp1 up
ip netns exec vpp2 ip link set vpp2 up
ip netns exec vpp1 ip addr add 192.168.0.1/24 dev vpp1
ip netns exec vpp2 ip addr add 192.168.0.2/24 dev vpp2
./build-root/build-vpp-native/vpp/bin/vppctl set interface l2 bridge tapcli-0 23
./build-root/build-vpp-native/vpp/bin/vppctl set interface l2 bridge tapcli-1 23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment