|
@ -130,7 +130,12 @@ mwan3_create_iface_iptables() |
|
|
|
|
|
|
|
|
if [ "$family" == "ipv4" ]; then |
|
|
if [ "$family" == "ipv4" ]; then |
|
|
|
|
|
|
|
|
network_get_ipaddr src_ip $1 |
|
|
|
|
|
|
|
|
ubus call network.interface.${1}_4 status &>/dev/null |
|
|
|
|
|
if [ "$?" -eq "0" ]; then |
|
|
|
|
|
network_get_ipaddr src_ip ${1}_4 |
|
|
|
|
|
else |
|
|
|
|
|
network_get_ipaddr src_ip $1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
$IPS -! create mwan3_connected list:set |
|
|
$IPS -! create mwan3_connected list:set |
|
|
|
|
|
|
|
@ -166,7 +171,12 @@ mwan3_create_iface_iptables() |
|
|
|
|
|
|
|
|
if [ "$family" == "ipv6" ]; then |
|
|
if [ "$family" == "ipv6" ]; then |
|
|
|
|
|
|
|
|
network_get_ipaddr6 src_ipv6 $1 |
|
|
|
|
|
|
|
|
ubus call network.interface.${1}_6 status &>/dev/null |
|
|
|
|
|
if [ "$?" -eq "0" ]; then |
|
|
|
|
|
network_get_ipaddr6 src_ipv6 ${1}_6 |
|
|
|
|
|
else |
|
|
|
|
|
network_get_ipaddr6 src_ipv6 $1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
$IPS -! create mwan3_connected_v6 hash:net family inet6 |
|
|
$IPS -! create mwan3_connected_v6 hash:net family inet6 |
|
|
|
|
|
|
|
@ -238,8 +248,13 @@ mwan3_create_iface_route() |
|
|
[ -n "$id" ] || return 0 |
|
|
[ -n "$id" ] || return 0 |
|
|
|
|
|
|
|
|
if [ "$family" == "ipv4" ]; then |
|
|
if [ "$family" == "ipv4" ]; then |
|
|
|
|
|
ubus call network.interface.${1}_4 status &>/dev/null |
|
|
|
|
|
if [ "$?" -eq "0" ]; then |
|
|
|
|
|
network_get_gateway route_args ${1}_4 |
|
|
|
|
|
else |
|
|
|
|
|
network_get_gateway route_args $1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
network_get_gateway route_args $1 |
|
|
|
|
|
route_args="via $route_args dev $2" |
|
|
route_args="via $route_args dev $2" |
|
|
|
|
|
|
|
|
$IP4 route flush table $id |
|
|
$IP4 route flush table $id |
|
@ -248,7 +263,13 @@ mwan3_create_iface_route() |
|
|
|
|
|
|
|
|
if [ "$family" == "ipv6" ]; then |
|
|
if [ "$family" == "ipv6" ]; then |
|
|
|
|
|
|
|
|
network_get_gateway6 route_args $1 |
|
|
|
|
|
|
|
|
ubus call network.interface.${1}_6 status &>/dev/null |
|
|
|
|
|
if [ "$?" -eq "0" ]; then |
|
|
|
|
|
network_get_gateway6 route_args ${1}_6 |
|
|
|
|
|
else |
|
|
|
|
|
network_get_gateway6 route_args $1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
route_args="via $route_args dev $2" |
|
|
route_args="via $route_args dev $2" |
|
|
|
|
|
|
|
|
$IP6 route flush table $id |
|
|
$IP6 route flush table $id |
|
|