NetworkingCCNA

CCNA IP Verification: ipconfig, ifconfig, and Linux ip Commands

Verifying IP address configuration on end hosts is a basic but exam-tested CCNA skill. The CCNA 200-301 exam presents scenarios where you must identify the correct command to check IP address, subnet mask, default gateway, and DNS settings on Windows, macOS, and Linux systems. This guide covers ipconfig (Windows), ifconfig (macOS/older Linux), and the modern ip command (Linux), plus what each output field means for network troubleshooting.

7 min
4 sections · 5 exam key points
5 practice questions

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).

IP verification commands by OS

OSShow IP/maskShow gatewayShow DNSRelease/renew DHCP
Windowsipconfigipconfigipconfig /allipconfig /release && /renew
macOSifconfig en0netstat -rn | grep defaultscutil --dnsipconfig set en0 DHCP
Linux (modern)ip addr showip route showcat /etc/resolv.confdhclient eth0
Linux (legacy)ifconfig eth0route -ncat /etc/resolv.confdhclient eth0

Key exam facts — CCNA

  • Windows: `ipconfig` shows IP/mask/gateway; `ipconfig /all` adds MAC, DHCP server, DNS
  • 169.254.x.x (APIPA) means DHCP failed — the host could not contact a DHCP server
  • `ipconfig /flushdns` clears the DNS cache; useful when DNS records change
  • macOS/Linux ifconfig: `inet` = IPv4 address; `ether` = MAC address; gateway requires `netstat -rn`
  • Linux `ip addr show` displays addresses in CIDR notation; `ip route show` shows the routing table including default gateway

Common exam traps

ipconfig /all is needed just to see the IP address

Plain `ipconfig` shows IP, subnet mask, and default gateway. `/all` is needed for MAC address, DHCP server, DNS servers, and lease information.

An APIPA address (169.254.x.x) means the IP was configured incorrectly

APIPA means the host is configured for DHCP but couldn't reach a DHCP server. The host self-assigned a link-local address. Fix: check DHCP server availability and the network path to it.

ifconfig and ip addr show the same information in the same format

Both show addresses, but ifconfig shows netmask in dotted decimal or hex while `ip addr` uses CIDR notation. `ip` is the modern replacement and provides more features; ifconfig is deprecated on Linux.

Practice questions — IP Verification Commands

These questions are representative of what you will see on CCNA exams. The correct answer and explanation are shown immediately below each question.

Q1.A Windows host shows an IP address of 169.254.50.20. What does this indicate?

A.The host has a statically configured IP in the 169.254.0.0/16 range
B.The host failed to obtain an address from a DHCP server and self-assigned an APIPA address
C.The host is using IPv6 link-local addressing
D.The host's DNS server is unreachable

Explanation: 169.254.0.0/16 is the Automatic Private IP Addressing (APIPA) range. When a DHCP-configured host cannot reach a DHCP server, it self-assigns an address in this range. The issue is DHCP server reachability, not a DNS problem.

Q2.Which Windows command displays the MAC address, DHCP server, and DNS server in addition to the IP address?

A.ipconfig
B.ipconfig /all
C.ipconfig /release
D.netstat -rn

Explanation: ipconfig /all adds the Physical Address (MAC), DHCP Enabled status, DHCP Server IP, DNS Servers, and lease dates to the standard ipconfig output. Plain ipconfig shows only IP, subnet mask, and default gateway.

Q3.On a Linux host, which command displays the IPv4 address and prefix length for all interfaces?

A.ip route show
B.ip addr show
C.ip link show
D.netstat -rn

Explanation: ip addr show (or ip a) displays addresses for all interfaces including IPv4 and IPv6 addresses in CIDR notation. ip route show displays the routing table. ip link show displays interface status without address information.

Q4.A user can ping other hosts on the same subnet by IP address but cannot reach any remote site. What is the most likely cause?

A.Incorrect IP address
B.Incorrect subnet mask
C.Incorrect or missing default gateway
D.Incorrect DNS server

Explanation: The ability to reach local subnet hosts but not remote destinations points to a missing or incorrect default gateway. The gateway is needed to route traffic off the local subnet. Wrong DNS would cause name resolution failures but not affect IP connectivity.

Q5.A Windows user reports that names are not resolving, but IP addresses work fine. Which ipconfig command would help first?

A.ipconfig /release
B.ipconfig /renew
C.ipconfig /flushdns
D.ipconfig /all

Explanation: When DNS name resolution fails but IP connectivity works, the first step is ipconfig /flushdns to clear any stale cached entries. Then ipconfig /all to verify the DNS server addresses are correct.

Frequently asked questions — IP Verification Commands

What is the difference between ipconfig and ipconfig /all?

ipconfig shows the IPv4 address, subnet mask, and default gateway for each adapter. ipconfig /all adds the MAC address (Physical Address), DHCP status, DHCP server IP, DNS server IPs, and DHCP lease obtained/expiry dates.

What does an APIPA address (169.254.x.x) mean on a Windows host?

APIPA (Automatic Private IP Addressing) means the host is configured to use DHCP but could not contact a DHCP server. Windows automatically assigned a link-local address in 169.254.0.0/16. The host can communicate with other APIPA hosts on the same segment but cannot reach the internet or DHCP-assigned networks.

How do you find the default gateway on a Linux system?

On modern Linux: run `ip route show` and look for the line beginning with 'default via' — the IP after 'via' is the gateway. On older systems or macOS: run `netstat -rn` and look for the '0.0.0.0' or 'default' destination row.

Is ifconfig still used on Linux?

ifconfig is deprecated on modern Linux distributions (RHEL/CentOS 7+, Ubuntu 16.04+) in favor of the ip command from iproute2. It may not be installed by default. The ip command provides equivalent functionality with a more consistent syntax and additional features.

Why does a host with a wrong subnet mask appear to work sometimes?

A host with an incorrect subnet mask may still reach devices that its mask considers 'local.' The problem appears when it tries to reach a device it classifies as remote (sending to the gateway) when it's actually local, or classifies as local (sending directly) when it's actually remote. This causes intermittent connectivity that's hard to diagnose without checking the mask.

Practice this topic

Test yourself on IP Verification Commands

JT Exams routes you to questions in your exact weak areas — automatically, after every session.

No credit card · Cancel anytime

Related certification topics