mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix on route
This commit is contained in:
parent
4f52b59d98
commit
b80d40f5ec
1 changed files with 4 additions and 4 deletions
|
@ -1147,7 +1147,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 1 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancing " ]) || ([ "$nbintf" = "1" ] && ([ "$(ip r show default metric 1 | grep $OMR_TRACKER_DEVICE)" = "" ] || ([ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ])) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
([ "$nbintf" -gt "1" ] && [ "$(ip r show default metric 1 | tr -d '\t' | tr -d '\n' | sed 's/ *$//')" != "default via $routesbalancing" ] && [ "$(ip r show default metric 1 | tr -d '\t' | tr -d '\n' | sed 's/ *$//')" != "default $routesbalancing" ]) || ([ "$nbintf" = "1" ] && ([ "$(ip r show default metric 1 | grep $OMR_TRACKER_DEVICE)" = "" ] || ([ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ])) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
_log "Change in routes, set ip route replace default scope global $routesbalancing (omrvpn_intf: $omrvpn_intf)"
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Current route: $(ip r)"
|
||||
ip route replace default scope global metric 1 $routesbalancing 2>&1 >/dev/null
|
||||
|
@ -1161,7 +1161,7 @@ if [ "$multipath_config" = "master" ]; then
|
|||
# }
|
||||
#}
|
||||
[ -n "$routesbalancingbackup" ] && {
|
||||
([ "$nbintfb" -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_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ])) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
([ "$nbintfb" -gt "1" ] && [ "$(ip r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancingbackup " ] && [ "$(ip r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default $routesbalancingbackup " ]) || ([ "$nbintf" = "1" ] && ([ "$(ip r show default metric 999 | grep $OMR_TRACKER_DEVICE)" = "" ] || ([ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ])) && [ -n "$OMR_TRACKER_DEVICE_IP" ]) && {
|
||||
_log "Set backup ip route replace default scope global metric 999 $routesbalancingbackup"
|
||||
ip route replace default scope global metric 999 $routesbalancingbackup 2>&1 >/dev/null
|
||||
}
|
||||
|
@ -1180,13 +1180,13 @@ if [ "$multipath_config" = "master" ]; then
|
|||
config_load network
|
||||
config_foreach set_route_balancing6 interface
|
||||
[ -n "$routesbalancing6" ] && {
|
||||
([ "$nbintf6" -gt "1" ] && [ "$(ip -6 r show default metric 1 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancing6 " ]) || ([ "$nbintf6" = "1" ] && [ "$(ip -6 r show default metric 1 | grep $OMR_TRACKER_DEVICE)" = "" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ]) && {
|
||||
([ "$nbintf6" -gt "1" ] && [ "$(ip -6 r show default metric 1 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancing6 " ] && [ "$(ip -6 r show default metric 1 | tr -d '\t' | tr -d '\n')" != "default $routesbalancing6 " ]) || ([ "$nbintf6" = "1" ] && [ "$(ip -6 r show default metric 1 | grep $OMR_TRACKER_DEVICE)" = "" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ]) && {
|
||||
_log "Set ip -6 route replace default scope global metric 1 $routesbalancing6"
|
||||
ip -6 route replace default scope global metric 1 $routesbalancing6 2>&1 >/dev/null
|
||||
}
|
||||
}
|
||||
[ -n "$routesbalancingbackup6" ] && {
|
||||
([ "$nbintfb6" -gt "1" ] && [ "$(ip -6 r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancingbackup6 " ]) || ([ "$nbintf6" = "1" ] && [ "$(ip -6 r show default metric 999 | grep $OMR_TRACKER_DEVICE)" = "" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ]) && {
|
||||
([ "$nbintfb6" -gt "1" ] && [ "$(ip -6 r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default via $routesbalancingbackup6 " ] && [ "$(ip -6 r show default metric 999 | tr -d '\t' | tr -d '\n')" != "default $routesbalancingbackup6 " ]) || ([ "$nbintf6" = "1" ] && [ "$(ip -6 r show default metric 999 | grep $OMR_TRACKER_DEVICE)" = "" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ]) && {
|
||||
_log "Set backup ip -6 route replace default scope global $routesbalancingbackup6"
|
||||
ip -6 route replace default scope global metric 999 $routesbalancingbackup6 2>&1 >/dev/null
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue