Three tools, one job: inspect and configure network interfaces. ip is the modern Linux standard. ifconfig is the classic Unix tool (still found on macOS and older Linux). ipconfig is the Windows equivalent.
Interfaces · IP Addresses · Routes · Linux · macOS · Windows
01 — Which Tool to Use
| Tool | Platform | Status |
|---|---|---|
| ip | Linux | Modern standard — part of iproute2. Preferred on all current Linux distros. |
| ifconfig | Linux, macOS, BSD | Legacy — deprecated on Linux but still default on macOS and BSD. |
| ipconfig | Windows | Built-in Windows tool for viewing and managing IP configuration. |
On modern Linux, always reach for ip first. On macOS, ifconfig still reigns. On Windows, ipconfig is your only native option.
02 — Show Interface Information
Linux — ip
# All interfaces with addresses
ip addr show
# Short form
ip a
# Specific interface
ip addr show eth0
Linux / macOS — ifconfig
# All interfaces
ifconfig
# Specific interface
ifconfig eth0
Windows — ipconfig
# Summary
ipconfig
# Full details (DNS, DHCP, MAC address)
ipconfig /all
Typical ip addr output
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.50/24 brd 192.168.1.255 scope global eth0
inet6 fe80::5054:ff:fe12:3456/64 scope link
| Field | Meaning |
|---|---|
| UP / DOWN | Interface is enabled / disabled |
| mtu | Maximum Transmission Unit — largest frame size in bytes |
| link/ether | MAC address of the interface |
| inet | IPv4 address with prefix length (CIDR) |
| inet6 | IPv6 address |
| scope global | Globally routable address |
| scope link | Link-local only — not routed beyond the local segment |
03 — Routing Table
Linux
ip route show
# or
ip r
macOS / legacy Linux
netstat -rn
Windows
route print
Typical output (Linux)
default via 192.168.1.1 dev eth0 proto dhcp
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.50
04 — Configure Interfaces
Bring interface up / down
# Linux (ip)
ip link set eth0 up
ip link set eth0 down
# Legacy (ifconfig)
ifconfig eth0 up
ifconfig eth0 down
Assign a static IP (Linux)
# Temporary — lost on reboot
ip addr add 192.168.1.100/24 dev eth0
ip route add default via 192.168.1.1
Remove an IP address
ip addr del 192.168.1.100/24 dev eth0
Flush / renew DHCP
# Windows
ipconfig /release
ipconfig /renew
# Linux (dhclient)
sudo dhclient -r eth0 # release
sudo dhclient eth0 # renew
Flush DNS cache (Windows)
ipconfig /flushdns
⚠ Changes made with ip addr add or ifconfig are temporary and lost on reboot. Use your distro's network configuration tool (nmcli, netplan, /etc/network/interfaces) for persistent changes.
05 — Useful ip Commands
| Command | What it does |
|---|---|
| ip a | Show all addresses on all interfaces |
| ip link show | Show interface state (UP/DOWN, MTU, MAC) |
| ip r | Show the routing table |
| ip neigh | Show ARP / neighbour table |
| ip -s link | Show interface statistics (TX/RX packets, errors) |
| ip link set eth0 mtu 9000 | Set jumbo frames MTU |
| ip route get 8.8.8.8 | Show which route and interface would be used to reach an IP |
06 — ipconfig Key Commands (Windows)
| Command | What it does |
|---|---|
| ipconfig | Show IP, subnet mask, and gateway for all adapters |
| ipconfig /all | Full details — MAC, DHCP server, DNS servers, lease times |
| ipconfig /release | Release DHCP lease on all adapters |
| ipconfig /renew | Request a new DHCP lease |
| ipconfig /flushdns | Clear the local DNS resolver cache |
| ipconfig /displaydns | Show the current DNS cache contents |
| ipconfig /registerdns | Re-register DNS names and refresh DHCP leases |
ℹ ipconfig /flushdns is one of the most commonly needed Windows commands — run it after changing DNS settings or editing the hosts file to ensure the change takes effect immediately.
