Windows: ipconfig and ipconfig /all
On Windows, `ipconfig` displays the IP address, subnet mask, and default gateway for each network adapter. Running `ipconfig /all` adds the MAC address (Physical Address), DNS servers, DHCP server address, DHCP lease obtained/expires dates, and whether the address was assigned by DHCP or configured statically.
Key fields and their meaning: the IP address shows the configured IPv4 address. Subnet Mask tells you the network size (a /24 appears as 255.255.255.0). Default Gateway is the router's IP — if this is wrong or missing, the host can reach devices on its own subnet but nothing else. DNS Servers determines name resolution; a wrong DNS server means names don't resolve but IP communication still works.
`ipconfig /release` releases a DHCP lease. `ipconfig /renew` requests a new one. `ipconfig /flushdns` clears the local DNS resolver cache — useful when a recently changed DNS record isn't being seen by the client. These commands are frequently referenced in CCNA troubleshooting scenarios.
An APIPA address (169.254.x.x, technically 169.254.0.0/16) indicates the host tried to get a DHCP address and failed — the client assigned itself a link-local address. If you see 169.254.x.x as the IP address, the DHCP server is unreachable.
macOS and older Linux: ifconfig
On macOS and older Linux distributions, `ifconfig` serves the same purpose as `ipconfig`. The output format is different: instead of adapter names like 'Ethernet adapter Local Area Connection', you see interface names like `en0` (first Ethernet/Wi-Fi), `lo0` (loopback), `en1`, etc.
Key fields in ifconfig output: `inet` is the IPv4 address. `netmask` is displayed in hexadecimal on older systems (0xffffff00 = 255.255.255.0 = /24) and in dotted decimal on newer ones. `inet6` lines show IPv6 addresses. `ether` shows the MAC address. There is no direct `ifconfig` field for default gateway — use `netstat -rn` or `route -n get default` on macOS to see the gateway.
To check the default gateway on macOS: `netstat -rn | grep default` shows the default route. On Linux: `ip route show` or `route -n`.
Modern Linux: the ip command
On modern Linux distributions, `ifconfig` is deprecated in favor of the `ip` command from the iproute2 package. The `ip` command has a more consistent syntax and provides more information.
`ip addr show` (or `ip a`) displays all interface addresses. The output shows: the interface name and state (UP/DOWN), the MAC address (link/ether line), and IPv4/IPv6 addresses with their prefix lengths. Unlike ifconfig which shows subnet masks in dotted decimal or hex, `ip addr` shows CIDR notation directly — 192.168.1.10/24.
`ip route show` (or `ip r`) displays the routing table. The default route appears as `default via 192.168.1.1 dev eth0` — the gateway IP and the interface it's reached through. This is how you find the default gateway on Linux when using `ip` instead of `ifconfig`.
`ip link show` shows interface status (up/down, MTU, MAC) without address information. Useful for checking whether a physical interface is detected and administratively up.
Interpreting output for troubleshooting
In CCNA troubleshooting scenarios, the goal is to identify misconfiguration quickly. A methodical approach: check if the IP address is in the correct subnet for this network, check if the subnet mask matches what other devices on the segment use, check if the default gateway is the router's IP on this subnet, and check if DNS servers are reachable.
Common misconfigurations: IP in the wrong subnet (host can't reach anyone), wrong subnet mask (host thinks devices in other subnets are local, sends traffic directly instead of to the router), wrong gateway (host can reach local devices but not remote subnets or the internet), wrong DNS (ping by IP works, ping by name fails).