48

When I type ifconfig on my Mac terminal, several information is printed. But I can't understand what they are. Can anyone briefly tell me what they are? What are lo0, gif0, en0, and so on?

Here is the results of my terminal.

  Last login: Wed Apr 29 21:22:21 on ttys000
  gim-yeongdeog-ui-MacBook-Air:~ KimYoungDirk$ ifconfig
  lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
       options=3<RXCSUM,TXCSUM>
       inet6 ::1 prefixlen 128 
       inet 127.0.0.1 netmask 0xff000000 
       inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
       nd6 options=1<PERFORMNUD>
  gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
  stf0: flags=0<> mtu 1280
  en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
       ether 64:76:ba:ae:a3:02 
       inet6 fe80::6676:baff:feae:a302%en0 prefixlen 64 scopeid 0x4 
       inet 172.30.7.47 netmask 0xffff0000 broadcast 172.30.255.255
       nd6 options=1<PERFORMNUD>
       media: autoselect
       status: active
  en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
       options=60<TSO4,TSO6>
       ether 32:00:1b:3e:80:00 
       media: autoselect <full-duplex>
       status: inactive
  p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
        ether 06:76:ba:ae:a3:02 
        media: autoselect
        status: inactive
 awdl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1452
        ether 0e:f1:59:ca:a5:30 
        inet6 fe80::cf1:59ff:feca:a530%awdl0 prefixlen 64 scopeid 0x7 
        nd6 options=1<PERFORMNUD>
        media: autoselect
        status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
         options=63<RXCSUM,TXCSUM,TSO4,TSO6>
         ether 66:76:ba:ea:38:00 
        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
        nd6 options=1<PERFORMNUD>
        media: <unknown type>
        status: inactive
  gim-yeongdeog-ui-MacBook-Air:~ KimYoungDirk$ 
nbro
  • 15,395
  • 32
  • 113
  • 196
KimCrab
  • 2,231
  • 4
  • 15
  • 20
  • 3
    http://superuser.com/questions/267660/mac-os-x-please-explain-ifconfig-output – baf Apr 30 '15 at 06:04

4 Answers4

44

Interfaces

In arbitrary order of my familarity / widespread relevance:

lo0 is loopback.

en0 at one point "ethernet", now is WiFi.

en1 and en2 offer IP over Thunderbolt, according to for IF in en1 en2; do ifconfig -v $IF; done. H/T @Mojo66 below.

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 as a virtual interface with different semantics than awdl.

utun# interfaces, utun0, utun1, ...: These are tun/tap interfaces used by 3rd party networking applications to offer interfaces that support full use of the macOS networking stack (more or less). Many VPNs, for example WireGuard, (managed version) TailScale, or ZeroTier, will add these devices, utun# or utap# as TUN(L3/IP) / TAP (L2/Ethernet) kernel virtual networking devices.

Update 2023-03:

bridge0 interface, introduced sometime before macOS 12.6.3, into my default macOS configuration, bridging en1 and en2.

llw0 is a low-latency WAN interface, wow, may be part of exciting new Apple home IoT integrations, the unified, system-managed, but uniformly addressable data channel for coming use alongside ultra-wideband physical localization.

Note also

  • See the "Network" panel in System Preferences to see what network devices "exist" or "can exist" with current configuration.

  • Use netstat -nr to see how traffic is currently routed via network devices according to destination.

  • Interface naming conventions started in BSD were retained in OS X / macOS, and now there also additions.

Also answered in part on Apple SE here and there.

See also, tools

Some extra notes for the interested:

  • networksetup provides more access to system settings. (See -help or man page, invalid arguments yield a compact grep-able representation). I like to use
    • networksetup -getdnsservers <networkservice> and networksetup -setdnsservers <networkservice> <dns1> [dns2] [...] at the granularity of (and using the name specified in) the interface list in System Preferences > Network.
  • Setting up preferred DNS configurations, at home and for coffeeshop wifi redirects, or quick debugging. The empty keyword is critical but not documented.
    • alias networksetup-dns-cf='networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001'
    • alias networksetup-dns-empty='networksetup -setdnsservers Wi-Fi empty'
  • ifconfig
    • ifconfig -l will list just the names. So nice, and rare, not to need to text-mangle results.
    • ifconfig -v [ifname] shows more verbose information under the type: key. It's also pretty cool to see the scheduler (e.g. FQ_CODEL), low power mode, QoS marking, neighbor discovery settings (for IPv6).
mcint
  • 804
  • 8
  • 18
13

These are your network interfaces. Some are physical interfaces, and others are logical (virtual) interfaces.

en0..X refer to your physical network interfaces. Most new Mac devices will just have en0 - your WiFi. en0 is the first device to start, en1 the second, etc.

lo0 is the 'loopback' interface. Otherwise known as localhost, or 127.0.0.1. The others are virtual interfaces.

nbro
  • 15,395
  • 32
  • 113
  • 196
c4talyst
  • 243
  • 2
  • 10
5

The -v flag provides a type info on some interfaces, for example IP over Thunderbolt for en2:

ifconfig -v en2                              
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 index 6
    eflags=41000080<TXSTART,ECN_ENABLE,FASTLN_ON>
    options=460<TSO4,TSO6,CHANNEL_IO>
    ether 82:02:9f:a3:0c:00 
    netif: EF77BC13-3B69-466C-8BA2-591CCA2D6C44
    flowswitch: C155EE61-3E2C-465E-9AFB-17C36ECD8F8C
    media: autoselect <full-duplex>
    status: inactive
    type: IP over Thunderbolt
    agent domain:Skywalk type:NetIf flags:0xa443 desc:"Userspace Networking"
    agent domain:Skywalk type:FlowSwitch flags:0x4403 desc:"Userspace Networking"
    state availability: 0 (true)
    scheduler: FQ_CODEL 
    qosmarking enabled: yes mode: none
    low power mode: disabled
    multi layer packet logging (mpklog): disabled
    routermode4: disabled
    routermode6: disabled
Mojo66
  • 1,109
  • 12
  • 21
0

Additional info. Sometimes a device plugged into a Mac by USB gets a virtual enX device and an IP address assigned. For instance plugging in an iPhone may do this, even if you've only plugged in to charge it and aren't doing anything with it.

  • This is pretty significant. Helped me track down a bug where the wrong "available" IPAddress was chosen and displayed for the user. Thanks, Geoff! – FromTheStix Apr 10 '23 at 19:06