[GH-ISSUE #6018] OpenVPN coexistence: nat:POSTROUTING bypassed when NetBird wt0 is up #12005

Open
opened 2026-08-05 01:32:05 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @danielnkv on GitHub (Apr 28, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/6018

Problem

Trying to run NetBird as exit-node on a host that already runs OpenVPN as exit-node (single host required — the host's public IP is whitelisted in many external systems and can't change yet).

When NetBird's wt0 comes up, OpenVPN client traffic stops being NATed. Packets exit the public interface with the original private source IP. Stopping NetBird → OpenVPN immediately works again.

iptables TRACE confirms: with NetBird up, nat:POSTROUTING is never traversed for OpenVPN-forwarded packets. The MASQUERADE rule never fires (counter stays at 0 even with active traffic).

Possibly related: #1978, #4578, #5394, #2751.

Environment

  • CentOS 7.9.2009, kernel 3.10.0-1160.90.1.el7.x86_64
  • firewalld (Plesk-managed zones: public/, trusted/+wt0, docker/docker0)
  • NetBird client: latest, Docker with network_mode: host, entrypoint already passes --disable-firewall
  • OpenVPN server on <tun> with subnet <openvpn-subnet>/24 and push "redirect-gateway def1"
  • OpenVPN MASQUERADE: firewalld direct rule -s <openvpn-subnet>/24 -o <eth> -j MASQUERADE in POSTROUTING_direct

(IPs and interface names redacted; placeholders below stand in for the real values.)

Reproduce

  1. Working OpenVPN exit node (firewalld + iptables MASQUERADE). Clients have internet.
  2. Start NetBird client → wt0 comes up, peer registers.
  3. OpenVPN clients lose internet. tcpdump on the public interface: packets exit with the private OpenVPN client source IP.
  4. Stop NetBird, delete wt0 → OpenVPN works again.

Key trace evidence

OpenVPN ICMP from <openvpn-client-ip>8.8.8.8 with NetBird up (full trace attached):

mangle:PREROUTING → nat:PREROUTING → mangle:FORWARD →
filter:FORWARD → security:FORWARD → mangle:POSTROUTING
[packet exits — nat:POSTROUTING NEVER entered]

Tried, no effect

  • ip rule add from <openvpn-subnet>/24 lookup main priority 100 (above NetBird's prio 110 rule)
  • Removing NetBird's prio 105 + 110 rules
  • rp_filter=2 on all interfaces
  • Plain iptables -t nat -I POSTROUTING 1 -s <openvpn-subnet>/24 -o <eth> -j MASQUERADE
  • --disable-firewall is already on the daemon
  • Reloading nf_nat / nf_conntrack modules

Question

Has anyone gotten NetBird (exit-node) coexisting with OpenVPN (exit-node) on the same Linux host? #5394's "add MASQUERADE after wt0" workaround addresses NetBird's own NAT, not the case where NetBird's presence causes packets to bypass nat:POSTROUTING entirely.

Attachments

ip-rule-show.txtip rule show before/after wt0
iptables-state-down.txt — iptables state with NetBird down (working)
iptables-state-up.txt — iptables state with NetBird up
state-diff.txt — diff of the two
trace-netbird-up.txt — full iptables TRACE, NetBird up, OpenVPN packets bypassing nat:POSTROUTING

Originally created by @danielnkv on GitHub (Apr 28, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/6018 ## Problem Trying to run NetBird as exit-node on a host that already runs OpenVPN as exit-node (single host required — the host's public IP is whitelisted in many external systems and can't change yet). When NetBird's `wt0` comes up, OpenVPN client traffic stops being NATed. Packets exit the public interface with the original private source IP. Stopping NetBird → OpenVPN immediately works again. iptables TRACE confirms: with NetBird up, **`nat:POSTROUTING` is never traversed** for OpenVPN-forwarded packets. The MASQUERADE rule never fires (counter stays at 0 even with active traffic). Possibly related: #1978, #4578, #5394, #2751. ## Environment - CentOS 7.9.2009, kernel 3.10.0-1160.90.1.el7.x86_64 - firewalld (Plesk-managed zones: public/<eth>, trusted/<tun>+wt0, docker/docker0) - NetBird client: latest, Docker with `network_mode: host`, entrypoint already passes `--disable-firewall` - OpenVPN server on `<tun>` with subnet `<openvpn-subnet>/24` and `push "redirect-gateway def1"` - OpenVPN MASQUERADE: firewalld direct rule `-s <openvpn-subnet>/24 -o <eth> -j MASQUERADE` in `POSTROUTING_direct` (IPs and interface names redacted; placeholders below stand in for the real values.) ## Reproduce 1. Working OpenVPN exit node (firewalld + iptables MASQUERADE). Clients have internet. 2. Start NetBird client → `wt0` comes up, peer registers. 3. OpenVPN clients lose internet. tcpdump on the public interface: packets exit with the private OpenVPN client source IP. 4. Stop NetBird, delete `wt0` → OpenVPN works again. ## Key trace evidence OpenVPN ICMP from `<openvpn-client-ip>` → `8.8.8.8` with NetBird up (full trace attached): ``` mangle:PREROUTING → nat:PREROUTING → mangle:FORWARD → filter:FORWARD → security:FORWARD → mangle:POSTROUTING [packet exits — nat:POSTROUTING NEVER entered] ``` ## Tried, no effect - `ip rule add from <openvpn-subnet>/24 lookup main priority 100` (above NetBird's prio 110 rule) - Removing NetBird's prio 105 + 110 rules - `rp_filter=2` on all interfaces - Plain `iptables -t nat -I POSTROUTING 1 -s <openvpn-subnet>/24 -o <eth> -j MASQUERADE` - `--disable-firewall` is already on the daemon - Reloading `nf_nat` / `nf_conntrack` modules ## Question Has anyone gotten NetBird (exit-node) coexisting with OpenVPN (exit-node) on the same Linux host? #5394's "add MASQUERADE after wt0" workaround addresses NetBird's own NAT, not the case where NetBird's presence causes packets to bypass `nat:POSTROUTING` entirely. ## Attachments [ip-rule-show.txt](https://github.com/user-attachments/files/27177744/ip-rule-show.txt) — `ip rule show` before/after wt0 [iptables-state-down.txt](https://github.com/user-attachments/files/27177747/iptables-state-down.txt) — iptables state with NetBird down (working) [iptables-state-up.txt](https://github.com/user-attachments/files/27177745/iptables-state-up.txt) — iptables state with NetBird up [state-diff.txt](https://github.com/user-attachments/files/27177743/state-diff.txt) — diff of the two [trace-netbird-up.txt](https://github.com/user-attachments/files/27177746/trace-netbird-up.txt) — full iptables TRACE, NetBird up, OpenVPN packets bypassing nat:POSTROUTING
saavagebueno added the triage-needed label 2026-08-05 01:32:05 -04:00
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#12005