Commit f4187054 authored by Darren 'Tadgy' Austin's avatar Darren 'Tadgy' Austin

Added IPALIASES blocks for v4 and v6; removed old block of IPALIASES code.

parent 73a5f5c1
......@@ -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]}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment