fix(openvpn-phone): open FORWARD for road-warrior traffic into the LAN
lint / yamllint + ansible-lint + syntax-check (push) Canceled after 0s

The phone tunnel established fine (TLS peer-fingerprint OK) but no traffic
reached the LAN: ru-vps has policy FORWARD DROP and only per-service game
ACCEPTs. The site tunnel never needed a FORWARD rule because it carries
ru-vps's own traffic, not forwarded packets; the road-warrior instance is
the first forwarded path.

Add a `ufw route allow` (tun2 -> tun0, 10.80.0.0/30 -> 192.168.1.0/24). ufw
route rules survive `ufw reload`, unlike a raw `iptables -I FORWARD` which
would sit before the ufw chains and be flushed on reload. Return traffic is
covered by the global RELATED,ESTABLISHED accept in ufw-before-forward.

Verified on ru-vps: `ufw status` shows "192.168.1.0/24 on tun0 ALLOW FWD
10.80.0.0/30 on tun2"; make openvpn-phone idempotent.

Same gap exists in openvpn-laptop.yml (tun1) — still not deployed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbuZrUoevfBgCpf5DCF4DG
This commit is contained in:
Dmitry
2026-09-03 09:50:01 +03:00
co-authored by Claude Sonnet 5
parent 1f27756afd
commit dfcee00232
+14
View File
@@ -177,6 +177,20 @@
changed_when: "'Rule added' in ufw_allow_phone_openvpn.stdout or 'Rules updated' in ufw_allow_phone_openvpn.stdout" changed_when: "'Rule added' in ufw_allow_phone_openvpn.stdout or 'Rules updated' in ufw_allow_phone_openvpn.stdout"
failed_when: false failed_when: false
# Road-warrior трафик tun2 -> tun0 ФОРВАРДИТСЯ через ru-vps, а policy
# FORWARD = DROP. Сайт-тоннель этого правила не требовал (он несёт
# собственный трафик ru-vps, не forward). ufw route allow переживает
# `ufw reload`, в отличие от сырого iptables -I FORWARD. Обратное
# направление покрыто глобальным RELATED,ESTABLISHED в ufw-before-forward.
- name: Allow forwarding phone VPN traffic into the LAN
community.general.ufw:
route: true
rule: allow
interface_in: "{{ phone_openvpn_interface }}"
interface_out: "{{ phone_openvpn_site_interface }}"
src: "{{ phone_openvpn_network_cidr }}"
dest: "{{ homelab_lan_cidr }}"
- name: Render phone OpenVPN server config - name: Render phone OpenVPN server config
ansible.builtin.copy: ansible.builtin.copy:
dest: "{{ phone_openvpn_config }}" dest: "{{ phone_openvpn_config }}"