Add documentation
This commit is contained in:
parent
f6c24f0eaa
commit
b250277bab
78
README.md
78
README.md
@ -2,3 +2,81 @@ RoutingTableToWG
|
||||
--
|
||||
|
||||
Translate Routing-Table Entries to Wireguard AllowedIPs with Filters
|
||||
|
||||
<br>
|
||||
|
||||
<!-- TOC -->
|
||||
- [1. Overview](#1-overview)
|
||||
- [1.1. Usage](#11-usage)
|
||||
- [1.2. Install](#12-install)
|
||||
- [2. Behaviour](#2-behaviour)
|
||||
- [2.1. Adding Route](#21-adding-route)
|
||||
- [2.2. Deleting Route](#22-deleting-route)
|
||||
<!-- /TOC -->
|
||||
|
||||
<br>
|
||||
|
||||
# 1. Overview
|
||||
|
||||
## 1.1. Usage
|
||||
|
||||
The Program will listen for RoutingTable Changes and can translate the changes to a Wireguard-Interface.
|
||||
|
||||
It will detect the Peer to add the Route to using the Gateway from the Route-Entry.<br>
|
||||
In case routes clash or cant be added to Wireguard, Warnings will be logged.
|
||||
|
||||
<br>
|
||||
|
||||
### 1.1.1. Examples
|
||||
|
||||
- Dynamic Routing with Routing-Protocols (e.g. OSPF)
|
||||
- Interacting with Wireguard using the familiar Tools like `iproute2`
|
||||
|
||||
<br>
|
||||
|
||||
## 1.2. Install
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
### 1.2.1. Docker
|
||||
|
||||
Depending on the needs, the Container can be run in `network_mode: host` to be able to accessrouting-tables and interfaces of the host.
|
||||
|
||||
<details><summary><code>docker-compose.yml</code></summary>
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
routingTableWGTranslator:
|
||||
image: ruakij/RoutingTableWGTranslator
|
||||
restart: unless-stopped
|
||||
network_mode: "host"
|
||||
environment:
|
||||
- INTERFACE="<wgInterfaceName or empty for wg0>"
|
||||
```
|
||||
</details>
|
||||
|
||||
<br>
|
||||
|
||||
### 1.2.2. Without Docker
|
||||
|
||||
Clone the Repository `git clone <URI>` and build the Program with `go build cmd/app`
|
||||
|
||||
Then you can run it with `./app`
|
||||
|
||||
<br>
|
||||
|
||||
# 2. Behaviour
|
||||
|
||||
## 2.1. Adding Route
|
||||
|
||||

|
||||
|
||||
<br>
|
||||
|
||||
## 2.2. Deleting Route
|
||||
|
||||

|
||||
|
28
doc/add-route.puml
Normal file
28
doc/add-route.puml
Normal file
@ -0,0 +1,28 @@
|
||||
@startuml
|
||||
autonumber
|
||||
hide footbox
|
||||
|
||||
footer "RoutingTableToWg | Ruakij"
|
||||
|
||||
title "Add Route"
|
||||
|
||||
participant System
|
||||
control Program
|
||||
boundary Wireguard
|
||||
|
||||
System ++
|
||||
Wireguard ++
|
||||
System ->> Program ++ : Add Route
|
||||
Program -> Program : Filter Route
|
||||
|
||||
Program -> Wireguard ++ : Get current State
|
||||
Wireguard -> Program -- : State
|
||||
|
||||
Program -> Program : Find Peer with Gateway\nfrom AllowedIPs
|
||||
|
||||
Program -> Wireguard ++ : Add Dst-Net to\nAllowedIPs from Peer
|
||||
Wireguard --> Program --
|
||||
|
||||
Program --
|
||||
|
||||
@enduml
|
436
doc/add-route.svg
Normal file
436
doc/add-route.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 22 KiB |
28
doc/del-route.puml
Normal file
28
doc/del-route.puml
Normal file
@ -0,0 +1,28 @@
|
||||
@startuml
|
||||
autonumber
|
||||
hide footbox
|
||||
|
||||
footer "RoutingTableToWg | Ruakij"
|
||||
|
||||
title "Delete Route"
|
||||
|
||||
participant System
|
||||
control Program
|
||||
boundary Wireguard
|
||||
|
||||
System ++
|
||||
Wireguard ++
|
||||
System ->> Program ++ : Delete Route
|
||||
Program -> Program : Filter Route
|
||||
|
||||
Program -> Wireguard ++ : Get current State
|
||||
Wireguard -> Program -- : State
|
||||
|
||||
Program -> Program : Find Peer with Dst-Net\nfrom AllowedIPs
|
||||
|
||||
Program -> Wireguard ++ : Remove Dst-Net from\nAllowedIPs from Peer
|
||||
Wireguard --> Program --
|
||||
|
||||
Program --
|
||||
|
||||
@enduml
|
436
doc/del-route.svg
Normal file
436
doc/del-route.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 22 KiB |
Loading…
x
Reference in New Issue
Block a user