Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - waterchill

#1
Hallo Freunde,
ich bin neu bei OPNsense und hänge gerade an einem Problem fest – vielleicht kann mir ja jemand helfen.

Setup:
  • Frisch installiertes OPNsense 25.1 mit:

    • WAN (primärer Internetzugang)
    • LTE (Huawei USB HiLink Stick, Backup/Failover)
    • WireGuard VPN-Client (Mullvad)
  • Gateway-Gruppe konfiguriert:

    • WAN = Tier 1
    • LTE = Tier 2
  • Policy-basiertes Routing wird verwendet:

    • Zwei bestimmte Clients werden durch den WireGuard-Tunnel geleitet
    • Alle anderen Clients nutzen WAN/LTE, je nach Verfügbarkeit

Problem:
  • Wenn das WAN ausfällt, übernimmt LTE, und sowohl der allgemeine Datenverkehr als auch das VPN funktionieren wie erwartet.
  • Aber wenn WAN wieder online ist:

    • Der allgemeine Datenverkehr wechselt korrekt zurück auf WAN
    • Die beiden WireGuard-Clients bleiben jedoch auf der LTE-Verbindung
    • Der WireGuard-Tunnel bleibt an LTE gebunden und wechselt nicht zurück auf WAN

Einzige funktionierende Lösung:
Das Einzige, was die korrekte Weiterleitung (WireGuard über WAN) wiederherstellt, ist:
  • Navigieren zu

    VPN → WireGuard → Instanzen
  • ,,Aktiviert" abwählen
  • Auf ,,Übernehmen" klicken
  • Die Instanz wieder aktivieren
  • Noch einmal auf ,,Übernehmen" klicken
Danach wird der Tunnel über die WAN-Schnittstelle neu aufgebaut.

Bereits getestete (nicht funktionierende) Lösungen:
  • configctl wireguard restart
    → Startet die Tunnel-Logik neu, löst aber keine Neuzuweisung der Schnittstelle aus
  • Floating Firewall-Regel:
    → Versuch, UDP-Traffic (Port 51820) zur Mullvad-IP über WAN zu erzwingen
    → Keine Wirkung nach LTE-Failover
  • configctl system config reload
    → Lädt die Konfiguration neu, aber ändert keine aktiven Dienste
  • Manuelle Bearbeitung von

    /conf/config.xml (per

    sed, um die Instanz zu deaktivieren/aktivieren)
    → Ohne den GUI-,,Übernehmen"-Schritt werden die Änderungen nicht wirksam
  • service wireguard stop/start
    → Nicht verfügbar; WireGuard wird über das Plugin verwaltet, nicht über klassische rc-Skripte
  • Shell-Skripte mit

    configctl und

    interface reconfigure all
    → Reproduzieren nicht das Verhalten des GUI-,,Übernehmen"-Schritts
  • OPNsense neu starten
    → Ein kompletter Reboot funktioniert, ist aber keine praktikable Lösung

Zusammenfassung:
WireGuard in OPNsense wechselt nach einem Failover auf LTE nicht automatisch zurück auf das primäre WAN-Interface. Der Tunnel bleibt an LTE gebunden, auch wenn WAN wieder verfügbar ist. Es gibt keine CLI- oder API-Methode, die zuverlässig das Verhalten der GUI nachbildet. Die einzige bekannte funktionierende Lösung ist das manuelle Deaktivieren und Reaktivieren der WireGuard-Instanz über die Weboberfläche oder Stick abziehen.


Jemand eine Idee wie man das beheben könnte?
#2
Hi friends,

I'm new to OPNsense and actually stuck with one problem, maybe someone can help me out.

Setup:


  • OPNsense fresh install 25.1 with:
    • WAN (primary Internet)
    • LTE (Huawei USB HiLink stick, backup/failover)
    • WireGuard VPN client (Mullvad)
  • Gateway group configured:

    • WAN = Tier 1
    • LTE = Tier 2
  • Policy-based routing is used:
    • Two specific clients are routed through the WireGuard tunnel
    • All other clients use WAN/LTE depending on availability

Problem:

When WAN fails, LTE takes over and both general traffic and VPN continue to work as expected.
However, when WAN comes back online:

  • General traffic correctly switches back to WAN
  • The two WireGuard clients continue to use the LTE connection
  • The WireGuard tunnel remains bound to LTE and does not rebind to WAN
Only working solution:

The only thing that restores proper routing (WireGuard over WAN) is:

  • Navigate to 

    VPN → WireGuard → Instances
  • Uncheck "Enabled"
  • Click Apply
  • Re-enable the instance
  • Click Apply again
After this, the tunnel is re-established over the WAN interface.
Tried solutions (none worked):


  • configctl wireguard restart
    • Restarts the tunnel logic, but does not trigger interface rebinding
  • Floating firewall rule:

    • Attempted to force UDP traffic (port 51820) to Mullvad IP over WAN
    • Has no effect after LTE failover
  • configctl system config reload
    • Reloads the configuration, but does not apply service changes
  • Manual edit of 

    /conf/config.xml (sed to disable/enable the instance)

    • Without GUI "Apply" step, changes are not applied
  • service wireguard stop/start
    • Not available; WireGuard is managed via plugin, not classic rc scripts
  • Shell scripts using 

    configctl and 

    interface reconfigure all
    • Do not reproduce the effect of the GUI "Apply" step
  • Rebooting OPNsense

    • A full reboot works, but is not a practical solution
Summary:
WireGuard in OPNsense does not automatically rebind to the primary WAN interface after a failover to LTE. The tunnel remains on LTE even when WAN is restored. No CLI or API method reliably reproduces the GUI behavior. The only known working solution is manually disabling and re-enabling the WireGuard instance via the GUI.