[VPN] operational policy: onboot, Kuma checks, wg Restart
This commit is contained in:
1 parent
d29661f3cf
commit
b9c46c2c8e
1 file changed
+65
@@ -0,0 +1,65 @@
|
||||
# VM220 vpn-core — эксплуатационная политика
|
||||
|
||||
Дата: 2026-12-03
|
||||
|
||||
## Автостарт
|
||||
|
||||
```text
|
||||
qm config 220:
|
||||
onboot: 1
|
||||
name: vpn-core
|
||||
memory: 2048
|
||||
```
|
||||
|
||||
VM проверена реальным `qm reboot 220`: после ребута `wg-quick@wg0` поднялся,
|
||||
handshake с Keenetic прошёл.
|
||||
|
||||
## Внутри VM
|
||||
|
||||
```text
|
||||
systemctl is-enabled wg-quick@wg0 → enabled
|
||||
systemctl is-active wg-quick@wg0 → active
|
||||
drop-in: /etc/systemd/system/[email protected]/restart.conf
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
```
|
||||
|
||||
## Бэкапы
|
||||
|
||||
Кластерный job `vzdump all 1` (daily 02:00, storage backups-hdd) уже включает VM220.
|
||||
Отдельный job не нужен.
|
||||
|
||||
## Мониторинг
|
||||
|
||||
Uptime Kuma (CT107, порт 3001):
|
||||
|
||||
| ID | Монитор | Тип | Что проверяет |
|
||||
|---:|---|---|---|
|
||||
| 71 | VPN VM220 (192.168.1.203:22) | port | доступность VM по SSH |
|
||||
| 72 | VPN WireGuard handshake | push | свежесть handshake ≤180 с |
|
||||
|
||||
Уведомления к обоим:
|
||||
|
||||
```text
|
||||
1 Gitea Self-Healing
|
||||
2 Matrix (hub)
|
||||
3 Hermes (шина)
|
||||
```
|
||||
|
||||
Push-проверка на VM220:
|
||||
|
||||
```text
|
||||
/usr/local/sbin/vpn-wg-check.sh
|
||||
/etc/cron.d/vpn-wg-check — каждую минуту
|
||||
```
|
||||
|
||||
Логика: если handshake старше 180 с или его нет — push `status=down`;
|
||||
иначе `status=up`. Если VM лежит — push не приходит, Kuma уходит в down.
|
||||
|
||||
## Проверка
|
||||
|
||||
```text
|
||||
Kuma heartbeat 71 → status 1
|
||||
Kuma heartbeat 72 → status 1
|
||||
Wireguard1 на Keenetic → link up, online yes
|
||||
```
|
||||
Reference in new issue
Block a user