aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-plip
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-plip')
-rwxr-xr-xsysconfig/network-scripts/ifup-plip14
1 files changed, 5 insertions, 9 deletions
diff --git a/sysconfig/network-scripts/ifup-plip b/sysconfig/network-scripts/ifup-plip
index 48bcc2ca..c3b9efa1 100755
--- a/sysconfig/network-scripts/ifup-plip
+++ b/sysconfig/network-scripts/ifup-plip
@@ -11,21 +11,17 @@ then
exit
fi
-ifconfig ${DEVICE} ${IPADDR} pointopoint ${REMIP}
-route add -net ${NETWORK} netmask ${NETMASK} ${DEVICE}
-
-# this is broken! it's only here to keep compatibility with old RH systems
-if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" ]
-then
- route add default gw ${GATEWAY} metric ${METRIC:-1} ${DEVICE}
-fi
+[ -z "$PREFIX" ] && eval $(/bin/ipcalc --prefix ${IPADDR} ${NETMASK})
+ip addr add ${IPADDR} peer ${REMIP}/${PREFIX} dev ${DEVICE}
+ip link set up dev ${DEVICE}
+ip route add ${NETWORK} 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