aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2012-01-06 17:38:26 -0500
committerBill Nottingham <notting@redhat.com>2012-01-06 17:38:26 -0500
commit6f6830b700f33172e33db32f12e9bfef3a7f7989 (patch)
treeab1c142ba6c6bc201c10846b7d8ed54ef9aff3bf /sysconfig/network-scripts
parentb5a510d2558d333624dac456790d667e3e7f0570 (diff)
downloadinitscripts-6f6830b700f33172e33db32f12e9bfef3a7f7989.tar
initscripts-6f6830b700f33172e33db32f12e9bfef3a7f7989.tar.gz
initscripts-6f6830b700f33172e33db32f12e9bfef3a7f7989.tar.bz2
initscripts-6f6830b700f33172e33db32f12e9bfef3a7f7989.tar.xz
initscripts-6f6830b700f33172e33db32f12e9bfef3a7f7989.zip
Remove ifconfig usage from assorted ancient device types.
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup-ctc7
-rwxr-xr-xsysconfig/network-scripts/ifup-ippp11
-rwxr-xr-xsysconfig/network-scripts/ifup-plip12
-rwxr-xr-xsysconfig/network-scripts/ifup-plusb8
4 files changed, 20 insertions, 18 deletions
diff --git a/sysconfig/network-scripts/ifup-ctc b/sysconfig/network-scripts/ifup-ctc
index e268d7cc..1a1aec5d 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
diff --git a/sysconfig/network-scripts/ifup-ippp b/sysconfig/network-scripts/ifup-ippp
index 7cfe6f39..6ab69117 100755
--- a/sysconfig/network-scripts/ifup-ippp
+++ b/sysconfig/network-scripts/ifup-ippp
@@ -335,11 +335,14 @@ function addprovider()
[ "$DEBUG" = "yes" ] && options="-d $options"
# set netmask, if available
- [ -n "$NETMASK" ] && netmask="netmask $NETMASK"
-
+ [ -n "$NETMASK" ] && {
+ val=$(ipcalc --prefix $IPADDR $NETMASK)
+ pfx=${val##PREFIX=}
+ }
# activate ISDN device
- /usr/bin/logger -p daemon.info -t ifup-ippp "ifconfig $DEVICE $IPADDR pointopoint $GATEWAY $netmask up"
- ifconfig $DEVICE $IPADDR pointopoint $GATEWAY $netmask up >/dev/null 2>&1
+ /usr/bin/logger -p daemon.info -t ifup-ippp "ip addr add $IPADDR peer $GATEWAY${pfx:/$pfx} dev $DEVICE"
+ ip addr add $IPADDR peer $GATEWAY${pfx:/$pfx} dev $DEVICE
+ ip link set dev $DEVICE up
if [ "$ENCAP" = "syncppp" ]; then
# start ipppd daemon
diff --git a/sysconfig/network-scripts/ifup-plip b/sysconfig/network-scripts/ifup-plip
index 48bcc2ca..7f4f521e 100755
--- a/sysconfig/network-scripts/ifup-plip
+++ b/sysconfig/network-scripts/ifup-plip
@@ -11,14 +11,10 @@ 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
diff --git a/sysconfig/network-scripts/ifup-plusb b/sysconfig/network-scripts/ifup-plusb
index e185e647..7f8f4649 100755
--- a/sysconfig/network-scripts/ifup-plusb
+++ b/sysconfig/network-scripts/ifup-plusb
@@ -22,12 +22,14 @@ 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