mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 02:02:50 +01:00
Only perform bond interface operations if it is not a cloud installation
This commit is contained in:
@@ -54,33 +54,37 @@ add_interface_bond0() {
|
|||||||
ethtool -K "$BNIC" $i off &>/dev/null
|
ethtool -K "$BNIC" $i off &>/dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# Check if the bond slave connection has already been created
|
|
||||||
nmcli -f name,uuid -p con | grep -q "bond0-slave-$BNIC"
|
|
||||||
local found_int=$?
|
|
||||||
|
|
||||||
if [[ $found_int != 0 ]]; then
|
if ! [[ is_cloud ]]; then
|
||||||
# Create the slave interface and assign it to the bond
|
# Check if the bond slave connection has already been created
|
||||||
nmcli con add type ethernet ifname "$BNIC" con-name "bond0-slave-$BNIC" master bond0 -- \
|
nmcli -f name,uuid -p con | grep -q "bond0-slave-$BNIC"
|
||||||
ethernet.mtu "$MTU" \
|
local found_int=$?
|
||||||
connection.autoconnect "yes"
|
|
||||||
else
|
|
||||||
local int_uuid
|
|
||||||
int_uuid=$(nmcli -f name,uuid -p con | sed -n "s/bond0-slave-$BNIC //p" | tr -d ' ')
|
|
||||||
|
|
||||||
nmcli con mod "$int_uuid" \
|
if [[ $found_int != 0 ]]; then
|
||||||
ethernet.mtu "$MTU" \
|
# Create the slave interface and assign it to the bond
|
||||||
connection.autoconnect "yes"
|
nmcli con add type ethernet ifname "$BNIC" con-name "bond0-slave-$BNIC" master bond0 -- \
|
||||||
fi
|
ethernet.mtu "$MTU" \
|
||||||
|
connection.autoconnect "yes"
|
||||||
|
else
|
||||||
|
local int_uuid
|
||||||
|
int_uuid=$(nmcli -f name,uuid -p con | sed -n "s/bond0-slave-$BNIC //p" | tr -d ' ')
|
||||||
|
|
||||||
|
nmcli con mod "$int_uuid" \
|
||||||
|
ethernet.mtu "$MTU" \
|
||||||
|
connection.autoconnect "yes"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
ip link set dev "$BNIC" arp off multicast off allmulticast off promisc on
|
ip link set dev "$BNIC" arp off multicast off allmulticast off promisc on
|
||||||
|
|
||||||
# Bring the slave interface up
|
if ! [[ is_cloud ]]; then
|
||||||
if [[ $verbose == true ]]; then
|
# Bring the slave interface up
|
||||||
nmcli con up "bond0-slave-$BNIC"
|
if [[ $verbose == true ]]; then
|
||||||
else
|
nmcli con up "bond0-slave-$BNIC"
|
||||||
nmcli con up "bond0-slave-$BNIC" &>/dev/null
|
else
|
||||||
|
nmcli con up "bond0-slave-$BNIC" &>/dev/null
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$nic_error" != 0 ]; then
|
if [ "$nic_error" != 0 ]; then
|
||||||
return "$nic_error"
|
return "$nic_error"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user