liveBook · Manning

Netmask

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

A netmask is a bit mask that separates the network portion of an IP address from its host portion.

A netmask separates the network portion of an IP address from its host portion. Hosts use it to determine whether a destination belongs to the local LAN or requires communication through the default gateway. section 4.1

Recognize netmasks in common host configuration and routing output:

  • 255.255.255.0 is equivalent to /24 and identifies the 192.168.1.0 LAN for an address such as 192.168.1.226. section 4.3.2 section 4.3.3
  • A host receives its netmask alongside an IP address, default gateway, and DNS server; DHCP automates delivery of these settings. section 4.1
  • The netmask also appears in connected-LAN routes, such as 255.255.255.0 for 192.168.1.0. section 4.3.3

Reading a host configuration

In Linux output, `inet 192.168.1.226 netmask 255.255.255.0` identifies the host address and its /24 netmask. macOS may display the same mask as `0xffffff00`. section 4.3.2 section 4.3.3

jeremy@linuxpc ~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.226  netmask 255.255.255.0  broadcast 192.168.1.255    #1
        inet6 fe80::5054:ff:fe17:7862  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:17:78:62  txqueuelen 1000  (Ethernet)                  #2
. . .
jeremy@linuxpc ~ $ route
Kernel IP routing table
Destination   Gateway       Genmask        Flags  MSS  Window irtt Iface
0.0.0.0       192.168.1.1   0.0.0.0        UG     0    0      0    eth0       #3
192.168.1.0   0.0.0.0       255.255.255.0  U      0    0      0    eth0       #4
. . .
#1 linuxpc’s IP address is 192.168.1.226/24.
#2 linuxpc’s MAC address is 52:54:00:17:78:62.
#3 A default route
#4 A route to linuxpc’s connected LAN

Inspect annotated Linux interface and routing output showing the netmask, broadcast address, connected LAN, and default route. section 4.3.3

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Defines the netmask and interprets dotted-decimal, hexadecimal, and prefix-length forms, without deriving bitwise operations.
Examples
Uses macOS and Linux `ifconfig`, `ip addr`, and routing output to show 255.255.255.0, 0xffffff00, and /24.
What you can do after
Evaluate/understand host and routing output by identifying the netmask and its associated local LAN.
How it connects
Connects IP addresses with default gateways, DHCP, broadcast addresses, and routing tables.

Also explained in

Compare how 2 books explain netmask →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.