Skip to content

Instantly share code, notes, and snippets.

@ozaki-r
Created September 19, 2021 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozaki-r/b1b6c3af2e1800cd1a74a641ade32071 to your computer and use it in GitHub Desktop.
Save ozaki-r/b1b6c3af2e1800cd1a74a641ade32071 to your computer and use it in GitHub Desktop.
ip link add name tx-veth0 type veth peer name tx-veth1
ip netns add af_xdp
ip link set tx-veth1 netns af_xdp
ip link add name rx-veth0 type veth peer name rx-veth1
ip link set rx-veth1 netns af_xdp
ip link set up dev tx-veth0
ip link set up dev rx-veth0
ip a add 10.0.1.2/24 dev tx-veth0
ip a add 10.0.2.2/24 dev rx-veth0
ip netns exec af_xdp ip a add 10.0.1.1/24 dev tx-veth1
ip netns exec af_xdp ip a add 10.0.2.1/24 dev rx-veth1
ip netns exec af_xdp ip link set up dev tx-veth1
ip netns exec af_xdp ip link set up dev rx-veth1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment