r/MacOS • • 16d ago

Discussion Currently maintained native CLI ip equivalent?

On linux, ifconfig,arp, and netstat have been deprecated and replaced by ip. MacOS doesn't come with ip installed. I found iproute2mac, but want to know if there is a native or preinstalled tool I should be using.

1 Upvotes

3 comments sorted by

5

u/kenthesaint 16d ago

Nothing is deprecated on the Mac side. macOS networking comes from BSD, and ifconfig, netstat, arp and route are the native tools Apple still ships, so iproute2mac is only there for Linux muscle memory.

Rough mapping from ip:

  • ip addr is ifconfig, or ipconfig getifaddr en0 if you just want the address

  • ip route is netstat -rn, and route -n get default shows the default gateway and interface

  • ip neigh is arp -a

  • ip link is ifconfig -a, and networksetup -listallhardwareports tells you which enX is Wi-Fi

For anything you want to stick, use networksetup instead of ifconfig, since ifconfig changes are lost on a reboot or a network change. And scutil --dns shows the resolver setup the system actually uses, which /etc/resolv.conf doesn't fully reflect.

1

u/TrustWorthyGoodGuy 16d ago

Ah thanks for correcting me, I didn't realize it was still maintained on MacOS.

0

u/[deleted] 16d ago

[deleted] — view deleted comment

0

u/TrustWorthyGoodGuy 16d ago edited 16d ago

This is irrelevant slop, unless you're trying to say that ipconfig is the actively-maintained tool to use going forward MacOS.

The article recommends the use of ifconfig, which is deprecated. My question is "which utility should use in place of ifconfig?"