https://github.com/gajdipajti/wg-routeros-network
Tools for generating a Wireguard network for Mikrotik RouterOS
https://github.com/gajdipajti/wg-routeros-network
routeros wireguard
Last synced: 6 months ago
JSON representation
Tools for generating a Wireguard network for Mikrotik RouterOS
- Host: GitHub
- URL: https://github.com/gajdipajti/wg-routeros-network
- Owner: gajdipajti
- License: gpl-3.0
- Created: 2023-05-13T12:23:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T22:30:49.000Z (over 2 years ago)
- Last Synced: 2025-04-12T22:53:05.182Z (6 months ago)
- Topics: routeros, wireguard
- Language: RouterOS Script
- Homepage:
- Size: 105 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wg-routeros-network
Tools for generating a Wireguard network for Mikrotik RouterOS and possibly other peers later. This should be the ideal home office setup.
Currently implemented functions in the wg-gen.pl Perl script:
* Generate a table.csv with all the keys pairs, tunnel ip addresses and LAN networks.
* Generate server and client configuration, which include:
* Wireguard interface and peer configuration in a 1 server - N peer network.
* EoIP tunnels to the server with a bridge configuration on the clients (no physical interface is added).
* Set up static routes to reach each peer's LAN subnet.
* We only NAT at the wireguard tunnel endpoints WAN interface.
* Implement the routing of 0.0.0.0/0 into the tunnel using routing-mark and a new routing table. To disable this, just disable the mangle firewall rule.
* Set ntp and timezone.Missing functionality:
* change static routes to OSPFv2.
* configure the peer's wireless interface with CAPsMAN.
* generate configuration files for Linux, Windows, Android, iOS.
* generate the QR code for mobile clients.## Perl script
```bash
./wg-gen.pl 21
```To generate QR Code in the Perl script (not yet implemented), install the following ubuntu package:
```libimager-qrcode-perl```## Old table generation
A simple table can be generated using the following bash script:
```bash
for idx in $(seq 1 20)
do
echo "$idx; 10.0.0.$idx; $(wg genkey | xargs bash -c 'echo -n $@; echo -n \;\ ; echo $@ | wg pubkey' bash)";
done
```