|
|
setting wireguard tunnel for alpine linux developer to access infra hosts
|
|
|
=========================================================================
|
|
|
|
|
|
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
|
|
|
```
|
|
|
create wireguard interface
|
|
|
|
|
|
cat /etc/network/interfaces
|
|
|
```
|
|
|
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
|
|
|
post-up ip route add 172.16.0.0/16 dev wg0
|
|
|
post-down ip link delete dev wg0
|
|
|
```
|
|
|
your assigned ip address must be changed above after address parameter
|
|
|
|
|
|
generate private/public keys
|
|
|
```
|
|
|
wg genkey | tee privatekey | wg pubkey > publickey
|
|
|
``` |
|
|
\ No newline at end of file |