mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
First attempt at writing a function to create a bond using nmcli
This commit is contained in:
@@ -245,6 +245,36 @@ copy_ssh_key() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_bond_nmcli() {
|
||||||
|
echo "Setting up Bond" >>~/sosetup.log 2>&1
|
||||||
|
|
||||||
|
# Set the MTU
|
||||||
|
if [ $NSMSETUP != 'ADVANCED' ]; then
|
||||||
|
MTU=1500
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create the bond interface
|
||||||
|
nmcli con add type bond ifname bond0 con-name "bond0" \
|
||||||
|
bond.options "mode=0" \
|
||||||
|
802-3-ethernet.mtu $MTU \
|
||||||
|
ipv4.method "manual" \
|
||||||
|
connection.autoconnect "yes" \
|
||||||
|
>> ~/sosetup.log 2>&1
|
||||||
|
|
||||||
|
for BNIC in ${BNICS[@]}; do
|
||||||
|
# Strip the quotes from the NIC names
|
||||||
|
BONDNIC=${awk -F\" | '{print $2}' <<< $BNIC}
|
||||||
|
# Create the slave interface and assign it to the bond
|
||||||
|
nmcli con add type ethernet ifname $BONDNIC master bond0 \
|
||||||
|
connection.autoconnect yes \
|
||||||
|
802-3-ethernet.mtu $MTU \
|
||||||
|
con-name "bond0-slave-$BNIC" \
|
||||||
|
>> ~/sosetup.log 2>&1
|
||||||
|
# Bring the slave interface up
|
||||||
|
nmcli con up bond0-slave-$BNIC >> ~/sosetup.log 2>&1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
create_bond() {
|
create_bond() {
|
||||||
|
|
||||||
# Create the bond interface
|
# Create the bond interface
|
||||||
|
|||||||
Reference in New Issue
Block a user