How to determine which network connection is active to capture data on Macos for DLP agents.
search cancel

How to determine which network connection is active to capture data on Macos for DLP agents.

book

Article ID: 381804

calendar_today

Updated On:

Products

Data Loss Prevention Endpoint Prevent

Issue/Introduction

When trying to determine which network interface is active in macOS can be information overload. 

Environment

MacOS 

Cause

unable to determine which network interface to run wireshark to troubleshoot EDPA issues. 

Resolution

the following for loop will list all active network interfaces 

for interface in $(networksetup -listallhardwareports | awk '/^Device:/ {print $2}'); do
    ip=$(ipconfig getifaddr $interface)
    if [ -n "$ip" ]; then
        echo "$interface: $ip"
    fi
done

this will return <NIC> <IPAddress>

for example

en0:  192.168.1.55