An open API service indexing awesome lists of open source software.

https://github.com/msune/l2radar

An eBPF L2 neighbour tracker
https://github.com/msune/l2radar

ebpf l2 security sniffing

Last synced: 12 days ago
JSON representation

An eBPF L2 neighbour tracker

Awesome Lists containing this project

README

          



Built with Claude Code

CI


L2 Radar


(Mostly) generated Claude Code Β· Directed & reviewed by a human πŸ§‘


# πŸ“‘ `l2radar`

**Passive L2 neighbour monitor powered by eBPF.** See every device on your
network β€” MACs, IPs, vendors β€” without sending a single packet.

L2 Radar attaches eBPF probes to your network interfaces via
[TCX ingress](https://docs.kernel.org/bpf/), silently observes regular traffic,
ARP and NDP traffic, and presents everything in a slick dark-themed dashboard.

## 🎬 Demo


L2Radar dashboard demo

## ✨ Features

- 🐝 **eBPF-powered** β€” zero packet injection, zero interference, zero overhead
- πŸ” **ARP + NDP parsing** β€” discovers IPv4 and IPv6 neighbours automatically
- 🏭 **OUI vendor lookup** β€” resolves MAC addresses to manufacturer names
- 🌐 **Web dashboard** β€” real-time, searchable, sortable, mobile-friendly
- πŸ”’ **HTTPS + auth** β€” TLS and basic auth out of the box

## πŸš€ Quick Start

**1. Install `l2rctl`:**

```bash
curl -fsSL https://raw.githubusercontent.com/msune/l2radar/latest/install-l2rctl.sh | bash
```

To install a specific version:

```bash
curl -fsSL https://raw.githubusercontent.com/msune/l2radar/latest/install-l2rctl.sh | bash -s -- v0.1.0
```

**2. Start everything:**

```bash
l2rctl start
```

**3. Open the dashboard:**

πŸ‘‰ **https://localhost** (accept the self-signed cert)

That's it! L2 Radar is now watching all your external interfaces. πŸŽ‰

## πŸ“– Usage

```bash
# Start only the probe (headless)
l2rctl start probe --iface eth0 --iface wlan0

# Start with custom TLS certs
l2rctl start --tls-dir /etc/mycerts --user admin:secret

# Check what's running
l2rctl status

# Dump the neighbour table from the terminal
l2rctl dump --iface eth0

# Stop everything
l2rctl stop
```

### Interface Keywords

| Keyword | Meaning |
|---------|---------|
| `external` (default) | All external interfaces (skips docker, veth, bridges) |
| `any` | Every non-loopback L2 interface (includes docker, veth, bridges) |

## πŸ—οΈ Architecture

L2 Radar has three components:

| Component | Container | What it does |
|-----------|-----------|-------------|
| **eBPF Probe** | `l2radar` | Attaches to NICs, writes neighbour data to BPF maps, exports JSON |
| **Web UI** | `l2radar-ui` | nginx + React dashboard, serves JSON data read-only |
| **l2rctl** | _(host binary)_ | Orchestrates the containers via Docker CLI |

The probe and UI communicate through **JSON files on a shared Docker named
volume** (default `l2radar-data`, mounted at `/var/lib/l2radar` in both
containers) β€” no network calls between them.

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” l2radar-data volume β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ eBPF Probe β”‚ neigh-eth0.json β”‚ Web UI β”‚
β”‚ │──────────────────────────────▢│ β”‚
β”‚ TCX ingress hooks β”‚ neigh-wlan0.json β”‚ nginx + React SPA β”‚
β”‚ ARP/NDP parsing │──────────────────────────────▢│ auto-refresh polls β”‚
β”‚ JSON export loop β”‚ (read-only) β”‚ OUI vendor lookup β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
privileged ports 443 (80)
--network=host unprivileged
```

πŸ“š **[Full architecture docs β†’](docs/architecture.md)**

## πŸ“‹ Requirements

- Linux with kernel **6.6+** (for TCX)
- Docker
- Go 1.24+ (for installing `l2rctl`)

## πŸ› οΈ Development

TODO

## πŸ“„ License

BSD 2-Clause. eBPF code (`probe/bpf/`) is dual-licensed BSD-2-Clause OR
GPL-2.0. See [LICENSE](LICENSE).


Made with ❀️ from Barcelona · Powered by 🐝 eBPF