Logo

dev-resources.site

for different kinds of informations.

Aya Rust tutorial Part Two - Setting up

Published at
5/9/2024
Categories
ebpf
rust
linux
networking
Author
stevelatif
Categories
4 categories in total
ebpf
open
rust
open
linux
open
networking
open
Author
10 person written this
stevelatif
open
Aya Rust tutorial Part Two - Setting up

© steve latif

Part Two: Setting up the Prerequisites

Assumptions

All the examples will be run on Ubuntu Linux. On other distributions your mileage may vary

First step: setup dependencies

Install packages

$ sudo apt install clang llvm libelf-dev libpcap-dev build-essential libc6-dev-i386  \
graphviz  make gcc libssl-dev bc libelf-dev libcap-dev clang gcc-multilib  \
libncurses5-dev git pkg-config libmnl-dev bison flex linux-tools-$(uname -r)
Enter fullscreen mode Exit fullscreen mode

Verify that you have bpftool installed on your system

$ sudo bpftool prog 
Enter fullscreen mode Exit fullscreen mode

If there are problems installing it from a package, you can install it from source:

$ git clone --recurse-submodules https://github.com/libbpf/bpftool.git
$ cd bpftool/src
$ make -j$(nproc)
$ sudo https://raw.githubusercontent.com/stevelatif/articles/main/blogs/bpftool prog
Enter fullscreen mode Exit fullscreen mode

Install rust, following the instructions at https://rustup.rs/

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Enter fullscreen mode Exit fullscreen mode

Once you have rust and cargo installed and in your path, install the following rust related tools:

$ rustup udpate
$ cargo install cargo-generate
$ cargo install bpf-linker
$ cargo install cargo-generate
$ cargo install rustfmt
$ cargo install bpf-linker
Enter fullscreen mode Exit fullscreen mode
ebpf Article's
30 articles in total
Favicon
Unlocking Cloud-Native Security with Cilium and eBPF
Favicon
Let’s Get Into the Weeds: The OSI Model and Why it Still Matters
Favicon
Expanding eBPF Compile Once, Run Everywhere(CO-RE) to Userspace Compatibility
Favicon
eBPF Practical Tutorial: Using eBPF to Trace Go Routine States
Favicon
Measuring Function Latency with eBPF
Favicon
The use of eBPF – in Netflix, GPU infrastructure, Windows programs and more
Favicon
eBPF Tutorial by Example 21: Programmable Packet Processing with XDP
Favicon
eBPF Tutorial by Example: Capturing TCP Information with XDP
Favicon
eBPF Development Practice: Modifying System Call Arguments with eBPF
Favicon
eBPF Developer Tutorial: XDP Load Balancer
Favicon
Using eBPF to Trace Nginx Requests
Favicon
Fast Packet IO
Favicon
eBPF: Revolutionizing Linux Kernel Programming
Favicon
Cilium no EKS [Lab Session]
Favicon
Fooling Port Scanners: Simulating Open Ports with eBPF and Rust
Favicon
Simple Firewall with Rust and Aya
Favicon
Aya Rust Tutorial part 5: Using Maps
Favicon
Aya Rust tutorial Part Four XDP Hello World
Favicon
eBPF, sidecars, and the future of the service mesh
Favicon
eBPF: Unleashing Kernel Magic for Modern Infrastructure
Favicon
Aya Rust tutorial Part Two - Setting up
Favicon
Aya Rust tutorial Part Three XDP Pass
Favicon
Aya Rust tutorial Part One
Favicon
Unveiling the Simplicity of Cluster Mesh for Kubernetes Deployments
Favicon
Beyond the Buzz: Embracing the Magic of eBPF in Kubernetes
Favicon
Wednesday Links - Edition 2023-03-13
Favicon
Why context matters in Kubernetes security 
Favicon
Programmability and Performance in the Linux Kernel by eBPF.
Favicon
eBPF, Service Mesh and Sidecar
Favicon
eBPF Tutorial by Example 16: Monitoring Memory Leaks

Featured ones: