Skip to content

Commit 8ae43d2

Browse files
committed
closer and closer
1 parent 06092e8 commit 8ae43d2

6 files changed

Lines changed: 101 additions & 4 deletions

File tree

‎_config.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ description : "Creating a more resilient and knowledgable world."
2525
url : "https://ScriptTactics.github.io"# the base hostname & protocol for your site e.g. "https://mmistakes.github.io"
2626
baseurl : "" # the subpath of your site, e.g. "/blog"
2727
repository : "ScriptTactics/ScriptTactics.github.io" # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes"
28-
teaser : "/assets/images/st.png" # path of fallback teaser image, e.g. "/assets/images/500x300.png"
2928
logo : "" # path of logo image to display in the masthead, e.g. "/assets/images/88x88.png"
3029
masthead_title : # overrides the website title displayed in the masthead, use " " for no title
3130
# breadcrumbs : false # true, false (default)

‎_pages/contact.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
permalink: "/contact"
33
layout: single
44
---
5+
We will respond to your message within 24 hours.
56

6-
<form accept-charset="UTF-8" action="{your-unique-url}" method="POST">
7+
<form accept-charset="UTF-8" action="https://www.formbackend.com/f/a8b72d32a7183528" method="POST">
78
<label for="name">Name</label>
89
<input type="text" id="name" name="name" required>
910

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,105 @@
11
---
22
title: OpenWRT Wireguard Server Tutorial
33
author_profile: false
4+
toc: true
5+
toc_label: "Table of Contents"
6+
toc_icon: "cog"
47
---
5-
<iframe width="560" height="315" src="https://www.youtube.com/embed/TQxwqY-m30Y" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
68

9+
{% include video id="TQxwqY-m30Y" provider="youtube" %}
710

8-
This is some text to describe what is happening on the page
11+
# OpenWRT Wireguard Server
12+
## Update Dependencies
13+
```bash
14+
opkg update
15+
```
16+
17+
## Install Wireguard
18+
```bash
19+
opkg install wireguard-tools luci-app-wireguard
20+
```
21+
## Key Generation
22+
```bash
23+
umask u=rw,g=,o=
24+
wg genkey | tee wgserver.key | wg pubkey > wgserver.pub
25+
wg genpsk > wg.psk
26+
```
27+
28+
## Wireguard Interface Config
29+
```bash
30+
WG_IF="wg0"
31+
WG_PORT="51820"
32+
WG_ADDR="10.0.0.1/24"
33+
```
34+
35+
## Firewall Config
36+
```bash
37+
WG_KEY="$(cat wgserver.key)"
38+
WG_PSK="$(cat wg.psk)"
39+
WG_PUB="$(cat wgserver.pub)"
40+
uci rename firewall.@zone[0]="lan"
41+
uci rename firewall.@zone[1]="wan"
42+
uci rename firewall.@forwarding[0]="lan_wan"
43+
uci del_list firewall.lan.network="${WG_IF}"
44+
uci add_list firewall.lan.network="${WG_IF}"
45+
uci -q delete firewall.wg
46+
uci set firewall.wg="rule"
47+
uci set firewall.wg.name="Allow-WireGuard"
48+
uci set firewall.wg.src="wan"
49+
uci set firewall.wg.dest_port="${WG_PORT}"
50+
uci set firewall.wg.proto="udp"
51+
uci set firewall.wg.proto="udp"
52+
uci set firewall.wg.target="ACCEPT"
53+
uci commit firewall
54+
/etc/init.d/firewall restart
55+
```
56+
57+
## Network Config:
58+
```bash
59+
uci -q delete network.${WG_IF}
60+
uci set network.${WG_IF}="interface"
61+
uci set network.${WG_IF}.proto="wireguard"
62+
uci set network.${WG_IF}.private_key="${WG_KEY}"
63+
uci set network.${WG_IF}.listen_port="${WG_PORT}"
64+
uci commit network
65+
/etc/init.d/network restart
66+
```
67+
68+
69+
# Adding a Peer
70+
There are 2 ways to go about this in OpenWRT
71+
72+
Option 1: You can configure the peer on the peer itself and share the keys.
73+
74+
Option 2: You can generate all the keys on the server, show a QR code and then the peer can scan that to get all the information that’s required. You must then remove the private key from the server so that the peer is the only one with knowledge of its private key.
75+
76+
77+
## Option 1
78+
some text
79+
80+
## Option 2
81+
82+
Install qrencode
83+
```bash
84+
opkg update
85+
```
86+
```bash
87+
opkg install qrencode
88+
```
89+
90+
## Setup Peer
91+
Then go to Network -> Interfaces -> wg0 -> edit -> peers -> edit peers
92+
93+
![Option 2 Peer](/assets/images/option2-peer.PNG)
94+
1. Set the description of the peer
95+
2. Click “Generate new key pair” to create both the private and public key.
96+
3. Click “Generate preshared key”
97+
4. Allowed IPs: 10.0.0.2/32 → this should be unique per peer. Make sure you press the + to apply the IP
98+
5. Click Generate Configuration
99+
100+
![Option 2 QR](/assets/images/option2-qr.PNG)
101+
1. All the values here should be pre-populated.
102+
2. You can scan the QR code in your wireguard app to get the config.
103+
3. After you’ve successfully received the configs you will need to delete the private key from the previous screen.
104+
105+
## Android Config Peer 2

‎assets/images/openwrt.PNG‎

70.8 KB
Loading

‎assets/images/option2-peer.PNG‎

50.2 KB
Loading

‎assets/images/option2-qr.PNG‎

45.9 KB
Loading

0 commit comments

Comments
 (0)