diff options
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 |