} elseif (!empty((string)$server->gateway)) { /* Only bind the gateway ip to the tunnel */ $ipprefix = strpos($tunneladdress, ":") === false ? "-4" : "-6 "; mwexecf('/sbin/route -q -n add [b]-%s[/b] %s -iface %s', [$ipprefix, $server->gateway, $server->interface]); }the line mwexecf has a bug in it, causing the ip prefix to have an extra [b]-[/b] in it.I fixed the bug by changing the line to:[code]mwexecf('/sbin/route -q -n add [b]%s[/b] %s -iface %s', [$ipprefix, $server->gateway, $server->interface]);
/usr/local/opnsense/scripts/Wireguard/wg-service-control.php 83 foreach ($routes_to_add as $ipproto => $routes) { 84 foreach (array_unique($routes) as $route) { 85 mwexecf('/sbin/route -q -n add -%s %s -interface %s', [$ipproto, $route, $server->interface]); 86 } 87 } 88 } elseif (!empty((string)$server->gateway)) { 89 /* Only bind the gateway ip to the tunnel */ 90 $ipprefix = strpos($tunneladdress, ":") === false ? "-4" : "-6"; 91 mwexecf('/sbin/route -q -n add %s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]); 92 }
ok I finally was able to ssh my OPNsense.However, I was surprised NOT to find the dash character you mentionned above.Here is my script file and it still doesn't work :Code: [Select]/usr/local/opnsense/scripts/Wireguard/wg-service-control.php 90 $ipprefix = strpos($tunneladdress, ":") === false ? "-4" : "-6"; 91 [b] mwexecf('/sbin/route -q -n add %s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]);[/b] 92 }
/usr/local/opnsense/scripts/Wireguard/wg-service-control.php 90 $ipprefix = strpos($tunneladdress, ":") === false ? "-4" : "-6"; 91 [b] mwexecf('/sbin/route -q -n add %s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]);[/b] 92 }
as of time of writing, I applied all updates. The wireguard does not work on any VPN provider. the whole issue started for me yesterday after last update round.wg interface does handshake and shows as green in the dashboard. it worked for past 5 months.
Quote from: worst_version on September 02, 2023, 01:44:43 amas of time of writing, I applied all updates. The wireguard does not work on any VPN provider. the whole issue started for me yesterday after last update round.wg interface does handshake and shows as green in the dashboard. it worked for past 5 months.Careful reporting 3rd party VPN issues as OPNsense issues. Sometimes servers change, are decommissioned or down for an extended period of time. When the server is back it may happen to have different keys altogether.Your VPN provider should have a status page listing the servers.