OPNsense Forum

English Forums => 26.1, 26,4 Series => Topic started by: systeme on April 21, 2026, 09:20:23 AM

Title: 26.1.X Wireguard - add net default: gateway Invalid argument
Post by: systeme on April 21, 2026, 09:20:23 AM
Hello,

Since upgrading to version 26.1.2 (or 26.1.7), we've been seeing this error in the WireGuard logs at startup:

2026-04-21T07:59:30
Error
wireguard
/usr/local/opnsense/scripts/wireguard/wg-service-control.php: The command </sbin/route add -'inet' default 'IP_WAN_GATEWAY'> returned exit code 1 and the output was "add net default: gateway IP_WAN_GATEWAY fib 0: Invalid argument"

Configuration IP_WAN_GATEWAY :

(https://i.ibb.co/8L00Mx3w/opnsense-forum2.png) (https://ibb.co/21yyqM2r)

The priorities on the gateways have been changed since the last changelog (26.1.2), but the same errors persist.

(https://i.ibb.co/77z0g6F/Copie-d-cran-20260421-090432.png) (https://ibb.co/WS3RDY1)

Opnsense is virtualized, so there are no groups to configure at the gateway level.

Do you have any suggestions on how to avoid this error in the future?

Thank you in advance,

Best regards,