diff options
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -204,13 +204,19 @@ if_up() { # 15 seconds should be a reasonable default DHCP timeout. 30 was too much. echo "/etc/rc.d/rc.inet1: /sbin/dhcpcd -L -t ${DHCP_TIMEOUT[$i]:-15} ${DHCP_OPTIONS} ${1}" | $LOGGER /sbin/dhcpcd -L -t ${DHCP_TIMEOUT[$i]:-15} ${DHCP_OPTIONS} ${1} - # If the dhcpcd call succeeds, add extra IP addresses, if defined, to interface - if [ "$?" == "0" ] && [ -n "${IPALIASES[$i]}" ]; then - num=0 - for ipalias in ${IPALIASES[$i]}; do - /sbin/ip address add ${ipalias}/32 dev ${1} label ${1}:${num} ; - num=$(($num + 1)) - done + if [ "$?" == "0" ]; then # the dhcp call has succeeded + if [ -n "${IPALIASES[$i]}" ]; then + # 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} ; + num=$(($num + 1)) + done + fi + if [ "${PROMISCUOUS[$i]}" = "yes" ]; then + # Set promiscuous mode on the interface + /sbin/ip link set dev ${1} promisc on + fi fi else # bring up interface using a static IP address if [ -n "${IPADDR[$i]}" ]; then # skip unconfigured interfaces @@ -228,6 +234,10 @@ if_up() { num=$(($num + 1)) done fi + if [ "${PROMISCUOUS[$i]}" = "yes" ]; then + # Set promiscuous mode on the interface + /sbin/ip link set dev ${1} promisc on + fi else debug_log "${1} interface is not configured in /etc/rc.d/rc.inet1.conf" fi |