From fcf859ffedde3ed209bc7ab6e8b332538620c8e1 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Mon, 5 Aug 2024 14:53:11 -0400 Subject: [PATCH] start adding bridge for hyper --- setup/so-functions | 23 +++++++++++++++++++++++ setup/so-setup | 1 + 2 files changed, 24 insertions(+) diff --git a/setup/so-functions b/setup/so-functions index 870aa77d2..7b3e7e507 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -740,6 +740,29 @@ configure_network_sensor() { return $err } +configure_hyper_bridge() { + info "Setting up hypervisor bridge" + info "Checking $MNIC is using static or DHCP" + sod=$(nmcli -f ipv4.method con show $MNIC) + + # Create the bond interface only if it doesn't already exist + nmcli -f name,uuid -p con | grep -q br0 + local found_int=$? + + if [[ $found_int != 0 ]]; then + nmcli con add ifname br0 type bridge con-name br0 >> "$setup_log" 2>&1 + fi + + # as mgmt interface as slave + nmcli con add type bridge-slave ifname "$MNIC" master br0 + + local err=0 + nmcli con down "$MNIC" + nmcli con up br0 + + return $err +} + copy_salt_master_config() { title "Copy the Salt master config template to the proper directory" diff --git a/setup/so-setup b/setup/so-setup index 005bf903d..5ae0a5218 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -628,6 +628,7 @@ if ! [[ -f $install_opt_file ]]; then info "Setting up as node type hypervisor" check_requirements networking_needful + configure_hyper_bridge collect_mngr_hostname add_mngr_ip_to_hosts check_manager_connection