aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-ctc
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-ctc')
-rwxr-xr-xsysconfig/network-scripts/ifup-ctc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/ifup-ctc b/sysconfig/network-scripts/ifup-ctc
index e268d7cc..39d6a09c 100755
--- a/sysconfig/network-scripts/ifup-ctc
+++ b/sysconfig/network-scripts/ifup-ctc
@@ -23,10 +23,11 @@ if [ "$2" = "boot" -a "${ONBOOT}" = "no" ]
then
exit
fi
-[ -n "${MTU}" ] && opts="${opts} mtu ${MTU}"
-
-ifconfig ${DEVICE} ${IPADDR} ${opts} pointopoint ${GATEWAY} netmask ${NETMASK}
+[ -n "${MTU}" ] && ip link set dev ${DEVICE} mtu ${MTU}
+[ -z "$PREFIX" ] && eval $(/bin/ipcalc --prefix ${IPADDR} ${NETMASK})
+ip addr add ${IPADDR} peer ${GATEWAY}/${PREFIX} dev ${DEVICE}
+ip link set up dev ${DEVICE}
# Wait for the device to come up - the chandev'ified ctc driver can take
# quite a while...
timeout=0
@@ -39,13 +40,13 @@ while ! ping -w 30 -c 1 ${GATEWAY} &>/dev/null; do
done
if [ "${NETWORK}" != "" ] ; then
- route add -host ${GATEWAY} metric 1 ${DEVICE}
+ ip route add to ${GATEWAY} metric 1 dev ${DEVICE}
fi
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