summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet112
1 files changed, 9 insertions, 3 deletions
diff --git a/rc.inet1 b/rc.inet1
index 1f3cb60..cf9da0f 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/bash
# /etc/rc.d/rc.inet1
# This script is used to bring up the various network interfaces.
#
@@ -209,7 +209,10 @@ if_up() {
# Add extra IP addresses, if defined, to interface
num=0
for ipalias in ${IPALIASES[$i]}; do
- /sbin/ip address add ${ipalias}/32 dev ${1} label ${1}:${num} ;
+ ip="${ipalias%/*}"
+ nm="${ipalias#*/}"
+ [ -z "$nm" ] || [ "$ip" == "$nm" ] && nm="32"
+ /sbin/ip address add ${ip}/${nm} dev ${1} label ${1}:${num}
num=$(($num + 1))
done
fi
@@ -230,7 +233,10 @@ if_up() {
if [ -n "${IPALIASES[$i]}" ]; then
num=0
for ipalias in ${IPALIASES[$i]}; do
- /sbin/ip address add ${ipalias}/32 dev ${1} label ${1}:${num} ;
+ ip="${ipalias%/*}"
+ nm="${ipalias#*/}"
+ [ -z "$nm" ] || [ "$ip" == "$nm" ] && nm="32"
+ /sbin/ip address add ${ip}/${nm} dev ${1} label ${1}:${num}
num=$(($num + 1))
done
fi