Introduction
Basic network configuration connects an interface, addresses, and routes. Always distinguish temporary runtime commands from distribution-specific persistent configuration.
What you should be able to do after this lesson:
- Inspect and change interface state and addresses.
- Configure IPv4 and IPv6 prefixes.
- Read and modify routes.
- Inspect neighbor resolution.
- Discover and connect to wireless networks at a basic level.
Big Idea: A Working Path Needs Four Local Decisions
Before DNS or an application can work, the host needs:
link state -> local address and prefix -> neighbor reachability -> route
Each layer can be correct while the next is wrong. For example, carrier can be up with no address, and an address can be correct with no default route. Test them in that order.
Inspect the Current Configuration
ip link show
ip address show
ip route show
ip -6 route show
ip neigh show
The ip suite is the modern interface. LPIC-2 also expects recognition of legacy commands such as ifconfig, route, and arp.
Interface State and Addresses
sudo ip link set dev eth0 up
sudo ip addr add 192.0.2.10/24 dev eth0
sudo ip -6 addr add 2001:db8:1::10/64 dev eth0
These changes normally disappear after reboot. Remove an address with ip addr del.
IPv4 prefix /24 corresponds to mask 255.255.255.0. IPv6 uses prefix lengths and includes link-local addresses, usually from fe80::/10, for communication on the local link.
Routes
sudo ip route add default via 192.0.2.1 dev eth0
sudo ip route add 198.51.100.0/24 via 192.0.2.254
sudo ip -6 route add default via 2001:db8:1::1
A more specific route wins before route metric is considered. The gateway must be reachable through an appropriate connected route.
Ask the kernel how it would reach a destination:
ip route get 198.51.100.25
Neighbor Resolution
ARP maps IPv4 addresses to link-layer addresses. IPv6 uses Neighbor Discovery.
ip neigh show
ip neigh flush dev eth0
Incomplete or failed neighbor entries can indicate wrong VLANs, disconnected peers, or layer-2 filtering.
Wireless Basics
iw dev
iw dev wlan0 link
sudo iw dev wlan0 scan
iw is the modern wireless utility; iwconfig and iwlist are legacy tools. Authentication and key management are commonly handled by wpa_supplicant or NetworkManager rather than by iw alone.
Verify Each Layer
ip -s link show dev eth0
ping -c 3 192.0.2.1
ping -c 3 198.51.100.1
getent hosts example.com
Test local link, gateway, routed destination, and DNS separately. A successful DNS lookup does not prove application ports are open.
Guided Practice: Build an Isolated IPv4 Link
Network namespaces let you practice without changing the host's primary connection:
sudo ip netns add lpic-a
sudo ip netns add lpic-b
sudo ip link add veth-a type veth peer name veth-b
sudo ip link set veth-a netns lpic-a
sudo ip link set veth-b netns lpic-b
sudo ip -n lpic-a addr add 192.0.2.1/24 dev veth-a
sudo ip -n lpic-b addr add 192.0.2.2/24 dev veth-b
sudo ip -n lpic-a link set lo up
sudo ip -n lpic-b link set lo up
sudo ip -n lpic-a link set veth-a up
sudo ip -n lpic-b link set veth-b up
sudo ip netns exec lpic-a ping -c 3 192.0.2.2
Inspect addresses, connected routes, and neighbor entries inside both namespaces. Remove one prefix or set one link down and identify which verification step fails. Clean up with ip netns del lpic-a and ip netns del lpic-b after the lab.
Repeat the design on paper with IPv6 addresses from 2001:db8::/32, which is reserved for documentation. Notice that IPv6 neighbor discovery replaces ARP.
Troubleshooting Scenario
Two hosts on the same Ethernet segment use 192.0.2.10/24 and 192.0.3.20/24. Both links are up, but neighbor resolution fails when they try to communicate directly.
Their prefixes say they belong to different networks, so each expects a router. Correct the addressing plan or provide a valid route through a gateway. Adding a DNS record would not repair local prefix logic.
Exam Focus
- Know modern
ipcommands and legacyifconfig,route, andarpequivalents. - Understand IPv4 masks, IPv6 prefixes, link-local addresses, and route specificity.
- Use
iw,iwconfig, andiwlistat the expected depth. - Runtime commands do not make configuration persistent across reboot.
Recap
- Interface, address, route, neighbor, and DNS are separate layers.
ipreplaces several legacy net-tools commands.- Runtime changes are not persistent by themselves.
- Verify connectivity in increasing scope to localize failure quickly.
Test Your Knowledge
Complete the quiz to assess your understanding of this course's concepts.
