Skip to content

Instantly share code, notes, and snippets.

@jim-p
Created January 9, 2018 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jim-p/3e471362180e39524089db2afd940dfe to your computer and use it in GitHub Desktop.
Save jim-p/3e471362180e39524089db2afd940dfe to your computer and use it in GitHub Desktop.
OpenVPN tap mode push route-gateway for bridge interface
diff --git a/src/etc/inc/openvpn.inc b/src/etc/inc/openvpn.inc
index 0b7f1fa949..fa240a57d9 100644
--- a/src/etc/inc/openvpn.inc
+++ b/src/etc/inc/openvpn.inc
@@ -950,6 +950,9 @@ function openvpn_reconfigure($mode, $settings) {
} else {
$conf .= "mode server\n";
}
+ if (is_ipaddrv4($biface_ip)) {
+ $conf .= "push \"route-gateway {$biface_ip}\"\n";
+ }
} else {
$conf .= "mode server\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment