... | ... | @@ -6,17 +6,17 @@ note: all this have to be done as root on client machine or using doas/sudo |
|
|
note: hub public key is: hm9zrdHJU2fJsrKnRqo4xXlqbsdNC0CfTySwOzdBwm8=
|
|
|
## 1. using 'wg' tool
|
|
|
```
|
|
|
apk add wireguard-tools-wg
|
|
|
`apk add wireguard-tools-wg`
|
|
|
```
|
|
|
create wireguard interface
|
|
|
|
|
|
cat /etc/network/interfaces
|
|
|
cat /etc/network/interfaces (this is example)
|
|
|
```
|
|
|
iface wg0 inet static
|
|
|
address your_assigned_ip_address
|
|
|
netmask 255.255.255.255
|
|
|
pre-up ip link add dev wg0 type wireguard
|
|
|
pre-up wg setconf wg0 /home/mps/work/alpine/wg/wg0.conf
|
|
|
pre-up wg setconf wg0 your_patch_to/wg0.conf
|
|
|
post-up ip route add 172.16.0.0/16 dev wg0
|
|
|
post-down ip link delete dev wg0
|
|
|
```
|
... | ... | @@ -39,17 +39,18 @@ Endpoint = wg.alpinelinux.org:41414 |
|
|
AllowedIPs = 172.16.0.0/16
|
|
|
```
|
|
|
PrivateKey above is your private key
|
|
|
|
|
|
PublicKey is 'hub' public key
|
|
|
|
|
|
after that start wg tunnel with 'ifup wg0'
|
|
|
after that start wg tunnel with `ifup wg0`
|
|
|
|
|
|
also it can be stopped with 'ifdown wg0'
|
|
|
also it can be stopped with `ifdown wg0`
|
|
|
|
|
|
## 2. using 'wg-quick' tool (simpler option)
|
|
|
|
|
|
apk add wireguard-tools-wg-quick
|
|
|
`apk add wireguard-tools-wg-quick`
|
|
|
|
|
|
interface setup in /etc/network/interfaces not needed
|
|
|
note: interface setup in /etc/network/interfaces not needed
|
|
|
|
|
|
create config file in /etc/wireguard/wg0.conf (or anywhere else) but put
|
|
|
path to it above in interface in 'post-up' parameter
|
... | ... | @@ -67,11 +68,12 @@ AllowedIPs = 172.16.0.0/16 |
|
|
```
|
|
|
|
|
|
Address is your assigned ip address
|
|
|
|
|
|
PrivateKey above is your private key
|
|
|
PublicKey is 'hub' public key
|
|
|
|
|
|
start it with:
|
|
|
wg-quick up /etc/wireguard/wg0.conf
|
|
|
`wg-quick up /etc/wireguard/wg0.conf`
|
|
|
|
|
|
or stop with:
|
|
|
wg-quick down /etc/wireguard/wg0.conf |
|
|
\ No newline at end of file |
|
|
`wg-quick down /etc/wireguard/wg0.conf` |
|
|
\ No newline at end of file |