- stable rust toolchains:
rustup toolchain install stable - nightly rust toolchains:
rustup toolchain install nightly --component rust-src - bpf-linker:
cargo install bpf-linker(--no-default-featureson macOS)
Use cargo build, cargo check, etc. as normal.
Cargo build scripts are used to automatically build the eBPF correctly and include it in the program.
Before running the program, you need to setup a virtual network topology. You
can use the provided setup.sh script to create a network namespace and veth
pairs.
sudo ./setup.shThen change into the net2 namespace and run the program.
sudo ip netns exec net2 bash
RUST_LOG=debug ./target/debug/fast-ppIn a separate terminal, you can run the ping command to generate some traffic.
sudo ip netns exec net1 ping 192.168.10.2
sudo ip netns exec net1 ping 192.168.20.2Observe that the pings to 192.168.10.2 are processed by the kernel and pings
to 192.168.20.2 by fast-pp.
After you are done, you can run the cleanup.sh script to remove the network
namespace and veth pairs.
sudo ./cleanup.sh