Jarno Rankinen revisó este gist . Ir a la revisión
1 file changed, 23 insertions
wg0.service(archivo creado)
| @@ -0,0 +1,23 @@ | |||
| 1 | + | ## Connect to Wireguard interface automatically | |
| 2 | + | ## using NetworkManager. | |
| 3 | + | ## wg-quick@ -systemd services do not configure | |
| 4 | + | ## DNS properly when systemd-resolved is used | |
| 5 | + | ## resulting in DNS leaks and general issues, | |
| 6 | + | ## hence starting the interface via nmcli is | |
| 7 | + | ## necessary | |
| 8 | + | ||
| 9 | + | [Unit] | |
| 10 | + | Description=wg0 interface | |
| 11 | + | After=network-online.target | |
| 12 | + | Wants=network-online.target | |
| 13 | + | ||
| 14 | + | [Service] | |
| 15 | + | Type=oneshot | |
| 16 | + | ExecStart=nmcli conn up wg0 | |
| 17 | + | ExecStartPost=resolvectl flush-caches | |
| 18 | + | ExecStop=nmcli conn down wg0 | |
| 19 | + | ExecStopPost=resolvectl flush-caches | |
| 20 | + | RemainAfterExit=true | |
| 21 | + | ||
| 22 | + | [Install] | |
| 23 | + | WantedBy=default.target | |
Siguiente
Anterior