Git Product home page Git Product logo

tomseasywireguardsetupscript's Introduction

Tom's Easy Wireguard Setup Script (for Debian-based Systems)

This script will install wireguard, generate configs for a specified number of clients, and enable IP forwarding for all connected clients. This script is idempotent, meaning you can run it multiple times without destroying your existing config. If you need to add another VPN client, just tell the script you need 4 clients instead of 3, etc.

Prerequisites

  • A Debian-based (Debian/Ubuntu) system with a public IPv4 address
  • Root access

Instructions

  • Download this script to your system: curl https://raw.githubusercontent.com/samurailink3/TomsEasyWireguardSetupScript/main/install-wireguard.bash > install-wireguard.bash
  • Make the script executable: chmod +x install-wireguard.bash
  • Run the script: ./install-wireguard.bash

Automation

If you'd like to use this script in further automation/without user prompting, you'll need to set the following environment variables:

  • ENDPOINT_IP
  • NUMBER_OF_CLIENTS

Advanced Features

  • Set the WIREGUARD_INTERFACE variable to set up new/existing Wireguard tunnels.
    • Example: export WIREGUARD_INTERFACE=wg1 && /bin/bash install-wireguard.bash
    • Default: wg0
    • You can use this to run multiple wireguard tunnels on a single host
  • Set the WIREGUARD_INTERNAL_IP_PARTIAL variable to control the IP range of the network created
    • Example: export WIREGUARD_INTERNAL_IP_PARTIAL=10.72.72 && /bin/bash install-wireguard.bash
    • Default: 10.11.12
    • Note: The network address will end in .0
    • Note: The network defaults to a /24
    • Note: The server address will end in .1
  • Set the WIREGUARD_LISTEN_PORT variable to control what port wireguard will listen for incoming connections on.
    • Example: export WIREGUARD_LISTEN_PORT=12345 && /bin/bash install-wireguard.bash
    • Default: 51820

License

Public Domain - The Unlicense

You may use this code however you'd like, wherever you'd like, without any requirements, forever.

References and Sources

tomseasywireguardsetupscript's People

Contributors

samurailink3 avatar

Watchers

 avatar

tomseasywireguardsetupscript's Issues

This is really a question for you about the wireguard setup script but I don't know where else to ask it but via an "issue"

I have installed & tried this but I am wondering if I am either misunderstanding its goal or how to use it.

So...

Is this script's use-case to create the Wireguard Configs for X number of nodes.
Then the user has to copy each respective Wireguard Config to each remote Node intended to be in the Mesh?

Or...
Is the use-case t_hat the User runs this script on each individual Node that is to be in the Mesh_?
Then integrate with each other?

Lastly, this may not interest you but I've used another wireguard related app for several years now that creates VxLAN
configurations for use with Wireguard Tunnels.

VxWireguard -Generator works great for its use-case.

I used it several years ago to create a Wireguard Full Mesh VPN with VxLAN tunneled thru Wireguard to multiple servers
on Digital Ocean & Hetzner Clouds.

I used BGP to auto-route traffic thru the mesh also. All of that together also enables Multi-cast to work across the Mesh
VPN.

Here is a PDF that describes much of what I did.

VxLAN does not do encryption so tunneling it thru Wireguard removes that exposure.

Anyway, looking at what your Script does it might be a great idea of you could Integrate VxWireguard-Generator & your tool
together.

The result would become an all-in-one solution for a Layer 2 & 3 Mesh Overlay Network, that supports Multicast & eliminates Broadcast & Unknown Multicast (re BUM) problem.

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.