Network Fundamentals · Topic 10 of 17

Verifying IP Parameters on Client Operating Systems

Check a client IP address, mask, gateway and DNS on Windows, macOS and Linux with the right commands, and learn how to read the results to find faults.

  • 5 min
  • Exam objective 1.10
In a nutshell
  • The key client settings are address, mask, gateway and DNS.
  • Windows uses ipconfig and ipconfig /all.
  • ipconfig /release and /renew refresh a DHCP lease.

What it is

When a user says "I cannot get online", the first thing to check is what the client computer thinks its network settings are.

The key IP parameters on a client are:

  • the IP address and subnet mask
  • the default gateway
  • the DNS server addresses
  • how the address was obtained, by DHCP or by hand

Every major operating system has built-in tools for this. The commands differ between Windows, macOS and Linux, but the ideas are the same.

How it works

Each operating system has its own commands, and the results follow the same patterns.

Windows

Open a command prompt and use ipconfig.

ipconfig
ipconfig /all
ipconfig /release
ipconfig /renew
ipconfig /flushdns
  • ipconfig shows the address, mask and gateway for each adapter.
  • ipconfig /all adds the MAC address, whether DHCP is enabled, the DHCP server, the lease times and the DNS servers.
  • /release and /renew give up the DHCP lease and request a new one.
  • /flushdns clears the cached name lookups.

Other helpful tools are ping to test reachability, tracert to show the path, nslookup to test DNS, and arp -a to see the ARP cache.

macOS

macOS is built on Unix, so it has Unix-style tools. In the Terminal, ifconfig shows interface details, and networksetup gives a summary for a named service:

ifconfig
networksetup -getinfo Wi-Fi
scutil --dns
ping 8.8.8.8
traceroute 8.8.8.8

networksetup -getinfo Wi-Fi prints the address, mask, router and DHCP status for the Wi-Fi service. Older macOS releases called that service AirPort, and networksetup -listallnetworkservices shows the names on your Mac.

scutil --dns shows the DNS resolvers in use. The graphical Network settings also show this information.

Linux

Modern Linux uses the ip command:

ip address show
ip route show
resolvectl status
ping 8.8.8.8
traceroute 8.8.8.8
  • ip address show lists addresses on each interface.
  • ip route show shows the routing table, including the default gateway on the line that begins with default.
  • resolvectl status shows DNS servers on systems that use systemd-resolved. On other systems, the file /etc/resolv.conf lists them.

The older ifconfig command still exists on many systems but is considered deprecated.

Comparing the tools

TaskWindowsmacOSLinux
Show addressesipconfig /allifconfigip address show
Show gatewayipconfignetworksetup -getinfoip route show
Trace the pathtracerttraceroutetraceroute
Renew a leaseipconfig /renewNetwork settingsdhclient or network manager

Reading the results

A few patterns are worth recognising:

  • An address starting with 169.254 means the client asked for DHCP and heard nothing back.
  • No default gateway means the client can only reach its own subnet.
  • A gateway outside the client's subnet is a configuration error.
  • A wrong or missing DNS server means pinging an IP address works but names do not resolve.
  • The wrong mask makes the client think hosts are local when they are not, or the reverse.

A sensible order for troubleshooting is to test outward step by step.

Loopback127.0.0.1thenOwn addressthenDefault gatewayDefault gatewaythenRemote IP addressthenNameDNS test

The first step that fails shows where the problem lies. If the IP address works but the name does not, the fault is DNS, not routing.

Exam tip

Ping a remote IP address as well as a name. If the address answers and the name fails, go straight to DNS.

What to remember for the exam

Eight facts cover this objective.

  • The key client settings are address, mask, gateway and DNS.
  • Windows uses ipconfig and ipconfig /all.
  • ipconfig /release and /renew refresh a DHCP lease.
  • macOS uses ifconfig and networksetup. Linux uses ip address and ip route.
  • A 169.254 address means the client did not reach a DHCP server.
  • Ping the gateway to test the local link, then a remote IP, then a name.
  • If a remote IP responds but a name does not, check DNS.
  • nslookup tests DNS, and tracert or traceroute show the path.
Watch out

A 169.254 address is self assigned, not given by a server. It means DHCP failed, so check the DHCP path before touching the cable.

Common mistakes

These five habits slow down troubleshooting.

Testing only with a name. A failed name lookup could be DNS or routing. Ping an IP address as well to tell them apart.

Ignoring the gateway. A client with a valid address but no gateway, or the wrong one, cannot leave its subnet.

Using Linux commands on Windows. ip address does not exist on Windows, and ipconfig does not exist on Linux.

Forgetting the cache. After a DNS change, a client can keep using an old answer until the cache is flushed or expires.

Assuming a static address. The client may be using DHCP. ipconfig /all shows whether it is enabled.

Check yourself

Work through these three prompts.

  • Which command shows the DNS servers, the DHCP server and the lease times on Windows?

    ipconfig /all shows them, along with the MAC address and whether DHCP is enabled.

  • What does a 169.254 address on a client tell you, and where should you look next?

    It means the client asked for DHCP and heard nothing back. Check the DHCP path before touching the cable.

  • In what order should you test outward from the client, and what does the first failing step show?

    Test loopback 127.0.0.1, then the client's own address, the default gateway, a remote IP address and finally a name. The first step that fails shows where the problem lies, and if the IP address works but the name does not, the fault is DNS, not routing.

Topic 10 of 17 in Network Fundamentals

Test yourself on Network Fundamentals

The full Cisco CCNA 200-301 question bank has 1,206 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.