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

https://github.com/thisseanzhang/landscape

The goal is to easily configure your favorite Linux distribution as a router using the web UI
https://github.com/thisseanzhang/landscape

dns-server ebpf-tc landscape-router linux netns network-programming networking-tools router rust tproxy

Last synced: 4 days ago
JSON representation

The goal is to easily configure your favorite Linux distribution as a router using the web UI

Awesome Lists containing this project

README

          

# Landscape - Linux Router Configuration Tool

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-ThisSeanZhang%2Flandscape-blue.svg?logo=data\:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/ThisSeanZhang/landscape)

Landscape is a web-based tool that helps you easily configure your favorite Linux distribution as a router.

> Built with Rust / eBPF / AF_PACKET.

[简体中文](./README.zh.md) | [English](./README.md)

> For more information, please read the [documentation](https://landscape.whileaway.dev/en/introduction.html).

## Screenshot
![](main.png)

---

## CORE Features
* Traffic diversion control (SIP-CIDR, MAC, DIP, domain, Geo matching rules)
* eBPF routing
* Independent DNS configuration and caching for each flow (to prevent DNS pollution and leaks)
* Traffic import into Docker containers
* Geo management

---

## Features

> ✅ Implemented and tested
> ⚠ Functional but untested
> ❌ Not implemented

* IP Configuration
* *Static IP*

* ✅ Set IP address
* ✅ Configure default route via gateway
* *DHCP Client*

* ✅ Specify hostname
* ❌ Custom DHCP options
* *PPPoE (PPPD version)*

* ✅ Set as default route
* ⚠ Multi-interface dialing
* ✅ Specify interface name
* *PPPoE (eBPF version)*

* ✅ Protocol core implemented
* ❌ GRO/GSO causing oversized packets (unsolved)
* *DHCP Server*

* ✅ Provide basic IP assignment and renewal
* ✅ Custom gateway/subnet/access rules
* ✅ IP-MAC binding
* ✅ IP lease display
* *IPv6 Support*

* ✅ Use DHCPv6-PD to request prefix from upstream
* ✅ Use RA to advertise multiple prefixes to downstream

* Flow Control Module

* ✅ Tag flows using IP / MAC
* ✅ Each flow can have its own DNS settings and cache
* ✅ Route marked traffic based on rules (direct/drop/reuse port/redirect to Docker or NIC)
* ❌ Assign tracking marks to specified packets
* ✅ External IP behavior control via tagging and `geoip.dat` support
* ✅ When IP rules and DNS rules conflict, the priority of the rules is used for verdict (the smaller the value, the higher the priority)

* Geo Management

* ✅ Manage multiple Geo sources
* ✅ Auto-update Geo IP/Site data

* DNS

* ✅ Support DNS over HTTPS, DNS over TLS and DNS over Quic for upstream
* ✅ Assign specific upstream DNS by domain
* ✅ DNS Hijacking (return A / AAAA records)
* ❌ Hijack to return multiple records (example: TXT / CNAME and other)
* ✅ Tag resolved IPs and handle with traffic control
* ✅ Support GeoSite files
* ❌ Parse Docker container domain labels into DNS records
* ✅ Test domain resolution

* NAT (eBPF)

* ✅ Basic NAT support
* ✅ Static mapping / Port forwarding
* ✅ NAT disables port reuse by default; reuse allowed via tagging rules

* Metrics

* ✅ Report connection stats (bytes/packets) every 5 seconds
* ✅ Display active connections (not yet combined with NAT)
* ❌ Open export API for metrics

* Docker

* ✅ Basic Docker container management and runtime
* ⚠ Pull images
* ✅ Route traffic into TProxy-enabled containers

* Wi-Fi

* ✅ Enable/disable Wi-Fi using `iw`
* ✅ Create AP with `hostapd`
* ❌ Connect to existing Wi-Fi hotspot

* Storage

* ✅ Use database instead of file-based config
* ✅ Export all current configs as `landscape_init.toml`
* ❌ UI component to upload/restore config
* ❌ Config editor via UI
* ❌ Separate DB path for metrics

* Miscellaneous

* ✅ Login screen
* ❌ English UI frontend
* ✅ NIC XPS/RPS optimization to distribute load across CPU cores

---

## How to Start & Limitations

### System Requirements

* Supported Linux Kernel: `6.9` or later
* The Linux kernel enables BTF/BPF functionality. See the [documentation](https://landscape.whileaway.dev/attention.html) for details.
* (Optional) `docker`

### Manual Startup
1. Create config directory:

```bash
mkdir -p /root/.landscape-router
```
2. Download **static.zip** from [release](https://github.com/ThisSeanZhang/landscape/releases) and extract to `/root/.landscape-router/static`
3. It can be started without configuring any files, but if you want to initialize it automatically via a configuration file.
refer to [Config](https://landscape.whileaway.dev/config/) to create `landscape_init.toml`
4. Start the service by downloading a release binary from [Releases](https://github.com/ThisSeanZhang/landscape/releases)
Then run (as root):

```bash
./landscape-webserver
```

Default HTTP port: **6300**

Default HTTPS port: **6443**

Default username: **root**

Default password: **root**

Use `./landscape-webserver --help` for other options.
5. Once everything is confirmed to work, you can set it up as a systemd service.
Create `/etc/systemd/system/landscape-router.service` with the following content:

```text
[Unit]
Description=Landscape Router

[Service]
ExecStart=/root/landscape-webserver # remember to modify this path accordingly
Restart=always
User=root
LimitMEMLOCK=infinity

[Install]
WantedBy=multi-user.target
```

### Armbian Integration

See [Armbian Integration Guide](https://landscape.whileaway.dev/compilation/armbian.html)

---

## Build Instructions

See [Build Documentation](https://landscape.whileaway.dev/compilation/) or [Cross-compilation Guide](https://landscape.whileaway.dev/compilation/cross.html)

---

## LICENSE

* `landscape-ebpf`: [GNU GPL v2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* Other parts: [GNU GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.html)

---

If you have any suggestions or issues, feel free to submit them via [issues](./issues/new).

## Star History





Star History Chart