Listing Listing information on all active interfaces on MacOS is a process involving multiple pieces, which then can be combined together.
Listing all active interfaces try 1
This involves both the -l (list with optional criteria) and -u parameter (the up criterion) as per excerpts from the [Archive.is] ifconfig(8) [osx man page] / [WayBack] ifconfig Man Page – macOS – SS64.com:
NAME
ifconfig -- configure network interface parameters
SYNOPSIS
...
ifconfig -l [-d] [-u] [address_family]
...
DESCRIPTION
The ifconfig utility is used to assign an address to a network interface and/or configure network interface parameters.
The following options are available:
...
address_family
Specify the address family which affects interpretation of the remaining parameters. Since an interface can receive transmissions
in differing protocols with different naming schemes, specifying the address family is recommended. The address or protocol fami-
lies currently supported are ``inet'', ``inet6'', and ``link''. The default is ``inet''. ``ether'' and ``lladdr'' are synonyms
for ``link''.
...
The -l flag may be used to list all available interfaces on the system, with no other additional information. Use of this flag is mutually
exclusive with all other flags and commands, except for -d (only list interfaces that are down) and -u (only list interfaces that are up).
Example:
ifconfig -l -u
Each interface on one line:
ifconfig -l -u | xargs -n1 echo
The problem is that on my system, it also lists bridges as active, whereas they are not:
# ifconfig -l -u | xargs -n1 echo
lo0
en1
en2
en0
p2p0
awdl0
bridge0
utun0
en10
# ifconfig bridge0
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 6a:00:02:9a:23:f0
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
Address cache:
nd6 options=201<PERFORMNUD,DAD>
media:
status: inactive
So this is where the MacOS and BSD documentation is inaccurate.
Interface types
The above interfaces are many more than just ethernet or WiFi interfaces; there is a list at [WayBack] macos – What are en0, en1, p2p, and so on, that are displayed after executing ifconfig? – Stack Overflow by [WayBack] mcint:
In arbitrary order of my familarity / widespread relevance:
lo0 is loopback.
en0 at one point “ethernet”, now is WiFi (and I have no idea what extra en1 or en2 are used for).
fw0 is the FireWire network interface.
stf0 is an IPv6 to IPv4 tunnel interface to support the transition from IPv4 to the IPv6 standard.
gif0 is a more generic tunneling interface [46]-to-[46].
awdl0 is Apple Wireless Direct Link
p2p0 is related to AWDL features. Either as an old version, or virtual interface with different semantics than awdl.
…
many VPNs will add additional devices, often “utun#” or “utap#” following TUN/TAP (L3/L2)virtual networking devices.
More on AWDL at [WayBack] ios – What is AWDL (Apple Wireless Direct Link) and how does it work? – Stack Overflow.
Listing all active interfaces try 2
Read the rest of this entry »