IP, routing and IPv6

See Mac network settings in Terminal

macOS includes command-line tools that show the same network settings as System Settings, and more. Reading settings does not need an administrator.

Applies to: All current macOS versions.Checked: 29 October 2026

Symptoms

  • You want to see network settings fast, or copy them for a support request.
  • System Settings does not show the detail that you need.
  • You want to check settings in a script.

Likely causes

  • Several tools. networksetup reads and changes services. scutil shows the live DNS and proxy state. ipconfig shows DHCP data.
  • Services and devices. A service has a name such as Wi-Fi. A device has a name such as en0. Commands take one or the other.

How to check

  1. List the hardware ports with their device names and MAC addresses.

    networksetup -listallhardwareports
  2. List the services in the order that the Mac uses them.

    networksetup -listnetworkserviceorder
  3. Show the IP address, subnet mask, router and hardware address of a service.

    networksetup -getinfo Wi-Fi
  4. Show the IPv4 address of a device.

    ipconfig getifaddr en0
  5. Show the default router and the interface that it uses.

    route -n get default
  6. Show the routing tables.

    netstat -rn
  7. Show the live DNS configuration, with all resolvers.

    scutil --dns
  8. Show the system proxy configuration.

    scutil --proxy
  9. Show the DHCP data that the Mac accepted.

    ipconfig getpacket en0
  10. Find out if a host is reachable with the current configuration.

    scutil -r apple.com

How to fix it

  1. Most networksetup commands that change settings need administrator rights. Read the man page first.

    man networksetup
  2. Before a change, save the current values, so that you can put them back.

    networksetup -getdnsservers Wi-Fi > ~/dns-before.txt

With Kilobat

  1. Kilobat gives many of these values as JSON, for scripts and agents.

    kilobat diagnose --json
  2. Show the current Wi-Fi link with signal, channel and link rate.

    kilobat wifi status --json

Questions

Why does networksetup ask for a password?

The networksetup man page says that it needs at least admin rights to change network settings.

Is ipconfig the same as on Windows?

No. The macOS ipconfig talks to the IPConfiguration agent. Its man page says to use it for test and debug only.

Sources

  • networksetup(8), man page installed with macOS 27.2
  • scutil(8), man page installed with macOS 27.2
  • ipconfig(8), man page installed with macOS 27.2
  • route(8), man page installed with macOS 27.2
  • netstat(1), man page installed with macOS 27.2

Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.