1- [ ![ Build Status] ( https://travis-ci.com/drew2a/wireguard.svg?branch=master )] ( https://travis-ci.com/drew2a/wireguard )
2- [ ![ Maintainability] ( https://api.codeclimate.com/v1/badges/2092ead49a2e82b38f64/maintainability )] ( https://codeclimate.com/github/drew2a/wireguard/maintainability )
3-
41# Wireguard
52
63This repository contains scripts that make it easy to configure [ WireGuard] ( https://www.wireguard.com )
@@ -13,57 +10,54 @@ Medium article: [How to deploy WireGuard node on a DigitalOcean's droplet](https
1310### Ubuntu
1411
1512``` bash
16- wget https://raw.githubusercontent.com/anthony -kenikh/wireguard/master/wg-ubuntu-server-up.sh
13+ wget https://raw.githubusercontent.com/mr -kenikh/wireguard/master/wg-ubuntu-server-up.sh
1714
1815chmod +x ./wg-ubuntu-server-up.sh
1916sudo ./wg-ubuntu-server-up.sh
2017```
2118
22-
2319### Debian
2420
2521``` bash
26- wget https://raw.githubusercontent.com/anthony -kenikh/wireguard/master/wg-debian-server-up.sh
22+ wget https://raw.githubusercontent.com/mr -kenikh/wireguard/master/wg-debian-server-up.sh
2723
2824chmod +x ./wg-debian-server-up.sh
2925./wg-debian-server-up.sh
3026```
3127
32-
3328To get a full instruction, please follow to the article above.
3429
3530### Supported OS
3631
37- * Ubuntu 18.04
38- * Ubuntu 20.04
39- * Debian 9
40- * Debian 10
32+ - Ubuntu 18.04
33+ - Ubuntu 20.04
34+ - Debian 9
35+ - Debian 10
4136
4237## wg-ubuntu-server-up.sh
4338
4439This script:
4540
46- * Installs all necessary software on an empty Ubuntu DigitalOcean droplet
47- (it should also work with most modern Ubuntu images)
48- * Configures IPv4 forwarding and iptables rules
49- * Sets up [ unbound] ( https://github.com/NLnetLabs/unbound ) DNS resolver
50- * Creates a server and clients configurations
51- * Installs [ qrencode] ( https://github.com/fukuchi/libqrencode/ )
52- * Runs [ WireGuard] ( https://www.wireguard.com )
53-
41+ - Installs all necessary software on an empty Ubuntu DigitalOcean droplet
42+ (it should also work with most modern Ubuntu images)
43+ - Configures IPv4 forwarding and iptables rules
44+ - Sets up [ unbound] ( https://github.com/NLnetLabs/unbound ) DNS resolver
45+ - Creates a server and clients configurations
46+ - Installs [ qrencode] ( https://github.com/fukuchi/libqrencode/ )
47+ - Runs [ WireGuard] ( https://www.wireguard.com )
5448
5549### Usage
5650
5751``` bash
58- wg-ubuntu-server-up.sh [--clients=< clients_count> ] [--no-reboot] [--no-unbound]
52+ wg-ubuntu-server-up.sh [--clients=< clients_count> ] [--listen-port =< listen_port > ] [-- no-reboot] [--no-unbound]
5953```
6054
6155Options:
6256
63- * ` --clients=<clients_count> ` how many client's configs will be created
64- * ` --no-unbound ` disables Unbound server installation (1.1.1.1 will be used as
65- a default DNS for client's configs)
66- * ` --no-reboot ` disables rebooting at the end of the script execution
57+ - ` --clients=<clients_count> ` how many client's configs will be created
58+ - ` --listen-port=<listen_port> ` wireguard listen port (51820 will be used as a default port)
59+ - ` --no-unbound ` disables Unbound server installation (1.1.1.1 will be used as a default DNS for client's configs)
60+ - ` --no-reboot ` disables rebooting at the end of the script execution
6761
6862### Example of usage
6963
@@ -75,18 +69,21 @@ Options:
7569./wg-ubuntu-server-up.sh --clients=10
7670```
7771
72+ ``` bash
73+ ./wg-ubuntu-server-up.sh --clients=10 --listen-port=1234
74+ ```
75+
7876## wg-debian-server-up.sh
7977
80- This script works the same way and with the same options, that
81- ` wg-ubuntu-server-up.sh ` do.
78+ This script works the same way and with the same options, that ` wg-ubuntu-server-up.sh ` do.
8279
8380## wg-genconf.sh
8481
8582This script generate server and clients configs for WireGuard.
8683
87- If the public IP is not defined, then the public IP of the machine from which
88- the script is run is used.
84+ If the public IP is not defined, then the public IP of the machine from which the script is run is used.
8985If the number of clients is not defined, then used 10 clients.
86+ If the listen port is not defined, then used 51820 as default.
9087
9188### Prerequisites
9289
@@ -95,15 +92,15 @@ Install [WireGuard](https://www.wireguard.com) if it's not installed.
9592### Usage
9693
9794``` bash
98- ./wg-genconf.sh [< number_of_clients> [< dns_ip> [< server_public_ip> ]]]
95+ ./wg-genconf.sh [< number_of_clients> [< listen_port > [ < dns_ip> [< server_public_ip> ] ]]]
9996` ` `
10097
10198Where:
10299
103- * ` number_of_clients` how many client' s configs will be generated
104- * `dns_ip` the script should use this IP as a DNS address
105- * `server_public_ip ` the script should use this IP as a server address
106-
100+ - ` number_of_clients` how many client' s configs will be generated
101+ - `listen_port` wireguard listen port (51820 will be used as a default port)
102+ - `dns_ip ` the script should use this IP as a DNS address
103+ - `server_public_ip` the script should use this IP as a server address
107104
108105### Example of usage:
109106
@@ -116,9 +113,13 @@ Where:
116113```
117114
118115```bash
119- ./wg-genconf.sh 10 1.1.1.1
116+ ./wg-genconf.sh 10 1234
117+ ```
118+
119+ ```bash
120+ ./wg-genconf.sh 10 1234 1.1.1.1
120121```
121122
122123```bash
123- ./wg-genconf.sh 10 1.1.1.1 157.245.73.253
124+ ./wg-genconf.sh 10 1234 1.1.1.1 157.245.73.253
124125```
0 commit comments