Internet protocol fundamentals
How addressing works: IPv4 and IPv6 addresses, what a subnet mask actually does, the private ranges, and the protocols and well-known ports a candidate is expected to recognise on sight.
Lesson 1 of 4 in objective 109. Networking fundamentals, part of LPIC-1 Exam 102-500.
Addresses and masks
An IPv4 address is 32 bits written as four decimal octets. A subnet mask splits it into a network part and a host part: the bits set in the mask are the network. /24 means 255.255.255.0 — 24 network bits, 8 host bits, so 256 addresses of which 254 are usable, because the all-zeros address is the network itself and the all-ones is the broadcast. /16 is 255.255.0.0 and /8 is 255.0.0.0. Being able to move between the two notations quickly is worth more marks than any single fact on this objective.
The private ranges, which are never routed on the public internet, are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. 127.0.0.0/8 is loopback, and 169.254.0.0/16 is the link-local range a host gives itself when DHCP fails — which is why an address starting 169.254 means "no DHCP server answered" rather than a working network.
IPv6 is 128 bits written as eight groups of four hexadecimal digits, with a doubled colon standing in for one run of zero groups. ::1 is loopback, fe80::/10 is link-local and every interface has one, and there is no broadcast at all — multicast does that job. IPv6 has no need for NAT, and public addresses on hosts are the normal case rather than the exception.
Protocols above the address
TCP is connection-oriented: a three-way handshake, ordered delivery, retransmission of what was lost, and flow control. UDP has none of that — it sends a datagram and does not care whether it arrives — which makes it the right choice for DNS queries, streaming and anything where a late packet is worse than a missing one. ICMP is neither; it carries control and error messages, which is what ping and traceroute are built on.
Ports identify the service on a host. The ones worth memorising: 20 and 21 FTP, 22 SSH, 23 telnet, 25 SMTP, 53 DNS, 67 and 68 DHCP, 80 HTTP, 110 POP3, 123 NTP, 139 and 445 SMB, 143 IMAP, 161 SNMP, 389 LDAP, 443 HTTPS, 465 and 587 mail submission, 514 syslog, 636 LDAPS, 993 IMAPS, 995 POP3S. /etc/services is the local list of them, and ports below 1024 are privileged — only root may bind them.
Reading what this machine has been given
The theory above is asked about a real machine, so the commands that print its addressing belong with it. ip addr show lists every interface with its addresses and prefix lengths, ip route prints the routing table with the default gateway on the line beginning default, and ip neigh shows the ARP or neighbour cache — which addresses have been resolved to which hardware addresses, and how fresh each entry is. The older ifconfig, route and arp from net-tools print the same three things and are still on plenty of machines.
On a desktop or laptop the addressing usually comes from NetworkManager rather than from a file, and nmcli is its command line. nmcli connection show lists the configured profiles — a profile is the saved settings, not the live state — and nmcli device status lists the interfaces and which profile each is currently running. The profiles themselves live under /etc/NetworkManager/system-connections/. It is worth being able to tell the two apart: a profile can exist for a network you are not on, and an interface can be up with no profile at all.
ip addr show eth02: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 state UP inet 192.168.1.10/24 brd 192.168.1.255 scope global eth0ip routedefault via 192.168.1.1 dev eth0 proto dhcp metric 100192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10nmcli connection showNAME UUID TYPE DEVICEWired 1 b2f1... ethernet eth0
Worth carrying in
- /24 = 255.255.255.0
- 24 network bits; 256 addresses, 254 usable.
- 10/8, 172.16/12, 192.168/16
- The private IPv4 ranges.
- 169.254.0.0/16
- Link-local: what a host assigns itself when DHCP fails.
- 127.0.0.1 / ::1
- Loopback in IPv4 and IPv6.
- fe80::/10
- IPv6 link-local. Every interface has one.
- TCP vs UDP
- Handshake, ordering and retransmission versus none of it.
- 22 / 25 / 53 / 80 / 443
- SSH, SMTP, DNS, HTTP, HTTPS.
- /etc/services
- Port-to-service-name mapping.
- ports < 1024
- Privileged: only root may bind them.
- ip addr show
- Interfaces and their addresses.
ip routefor the gateway,ip neighfor the ARP cache. - nmcli connection show
- NetworkManager profiles.
nmcli device statusis the live view instead.
What the exam does with this
- CIDR to dotted mask and back is asked repeatedly. /24, /16, /8 and the awkward ones like /26 and /30 are worth drilling.
- An address in 169.254 means DHCP failed. Recognising it is a whole question.
- IPv6 has no broadcast; multicast replaces it.
- Objective
- 109. Networking fundamentals
- Share of the exam
- 23.33% (the whole objective)
- Questions in this lesson
- 20
- Signed for by a person
- 0
Partly checked. None of the 20 questions here has been read against the cited source by a person. 20 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.
Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
Drill this lesson
A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.
Practise Internet protocol fundamentals
Questions in this lesson
- A subnet is defined as 192.168.10.0/26. How many addresses in it can actually be assigned to hosts? machine-checked
- A host is configured with the address 172.20.35.77/20. What is the network address of its subnet? machine-checked
- In IPv6, which address is the loopback address, equivalent in role to 127.0.0.1 in IPv4? machine-checked
- Which is the correct fully compressed form of the IPv6 address 2001:0db8:0000:0000:0000:ff00:0042:8329? machine-checked
- Which pairing of a service with its default port number is correct? machine-checked
- DNS normally uses UDP port 53. In which situation does a DNS client or server fall back to TCP on port 53? machine-checked
- Which file on a Linux system maps service names such as ssh, smtp and http to their port numbers and transport protocols? machine-checked
- An administrator runs `ss -tulpn`. What does the `p` in that flag cluster add to the output? machine-checked
- The legacy command `ifconfig eth0 192.168.1.10 netmask 255.255.255.0` assigns an address to an interface. Which iproute2 command does the same job? machine-checked
- A host has an address on 192.168.1.0/24 but no default route. The router is 192.168.1.1. Which command installs the default gateway for the running system? machine-checked
- On a system whose networking is managed by NetworkManager, which command lists the configured connection profiles? machine-checked
- Which of these is the iproute2 replacement for `arp -n`, showing the mapping of neighbouring IP addresses to their MAC addresses? machine-checked
- Which two of the following IPv4 addresses come from the RFC 1918 private ranges? (Choose two.) machine-checked
- Which two statements about UDP are correct? (Choose two.) machine-checked
- Type the iproute2 command, with no interface argument, that displays the IP addresses currently assigned to all network interfaces. machine-checked
- Type the iproute2 command that prints the kernel routing table, the modern replacement for `route -n`. machine-checked
- Write the subnet mask for the prefix /26 in dotted-quad notation. machine-checked
- A host is configured as 192.168.7.100/28. Write the broadcast address of its subnet in dotted-quad notation. machine-checked
- After a firewall rule was added that drops every ICMP packet arriving at a gateway, small requests over a VPN tunnel still work but large HTTP downloads through the tunnel hang after a few kilobytes. Which ICMP message is the firewall swallowing? machine-checked
- Which two statements correctly describe how IPv6 differs from IPv4? (Choose two.) machine-checked
Practise Internet protocol fundamentals
The rest of objective 109
- Internet protocol fundamentals — you are here
- Persistent network configuration
- Troubleshooting a network connection
- Client side DNS