summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet133
1 files changed, 22 insertions, 11 deletions
diff --git a/rc.inet1 b/rc.inet1
index 07c3f77..e9e0b58 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -240,17 +240,6 @@ if_up() {
fi
fi
/sbin/ip link set dev ${1} up # Bring up interface
- # Add extra IP addresses, if defined, to interface
- if [ -n "${IPALIASES[$i]}" ]; then
- num=0
- for ipalias in ${IPALIASES[$i]}; do
- 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
elif [ "${USE_STATELESS[$i]}" = "yes" ]; then # interface should configure itself via stateless RA auto config
echo "/etc/rc.d/rc.inet1: using stateless Router Advertisement auto configuration for ${1}" | $LOGGER
echo "1" >/proc/sys/net/ipv6/conf/$1/accept_ra
@@ -268,6 +257,28 @@ if_up() {
debug_log "${1} interface is not configured in /etc/rc.d/rc.inet1.conf"
return
fi
+ # Add extra IPv4 and v6 addresses, if defined, to the interface
+ if [ -n "${IPALIASES[$i]}" ]; then
+ num=0
+ for ipalias in ${IPALIASES[$i]}; do
+ ip="${ipalias%/*}"
+ nm="${ipalias#*/}"
+ [ -z "$nm" ] || [ "$ip" == "$nm" ] && nm="24"
+ echo "/etc/rc.d/rc.inet1: /sbin/ip address add ${ip}/${nm} dev ${1} label ${1}:${num}" | $LOGGER
+ /sbin/ip address add ${ip}/${nm} dev ${1} label ${1}:${num}
+ num=$(($num + 1))
+ done
+ fi
+ if [ -n "${IPALIASES6[$i]}" ]; then
+ for ipalias in ${IPALIASES6[$i]}; do
+ ip="${ipalias%/*}"
+ nm="${ipalias#*/}"
+ [ -z "$nm" ] || [ "$ip" == "$nm" ] && nm="64"
+ # Unluke IPv4, v6 addresses don't get a label.
+ echo "/etc/rc.d/rc.inet1: /sbin/ip -6 address add ${ip}/${nm} dev ${1}" | $LOGGER
+ /sbin/ip -6 address add ${ip}/${nm} dev ${1}
+ done
+ fi
if [ -n "${MTU[$i]}" ]; then # Force an MTU (possibly over-riding that set by DHCP)
echo "/etc/rc.d/rc.inet1: /sbin/ip link set dev ${1} mtu ${MTU[$i]}" | $LOGGER
/sbin/ip link set dev ${1} mtu ${MTU[$i]}