--- /usr/share/shorewall-shell/lib.providers +++ ./lib.providers @@ -149,11 +149,13 @@ save_command "${iface}_up=Yes" - save_command "qt ip route flush table $number" + if [ "x$gateway" != "xnone" ]; then + save_command "qt ip route flush table $number" - indent >&3 << __EOF__ + indent >&3 << __EOF__ echo "qt ip route flush table $number" >> \${VARDIR}/undo_routing __EOF__ + fi if [ "x${duplicate:=-}" != x- ]; then if [ "x${copy:=-}" != "x-" ]; then @@ -183,6 +185,8 @@ fi __EOF__ + elif [ "x$gateway" = "xnone" ]; then + gateway= elif [ "x$gateway" != "x-" -a -n "$gateway" ]; then indent >&3 << __EOF__ run_ip route replace $gateway src \$(find_first_interface_address $interface) dev $interface table $number