Skip to content

Commit

Permalink
Merge pull request #15 from drew2a/fix/14
Browse files Browse the repository at this point in the history
Fix/14
  • Loading branch information
drew2a authored Dec 26, 2020
2 parents ecb7138 + 787f36b commit b840bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.com/drew2a/wireguard.svg?branch=master)](https://travis-ci.com/drew2a/wireguard)
[![Maintainability](https://api.codeclimate.com/v1/badges/2092ead49a2e82b38f64/maintainability)](https://codeclimate.com/github/drew2a/wireguard/maintainability)

# Wireguard

Expand Down
15 changes: 4 additions & 11 deletions wg-debian-server-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/source
echo ---------------------------------------------------------------------update
apt update -y

echo ------------------------------------------------------install linux headers
apt install -y linux-headers-"$(uname -r)"
echo --------------------------------------------------------------upgrade kernel
sudo apt -y install linux-image-amd64 linux-headers-amd64

echo ---------------------------------------------------------install wireguard
apt -t buster-backports -y install wireguard wireguard-tools wireguard-dkms \
linux-headers-$(uname -r)
modprobe wireguard
apt -y install wireguard

echo ----------------------------------------------------------install qrencode
apt install -y qrencode
Expand All @@ -53,16 +51,14 @@ mv -v ./wg0.conf \
chown -v root:root /etc/wireguard/wg0.conf
chmod -v 600 /etc/wireguard/wg0.conf

echo ------------------------------------------------------------- run wireguard
wg-quick up wg0
echo -----------------------------------------------------------add to systemctl
systemctl enable wg-quick@wg0

echo ------------------------------------------------------enable IPv4 forwarding
sysctl net.ipv4.ip_forward=1
echo 'net.ipv4.ip_forward = 1' > /etc/sysctl.d/99-sysctl.conf

echo ---------------------------------------------------configure firewall rules

iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 55000 -m conntrack --ctstate NEW -j ACCEPT
Expand Down Expand Up @@ -144,9 +140,6 @@ systemctl disable systemd-resolved
systemctl enable unbound
systemctl start unbound

# show wg
wg show

set +x # disable print all commands

echo && echo You can use this config: client1.conf
Expand Down

0 comments on commit b840bb9

Please sign in to comment.