mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
autodetect manager IP
This commit is contained in:
@@ -1606,6 +1606,15 @@ networking_needful() {
|
|||||||
fi
|
fi
|
||||||
set_main_ip
|
set_main_ip
|
||||||
compare_main_nic_ip
|
compare_main_nic_ip
|
||||||
|
|
||||||
|
# Attempt to autodetect the manager IP, if an offset value exists
|
||||||
|
if [[ -n "$MSRVIP_OFFSET" && -z "$MSRVIP" ]]; then
|
||||||
|
mips1=$(echo "$MNIC_IP" | awk -F. '{print $1}')
|
||||||
|
mips2=$(echo "$MNIC_IP" | awk -F. '{print $2}')
|
||||||
|
mips3=$(echo "$MNIC_IP" | awk -F. '{print $3}')
|
||||||
|
mips4=$(echo "$MNIC_IP" | awk -F. '{print $4}')
|
||||||
|
MSRVIP="$mips1.$mips2.$mips3.$((mips4+$MSRVIP_OFFSET))"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
network_setup() {
|
network_setup() {
|
||||||
|
|||||||
@@ -183,8 +183,10 @@ if [ -n "$test_profile" ]; then
|
|||||||
|
|
||||||
if [[ "$test_profile" =~ "-sensor-" ]]; then
|
if [[ "$test_profile" =~ "-sensor-" ]]; then
|
||||||
HOSTNAME=sensor
|
HOSTNAME=sensor
|
||||||
|
MSRVIP_OFFSET=-2
|
||||||
elif [[ "$test_profile" =~ "-search-" ]]; then
|
elif [[ "$test_profile" =~ "-search-" ]]; then
|
||||||
HOSTNAME=search
|
HOSTNAME=search
|
||||||
|
MSRVIP_OFFSET=-1
|
||||||
else
|
else
|
||||||
HOSTNAME=manager
|
HOSTNAME=manager
|
||||||
fi
|
fi
|
||||||
@@ -192,14 +194,11 @@ if [ -n "$test_profile" ]; then
|
|||||||
MSRV=manager
|
MSRV=manager
|
||||||
if [[ "$test_profile" =~ "-net" ]]; then
|
if [[ "$test_profile" =~ "-net" ]]; then
|
||||||
address_type=DHCP
|
address_type=DHCP
|
||||||
MSRVIP=10.66.166.72
|
|
||||||
elif [[ "$test_profile" =~ "-cloud" ]]; then
|
elif [[ "$test_profile" =~ "-cloud" ]]; then
|
||||||
MSRVIP=10.99.1.20
|
MSRVIP=10.99.1.20
|
||||||
elif [[ "$test_profile" =~ "-iso" ]]; then
|
elif [[ "$test_profile" =~ "-iso" ]]; then
|
||||||
MSRVIP=10.66.166.42
|
|
||||||
elif [[ "$test_profile" =~ "-airgap" ]]; then
|
elif [[ "$test_profile" =~ "-airgap" ]]; then
|
||||||
is_airgap=true
|
is_airgap=true
|
||||||
MSRVIP=10.66.166.52
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "/root/public_ip" ]; then
|
if [ -f "/root/public_ip" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user