GithubHelp home page GithubHelp logo

mikrotik-auto-wireguard's Introduction

MikroTik Auto WireGuard

TL;DR: this tool lets you autoconfigure WireGuard clients on a MikroTik RouterOS and generate configs for them without hand-assigning any parameters.

Why?

WireGuard is a static and simple by design. Thus, it does not offer any form of:

  • automatic IP assignment
  • route pushing
  • config generation
  • DHCP tunneling (or any non-IP traffic)

This is why normally to get a new node/person connection you have to:

  • generate keys for the user (or ask the user for its public key)
  • add new client
  • find the next free IP & assign it statically a client
  • create a config for the user
  • make a note of which peer is which user

This tool does all that automatically for one or more users at once.

How to use it?

Docker

The simplest way is through Docker:

  • Build image: docker build -t mt-wg-auto https://github.com/kiler129/mikrotik-auto-wireguard.git
  • Run: docker run -it --rm mt-wg-auto generate --help

For more see more detailed docs.

Without Docker

Requirements

  • RouterOS v7.1 beta3 or newer
  • Admin user on the router with API enabled
  • PHP 7.4 or newer

As of now, as the ROS is in beta stage, there are no promises of compatibility. In simple terms you should execute bin/console generate --help and configure it as you wish ;)

For more see more detailed docs.

Disclaimer

This is a beta software. As with ROSv7 it's not recommended being used in production. This software nor the author are affiliated/supported/endorsed by SIA Mikrotīkls.

mikrotik-auto-wireguard's People

Contributors

kiler129 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

carlosjs23

mikrotik-auto-wireguard's Issues

Add PHAR and/or Docker builds

To make it easy to use by sys-admins it should be easier to use it when you're not a programmer.

PHAR (or even Docker) build should be provided and possibly automated.

Interface address should be excluded

The ff3779e excluded the network address. However this doesn't fully solve the issue as now the first address used will be .1 which is problematic if the interface has an address of .1 like so:

/ip address
    add address=10.100.0.1/24 interface=wireguard1-srv network=10.100.0.0

Add option to specify DNS server

Thanks for this tool!
One key feature it's missing IMHO is allowing to specify a DNS server.
Even better: As a default it could use either the wireguard interface address assuming/if there's a DNS server running on there, or take what the mikrotik is using for its DNS queries. In my case my mikrotik uses a different DNS server but it also runs its own, caching the other one and I use this own caching DNS server for my wireguard peers: The .1 address.

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.