Module 1.7 40 minBeginner

The host's own view — checking IP settings on any OS

When a host can't reach the network, the first step is to read its IP, mask, gateway, and DNS — without logging into the switch. Each OS has a different command. This chapter is the reference.

Sign up to read this chapter

What you'll learn

  • Read IPv4/IPv6 address, mask, and gateway on Windows.
  • Read the same on macOS and Linux.
  • Spot APIPA (169.254.x.x) and what it tells you.

Windows — ipconfig

Read four lines, in this order: IPv4 Address, Subnet Mask, Default Gateway, DNS Servers. Together they answer the four questions every host must get right: who am I, which addresses are local, where do I send everything else, and who turns names into addresses.

The DHCP Server line tells you the address was leased, and from which server. The two IPv6 lines, a global address and a link-local one ending in %5, are explained later in this chapter.

C:\> ipconfig /all
Ethernet adapter Ethernet:
   IPv4 Address . . . . . . . . . . . : 10.0.0.42
   Subnet Mask  . . . . . . . . . . . : 255.255.255.0
   Default Gateway  . . . . . . . . . : 10.0.0.1
   DHCP Server  . . . . . . . . . . . : 10.0.0.1
   DNS Servers  . . . . . . . . . . . : 8.8.8.8, 1.1.1.1
   IPv6 Address . . . . . . . . . . . : 2001:db8::42
   Link-local IPv6 Address  . . . . . : fe80::1234%5

C:\> ipconfig /release
C:\> ipconfig /renew
C:\> ipconfig /flushdns
C:\> route print
C:\> netsh interface ipv4 show config

macOS — ifconfig + networksetup

macOS prints the mask in hexadecimal. In netmask 0xffffff00 each pair of hex digits is one octet: ff is 255 and 00 is 0, so the mask is 255.255.255.0, a /24. In the same way 0xfffffe00 is 255.255.254.0, a /23, because fe is 11111110 in binary: seven mask bits in the third octet.

On the inet6 line, prefixlen 64 is the IPv6 prefix length, /64, and autoconf means the Mac built that address itself from its router's advertisement rather than receiving it from a server.

$ ifconfig en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.0.0.42 netmask 0xffffff00 broadcast 10.0.0.255
        inet6 2001:db8::42 prefixlen 64 autoconf
        ether aa:bb:cc:dd:ee:ff
$ netstat -nr | head        # routing table
$ scutil --dns              # DNS servers
$ networksetup -getinfo Wi-Fi

9 more sections in this chapter, plus a 4-question quiz and a hands-on lab.

Account required

Create a free account to read Chapter 1.7 — The host's own view — checking IP settings on any OS

You can see the title, summary, and learning objectives. To read the chapter and build the labs, create a free account — Module 1 is fully readable on the free plan.

  • Read every chapter in Module 1 — How Networks Work
  • Save labs of up to 5 devices
  • Save up to 3 topologies
  • See the full course syllabus + chapter titles

Free account · no card required · compare plans any time

Build it step by step