diff options
author | Darren Austin <darren@slackware.uk> | 2018-03-18 03:57:18 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-05-24 01:23:40 -0500 |
commit | 38edd98bc9701f317c43fddafcbf2e808c969293 (patch) | |
tree | 9fa10f64c762780c8689be713d93f4e268ea8b7a /rc.inet1 | |
parent | d97ffe48193b1dfa704caf1896075702686e66c4 (diff) | |
download | slacknetsetup-38edd98bc9701f317c43fddafcbf2e808c969293.tar.xz |
rc.inet1*: Allow setting an interface in promiscuous mode
This is needed for container networking - the bridge for it
must be in promiscuous mode.
Signed-off-by: Robby Workman <rworkman@slackware.com>
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 |