From ef5e672cf001b35146aa897d13b84fd219707fbc Mon Sep 17 00:00:00 2001 From: Matt Eaton Date: Wed, 11 Sep 2024 15:51:13 +0200 Subject: [PATCH] Set ARKIME_NODE_HOST from OS_HOST interface rather than default route Signed-off-by: Matt Eaton --- .../sensor_ctl/supervisor.init/arkime_config_populate.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hedgehog-iso/interface/sensor_ctl/supervisor.init/arkime_config_populate.sh b/hedgehog-iso/interface/sensor_ctl/supervisor.init/arkime_config_populate.sh index 13b6e35d6..e6f533540 100644 --- a/hedgehog-iso/interface/sensor_ctl/supervisor.init/arkime_config_populate.sh +++ b/hedgehog-iso/interface/sensor_ctl/supervisor.init/arkime_config_populate.sh @@ -139,7 +139,11 @@ if [[ -n $SUPERVISOR_PATH ]] && [[ -r "$SUPERVISOR_PATH"/arkime/config.ini ]]; t fi # identify node in session metadata for PCAP reachback - PRIMARY_IP=$(ip route get 255.255.255.255 | grep -Po '(?<=src )(\d{1,3}.){4}' | sed "s/ //g") + if [[ -n $OS_HOST ]]; then + PRIMARY_IP=$(ip route get $OS_HOST | grep -Po '(?<=src )(\d{1,3}.){4}' | sed "s/ //g") + else + PRIMARY_IP=$(ip route get 255.255.255.255 | grep -Po '(?<=src )(\d{1,3}.){4}' | sed "s/ //g") + fi export ARKIME_NODE_NAME="$(hostname --long)" export ARKIME_NODE_HOST="$PRIMARY_IP"