Giter VIP home page Giter VIP logo

wgconfig's Introduction

wgconfig

A simple bash script to output wireguard configurations with public and private key.

[vpnuser@mypc]~$ wgconfig

Enter values for any or all fields or none to generate keypair only

Filename (example client01) =
Address (example: 10.0.0.2/30) =
ListenPort (return for dynamic endpoint) =
DNS servers separated by comma (return for none) =
PresharedKey (return for none) =
Remote peer PublicKey =
AllowedIPs (separated by comma, 0.0.0.0/0 for default) =
Endpoint (hostname or IP address) =
Endpoint listenport =

### configuration saved as wireguard.conf

Configuration output template

# Name = wireguard.conf

# Configuration format is INI.
# There are two top level sections: Interface and Peer
[Interface]

# Private key generated by wg genkey
PrivateKey =

# Public key derived from private key with wg pubkey
# Provide to remote peer
# Publickey =

# Comma separated list of addresses, CIDR notation optional
# Multiple addresses allowed
Address =

# Optional 16-bit listen port
# Don't set if this peer has a dynamic IP address
# ListenPort =

# Comma separated list of addresses for DNS service
# Or hostnames to be set as search domains
# DNS =

# Manually specify MTU
# MTU = 1420

# Multiple peer configurations allowed
[Peer]

# Public key provided by remote peer
PublicKey =

# Optional preshared key generated by wg genpsk
# Adds addtional layer of cryptography for post-quantum resistance
# PresharedKey =

# Comma separated list of IPv4 or IPv6 addresses with CIDR masks
# For incoming traffic allowed and outgoing traffic directed
# Use 0.0.0.0/0 and/or ::/0 for default route
AllowedIPs =

# IP or hostname followed by colon and port number
# Don't set if remote peers have dynamic addresses
# Endpoint =

# Keepalive interval between 1 and 65535
# Useful for keeping NAT or stateful firewall connections active
# PersistentKeepalive = 25

Installation and usage

Clone the repo or copy the script.
Make the script executable chmod +x wgconfig.
Place it somewhere in your path ~/bin ~/.local/bin /usr/local/bin.

There are no command line flags or options, just execute the script and follow the prompts.

Requirements

  • wireguard-tools
    • Linux (debian based)
      • apt install wireguard-tools
    • macOS Macports and Homebrew
      • port install wireguard-tools
      • brew install wireguard-tools
    • FreeBSD
      • pkg install wireguard-tools

For additional operating systems: Wireguard Installation

Further Information

wgconfig's People

Contributors

coonrad avatar

Watchers

 avatar

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.