mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 02:51:50 +00:00
Fix routes in post tracking
This commit is contained in:
parent
29b20d0e98
commit
4be6009680
1 changed files with 3 additions and 3 deletions
|
@ -164,7 +164,7 @@ set_routes_intf() {
|
|||
interface_gw=$(ubus call network.interface.${INTERFACE}_4 status 2>/dev/null | jsonfilter -q -l 1 -e '@.inactive.route[@.target="0.0.0.0"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
#if [ "$interface_gw" != "" ] && [ "$interface_if" != "" ] && [ "$(ip route show $serverip | grep $interface_if)" = "" ]; then
|
||||
if [ "$interface_gw" != "" ] && [ "$interface_if" != "" ] && [ -n "$(echo $interface_gw | grep :)" ]; then
|
||||
if [ "$interface_gw" != "" ] && [ "$interface_if" != "" ] && [ -z "$(echo $interface_gw | grep :)" ]; then
|
||||
if [ "$multipath_config_route" = "master" ]; then
|
||||
weight=10
|
||||
else
|
||||
|
@ -827,7 +827,7 @@ if [ "$multipath_config" = "master" ]; then
|
|||
config_foreach set_route_balancing interface
|
||||
config_foreach set_route_balancing6 interface
|
||||
[ -n "$routesbalancing" ] && {
|
||||
([ "$nbintf" -gt "1" ] && [ "$(ip r show default metric 0 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancing " ]) || ([ "$nbintf" = "1" ] && [ "$(ip r show default metric 0 | grep $OMR_TRACKER_DEVICE)" = "" ] && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
([ "$nbintf" -gt "1" ] && [ "$(ip r show default metric 0 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancing " ]) || ([ "$nbintf" = "1" ] && ([ "$(ip r show default metric 0 | grep $OMR_TRACKER_DEVICE)" = "" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ]) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
_log "Set ip route replace default scope global $routesbalancing"
|
||||
ip route replace default scope global metric 0 $routesbalancing
|
||||
}
|
||||
|
@ -839,7 +839,7 @@ if [ "$multipath_config" = "master" ]; then
|
|||
}
|
||||
}
|
||||
[ -n "$routesbalancingbackup" ] && {
|
||||
([ "$nbintf" -gt "1" ] && [ "$(ip r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancingbackup " ]) || ([ "$nbintf" = "1" ] && [ "$(ip r show default metric 999 | grep $OMR_TRACKER_DEVICE)" = "" ] && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
([ "$nbintf" -gt "1" ] && [ "$(ip r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancingbackup " ]) || ([ "$nbintf" = "1" ] && ([ "$(ip r show default metric 999 | grep $OMR_TRACKER_DEVICE)" = "" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ]) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
_log "Set backup ip route replace default scope global $routesbalancingbackup"
|
||||
ip route replace default scope global metric 999 $routesbalancingbackup
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue