Git Product home page Git Product logo

ebpf-lab's Introduction

eBPF Lab

This is a lab environment with example code from the book Learning eBPF by Liz Rice: https://github.com/lizrice/learning-ebpf

Lab Environment

A packer configuration was created in the packer folder to build and configure a Centos 9 stream VM with:

Unfortunately, some blockers (broken functionality, missing features) were encountered pretty early in the eBPF learning process when using the pre-built software from the distribution repositories. Therefore, most recent components are built from the main branch with the idea of a reproducible lab environment.

The Packer build allows to reproduce and develop the Lab image. To create the qemu image with Packer:

cd packer
packer build libvirt-centos9.pkr.hcl

Setup and Connect to Lab VM

Configure location of qemu image:

qemuimg=output/centos9-20230512-132055/centos9-20230512-132055.qcow2

Create the KVM lab VM:

sudo virt-install --name ebpf-lab --description "eBPF Lab" \
 --osinfo=centos-stream9 --ram=4096 --vcpus=2 \
 --disk path=$qemuimg --boot hd --wait 0 --autostart

Create a sample ssh config:

domip=$(sudo virsh -q domifaddr ebpf-lab | awk '{print $4}' | cut -d/ -f 1)

cat << EOF > ssh-config
Host ebpf-lab
    HostName $domip
    User root
EOF

Connect to the VM with password root:

ssh ebpf-lab -F ssh-config

Usage

  • Work as the root user

Lab cleanup

Remove the VM and associated resource:

sudo virsh destroy ebpf-lab
sudo virsh undefine ebpf-lab
rm ssh-config
rm $qemuimg

ebpf-lab's People

Contributors

in0rdr avatar

Stargazers

Toni Tauro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.