mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Cleaned up and refactored
This commit is contained in:
28
roles/client-wireguard/README.md
Normal file
28
roles/client-wireguard/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Role Native Wireguard
|
||||
Manages wireguard on a client.
|
||||
|
||||
## Create Client Keys
|
||||
```bash
|
||||
wg_private_key="$(wg genkey)"
|
||||
wg_public_key="$(echo "$wg_private_key" | wg pubkey)"
|
||||
echo "PrivateKey: $wg_private_key"
|
||||
echo "PublicKey: $wg_public_key"
|
||||
echo "PresharedKey: $(wg genpsk)"
|
||||
```
|
||||
|
||||
## Other
|
||||
- https://golb.hplar.ch/2019/01/expose-server-vpn.html
|
||||
- https://wiki.archlinux.org/index.php/WireGuard
|
||||
- https://wireguard.how/server/raspbian/
|
||||
- https://www.scaleuptech.com/de/blog/was-ist-und-wie-funktioniert-subnetting/
|
||||
- https://bodhilinux.boards.net/thread/450/wireguard-rtnetlink-answers-permission-denied
|
||||
- https://stackoverflow.com/questions/69140072/unable-to-ssh-into-wireguard-ip-until-i-ping-another-server-from-inside-the-serv
|
||||
- https://unix.stackexchange.com/questions/717172/why-is-ufw-blocking-acces-to-ssh-via-wireguard
|
||||
- https://forum.openwrt.org/t/cannot-ssh-to-clients-on-lan-when-accessing-router-via-wireguard-client/132709/3
|
||||
- https://serverfault.com/questions/1086297/wireguard-connection-dies-on-ubuntu-peer
|
||||
- https://unix.stackexchange.com/questions/624987/ssh-fails-to-start-when-listenaddress-is-set-to-wireguard-vpn-ip
|
||||
- https://serverfault.com/questions/210408/cannot-ssh-debug1-expecting-ssh2-msg-kex-dh-gex-reply
|
||||
- https://www.thomas-krenn.com/de/wiki/Linux_ip_Kommando
|
||||
- https://wiki.archlinux.org/title/dhcpcd
|
||||
- https://wiki.ubuntuusers.de/NetworkManager/Dispatcher/
|
||||
- https://askubuntu.com/questions/1024916/how-can-i-launch-a-systemd-service-at-startup-before-another-systemd-service-sta
|
10
roles/client-wireguard/files/set-mtu.service
Normal file
10
roles/client-wireguard/files/set-mtu.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=set MTU
|
||||
Before=wg-quick@wg0.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=bash /usr/local/bin/set-mtu.sh
|
||||
|
||||
[Install]
|
||||
RequiredBy=wg-quick@wg0.service
|
6
roles/client-wireguard/handlers/main.yml
Normal file
6
roles/client-wireguard/handlers/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
- name: "restart set-mtu.service"
|
||||
systemd:
|
||||
name: set-mtu.service
|
||||
state: restarted
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
2
roles/client-wireguard/meta/main.yml
Normal file
2
roles/client-wireguard/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- wireguard
|
11
roles/client-wireguard/tasks/main.yml
Normal file
11
roles/client-wireguard/tasks/main.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
- name: create set-mtu.service
|
||||
copy:
|
||||
src: set-mtu.service
|
||||
dest: /etc/systemd/system/set-mtu.service
|
||||
notify: restart set-mtu.service
|
||||
|
||||
- name: create set-mtu.sh
|
||||
template:
|
||||
src: set-mtu.sh.j2
|
||||
dest: /usr/local/bin/set-mtu.sh
|
||||
notify: restart set-mtu.service
|
4
roles/client-wireguard/templates/set-mtu.sh.j2
Normal file
4
roles/client-wireguard/templates/set-mtu.sh.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
{% for internet_interface in internet_interfaces %}
|
||||
ip li set mtu 1400 dev {{internet_interface}}
|
||||
{% endfor %}
|
Reference in New Issue
Block a user