aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-plusb
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-plusb')
-rw-r--r--sysconfig/network-scripts/ifup-plusb10
1 files changed, 6 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup-plusb b/sysconfig/network-scripts/ifup-plusb
index e185e647..ce5a0321 100644
--- a/sysconfig/network-scripts/ifup-plusb
+++ b/sysconfig/network-scripts/ifup-plusb
@@ -22,19 +22,21 @@ then
exit
fi
+[ -z "$PREFIX" ] && eval $(/bin/ipcalc --prefix ${IPADDR} ${NETMASK})
+
if [ ${BROADCAST} != "" ] ; then
- ifconfig ${DEVICE} ${IPADDR} pointopoint ${REMIP} netmask ${NETMASK}
-broadcast ${BROADCAST}
+ ip addr add ${IPADDR} peer ${REMIP}/${PREFIX} broadcast ${BROADCAST} dev ${DEVICE}
else
- ifconfig ${DEVICE} ${IPADDR} pointopoint ${REMIP} netmask ${NETMASK}
+ ip addr add ${IPADDR} peer ${REMIP}/${PREFIX} dev ${DEVICE}
fi
+ip link set up dev ${DEVICE}
. /etc/sysconfig/network
if [ "${GATEWAY}" != "" ]; then
if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
# set up default gateway
- route add default gw ${GATEWAY} ${METRIC:+metric $METRIC}
+ ip route replace default ${METRIC:+metric $METRIC} via ${GATEWAY}
fi
fi