From 9f5824957c4d48caf84cd775269bc6b94b25eb7e Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 2 Nov 2018 14:20:22 +0100 Subject: [PATCH] uvpn/dhclient-script: Use `ip route` instead of `route` --- uvpn/dhclient-script | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/uvpn/dhclient-script b/uvpn/dhclient-script index 50612bb..52183e1 100755 --- a/uvpn/dhclient-script +++ b/uvpn/dhclient-script @@ -50,9 +50,9 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ # Add a network route to the computed network address. for router in $new_routers; do if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then - route add -host $router dev $interface + ip route add $router dev $interface fi - route add default gw $router $metric_arg dev $interface + ip route add default via $router dev $interface $metric_arg done else # we haven't changed the address, have we changed other options @@ -60,13 +60,13 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then # if we've changed routers delete the old and add the new. for router in $old_routers; do - route del default gw $router + ip route del default via $router done for router in $new_routers; do if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then - route add -host $router dev $interface - fi - route add default gw $router $metric_arg dev $interface + ip route add $router dev $interface + fi + ip route add default via $router dev $interface $metric_arg done fi fi @@ -74,7 +74,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ then ifconfig $interface:0- inet 0 ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg - route add -host $alias_ip_address $interface:0 + ip route add $alias_ip_address dev $interface:0 fi exit 0 fi @@ -91,7 +91,7 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \ fi if [ x$alias_ip_address != x ]; then ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg - route add -host $alias_ip_address $interface:0 + ip route add $alias_ip_address dev $interface:0 fi exit 0 fi @@ -107,13 +107,13 @@ if [ x$reason = xTIMEOUT ]; then if [ x$new_ip_address != x$alias_ip_address ] && \ [ x$alias_ip_address != x ]; then ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg - route add -host $alias_ip_address dev $interface:0 + ip route add $alias_ip_address dev $interface:0 fi for router in $new_routers; do if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then - route add -host $router dev $interface + ip route add $router dev $interface fi - route add default gw $router $metric_arg dev $interface + ip route add default via $router dev $interface $metric_arg done exit 0 fi