mirror of
https://github.com/hatamiarash7/WireGuard-Config-Generator.git
synced 2024-11-07 08:03:59 +01:00
Generate WireGuard tunnel configs
.github | ||
.gitattributes | ||
.gitignore | ||
main.py | ||
Makefile | ||
README.md | ||
requirements.txt |
WireGuard config generator
This simple script will generate tunnel config files for WireGuard.
How to use
You need to give two file contains your information:
endpoints.toml
: Contains the endpoints you want to connect to ( Name, Address ).ip-list.toml
: Contains the IP addresses you want to use.
And also give private/other information as a .env
file.
endpoints.toml
Company-Server-1 = "wg-1.domain.xyz:1234"
Company-Server-2 = "wg-2.domain.xyz:1234"
ip-list.toml
[k8s]
DC1 = "1.2.3.4/32"
DC2 = "5.6.7.8.9/32"
DC3 = "1.2.3.4/27"
[monitoring]
prometheus = "1.2.3.4/32"
grafana = "5.6.7.8.9/32"
[other]
server1 = "1.2.3.4/32"
server2 = "5.6.7.8.9/32"
server3 = "1.2.3.4/27"
.env
PRIVATE_KEY=
PUBLIC_KEY=
ADDRESS=
MTU=
PERSISTENT_KEEPALIVE=
Note
: If you need extra data than the above, you should add your variables in
main.py
too.
Run
To generate config files for all endpoints, run:
make run
This script will create file(s) based on the given endpoints. In this example, it will create Company-Server-1.conf
and Company-Server-2.conf
files like this:
[Interface]
PrivateKey = <PRIVATE_KEY>
Address = <ADDRESS>
MTU = <MTU>
[Peer]
PublicKey = <PUBLIC_KEY>
Endpoint = wg-1.domain.xyz:1234
AllowedIPs = 1.2.3.4/32, 5.6.7.8/32, ...
PersistentKeepalive = <PERSISTENT_KEEPALIVE>
Now, you can import all generated configs in WireGuard.
Support 💛
Contributing 🤝
Don't be shy and reach out to us if you want to contribute 😉
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Issues
Each project may have many problems. Contributing to the better development of this project by reporting them. 👍