41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
# PolyculeNetwork
|
|
|
|
PolyculeNetwork is a drop-in solution for infrastructure mutualisation, when subnets to mutualize use the same ip ranges. It is based on nftables, wireguard and python.
|
|
|
|
## Installation
|
|
|
|
### Dedicated VM/LXC/server (recommended)
|
|
|
|
Install dependencies:
|
|
```
|
|
# Debian
|
|
apt install python3-poetry wireguard nftables
|
|
```
|
|
|
|
Install python dependencies :
|
|
```
|
|
poetry install
|
|
```
|
|
|
|
### Docker
|
|
|
|
On the host, you'll need `docker` and `docker-compose-plugin`.
|
|
|
|
Clone this repo, edit the `docker-compose.yml` file to suit your needs, and set `config/config.toml` to reflect you infrastructure.
|
|
|
|
You will need to create an empty `config/dnnsmasq.conf` for the first launch (it will be generated by the main container, but the file needs to exist).
|
|
|
|
Launch `docker compose`, get the ip address of the polyculenetwork container, and set manual routes via this ip:
|
|
|
|
```bash
|
|
ip route add <translated remote network> via <container ip>
|
|
```
|
|
|
|
Finally, run on the host
|
|
|
|
```bash
|
|
sysctl -w net.ipv4.ip_forward
|
|
iptables -A FORWARD -j ACCEPT
|
|
```
|
|
|
|
You will need to run these commands after each restart of the host machine.
|