mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Remove the existing default route before when can add a new one, check when it differs from the existing one
This commit is contained in:
parent
42c462c335
commit
035a5e013f
@ -308,6 +308,10 @@ function system_routing_configure() {
|
||||
}
|
||||
}
|
||||
if(($interfacegw <> "bgpd") && (is_ipaddr($gatewayip))) {
|
||||
preg_match("/default[ ]+([0-9].*?)[ ]+/i", $route_str, $elements);
|
||||
if(trim($elements[1]) != "$gatewayip") {
|
||||
mwexec("/sbin/route delete default " . escapeshellarg($gatewayip), false);
|
||||
}
|
||||
mwexec("/sbin/route add default " . escapeshellarg($gatewayip), true);
|
||||
}
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user