ip — Modern Linux network utility — addresses, links, routes, neighbours across all 5 shells
Equivalents in every shell
ip addr showSubcommands abbreviated: `a`=addr, `l`=link, `r`=route, `n`=neigh. `ip a` lists addresses; `ip link` shows physical/virtual interfaces; `ip route` shows the routing table; `ip neigh` is the ARP/NDP cache. Modify with `ip addr add 192.168.1.10/24 dev eth0`, `ip link set eth0 up`, `ip route add default via 192.168.1.1`. Replaces all of `ifconfig` + `route` + `arp` from the legacy `net-tools`.
ip addr showSame `iproute2` binary on Linux. macOS does NOT ship `ip` — use `ifconfig` for addresses/links, `netstat -nr` for routes, `arp -a` for the neighbour cache. The portable cross-platform way to ask "what is my IP?" is `hostname -I` (Linux) vs `ipconfig getifaddr en0` (macOS).
ip addr showSame external. Fish completion for `ip` is good — TAB after `ip ` suggests every top-level subcommand; TAB after `ip link set ` lists interface names from `/sys/class/net/`. JSON output for scripts: `ip -j addr show | jq` (since iproute2 4.13, 2017) — much safer than parsing the columnar default.
Get-NetAdapter; Get-NetIPAddressNo single cmdlet covers what Linux `ip` does. Address-level: `Get-NetIPAddress` / `New-NetIPAddress -InterfaceIndex 5 -IPAddress 192.168.1.10 -PrefixLength 24`. Link-level: `Get-NetAdapter` / `Enable-NetAdapter` / `Disable-NetAdapter`. Route-level: `Get-NetRoute` / `New-NetRoute`. Neighbour cache: `Get-NetNeighbor`. Each lives in the `NetTCPIP` / `NetAdapter` modules — Windows-only.
ipconfig /allcmd has no unified equivalent. Address info: `ipconfig` (basic) or `ipconfig /all` (DNS, DHCP lease, MAC). Routing: `route print`. Neighbours: `arp -a`. Renew DHCP: `ipconfig /release && ipconfig /renew`. Flush DNS cache: `ipconfig /flushdns`. The modern Windows replacement for ALL of these is the PowerShell `Net*` cmdlets.
Worked examples
Show all interface IP addresses
ip -4 addr showGet-NetIPAddress -AddressFamily IPv4 | Select-Object InterfaceAlias, IPAddress, PrefixLengthipconfigAdd a static IP to an interface
sudo ip addr add 192.168.1.10/24 dev eth0New-NetIPAddress -InterfaceAlias Ethernet -IPAddress 192.168.1.10 -PrefixLength 24netsh interface ip set address "Ethernet" static 192.168.1.10 255.255.255.0Bring an interface up / down
sudo ip link set eth0 upEnable-NetAdapter -Name Ethernetnetsh interface set interface "Ethernet" enableGotchas
- `ip` is LINUX-ONLY — installed by `iproute2`, missing on macOS and BSD by default. Some macOS package collections (Homebrew `iproute2mac`) provide a partial port, but coverage is incomplete. For cross-Unix scripts, prefer `ifconfig` + `netstat -nr` + `arp -a` (the lowest common denominator), or branch on `uname`.
- The columnar default output of `ip a` is NOT machine-parseable reliably across iproute2 versions — columns shift, IPv6 addresses sometimes wrap. Use `ip -j addr` (JSON) and pipe to `jq` for any scripted parsing. iproute2 added JSON output in 4.13 (2017) — RHEL 7 and Ubuntu 16.04 are too old for it.
- Changes made with `ip` are NOT persistent across reboots. To persist them, edit the distro's network config (`/etc/netplan/*.yaml` on modern Ubuntu, `/etc/NetworkManager/system-connections/*` on RHEL/Fedora, `/etc/network/interfaces` on Debian classic, `systemd-networkd` `.network` files elsewhere). The `ip` command is for live config; the YAML/INI files are for boot-time config.
- PowerShell `New-NetIPAddress` does NOT persist either — it writes to the live config AND the registry, so the new IP survives reboot UNLESS the interface is DHCP-configured (DHCP renewal will overwrite). To make the change durable, also call `Set-NetIPInterface -Dhcp Disabled` to switch the interface to static mode.
- On systems with multiple default routes (e.g. VPN up + LAN up + WiFi up), `ip route get 8.8.8.8` is the right command to determine which one Linux will actually use for outbound traffic. The first line of `ip route show default` shows the route with the LOWEST metric — but the kernel's actual routing decision involves source-address selection, policy routing, and per-process namespaces.
WSL & PowerShell Core notes
Common tasks using ip
- Get the local IP address
Find the IPv4 address your machine is using on the local network — for sharing dev servers, configuring peers, and debugging "why can't my phone reach my laptop".
- Get the MAC address of a network interface
Print the hardware (link-layer) address of one or all network interfaces — for license-binding, WoL setup, DHCP reservation matching, inventory audits, or diagnosing why a switch port shows an unexpected device.