Courseiva
LPIC-1Chapter 12 of 17Objective 102.2

Network Configuration and Troubleshooting

How do you make two computers talk to each other when they are in different buildings, or even on opposite sides of the world? That is the central problem that network configuration solves, and it matters for your LPIC-1 exam because objective 102.2 tests whether you can set up and fix the invisible paths that every program, website, and email depends on. Without this skill, your server might be fully running but completely unreachable.

12 min read
Intermediate
Updated Jul 23, 2026
Editorial oversight: Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security · IEEE Senior Member

A simple way to picture Network Configuration and Troubleshooting

The House Renovation Party Analogy

When you renovate a house, the first thing you do is shut off the main water line. That leads to walking through every room, testing each tap and flush to see which pipes still work and which are dead ends. In network configuration, you start by bringing the interface down (shutting off the water), then you run 'ip link set eth0 down' and test connectivity with 'ping' to map out every path data will take.

Once the water is off, you label every pipe junction with a marker — "kitchen sink: hot, 15mm" — so that when you turn the main back on, you know exactly which pipe serves which tap. That is exactly what you do when you assign an IP address and netmask: you give each network interface a unique label so that data knows exactly which cable to take to reach its destination. If you label a pipe wrong, the bathroom shower spits cold water when you want hot. If you set the wrong subnet mask, your computer’s packets knock on the wrong doors and never get a reply.

Finally, you test the whole system: you turn the water on at the mains and run every tap simultaneously. If a pipe leaks or a tap dribbles, you trace the path back — exactly the same as using 'traceroute' to find where a packet stops responding. The mapping of pipes to rooms is your routing table. The main water valve is your default gateway. The house number on the street is your IP address. Everything works only when the labels match reality.

How It Actually Works

Networking is the art of getting data from one computer to another. To do that, every computer needs a unique address, a way to know where other addresses are, and a rulebook for how to send data. This section will teach you the exact commands and concepts that the LPIC-1 exam tests.

First, you need to understand the fundamental pieces. An 'interface' is the physical or virtual port that connects a computer to a network. On a laptop, that is usually the Ethernet port (called 'eth0' or 'enp0s3') or the Wi-Fi card ('wlan0'). On a server, it could be 'ens33' or 'eth1'. Each interface can be assigned one or more IP addresses. An 'IP address' is like a street address for your computer on the internet. It is written as four numbers separated by dots, for example 192.168.1.10. Every device on the same network must have a unique IP address to avoid confusion.

Along with the IP address, you need a 'netmask' (subnet mask). The netmask tells the computer which part of the IP address is the neighbourhood (network) and which part is the specific house (host). For instance, with IP 192.168.1.10 and netmask 255.255.255.0, the network part is 192.168.1 and the host part is .10. This matters because if your computer wants to talk to 192.168.1.20, it knows they are in the same neighbourhood and it can send data directly. If it wants to talk to 8.8.8.8 (a Google DNS server), it knows that address is in a different neighbourhood, so it must send the data to a 'default gateway' — a router that forwards the data to the wider internet.

The 'routing table' is the computer's internal map. It lists every network the computer knows about, and which interface and gateway to use for each. You can view this table with the 'ip route' command. The routing table has three key types of entries:

A 'directly connected route' — the network the computer is physically plugged into. For example, if your computer is on 192.168.1.0/24, the routing table says "for 192.168.1.0/24, use eth0 directly".

A 'default route' — a catch-all entry that says "for any address not in the other routes, send the data to this gateway IP". This is usually your home router or your company's router.

A 'static route' — a manually entered route for a specific remote network. For example, if your company has a branch office at 10.0.50.0/24, you might add a static route that tells your computer to use a specific gateway to reach that branch.

To configure all this on Linux, you have two traditional tools: 'ifconfig' (older, from the net-tools package) and 'ip' (newer, from the iproute2 package). The LPIC-1 exam expects you to know both, but the modern tool is 'ip'. Here is how you use them: to bring an interface up, you type 'ip link set eth0 up'. To bring it down, 'ip link set eth0 down'. To assign an IP address: 'ip addr add 192.168.1.10/24 dev eth0'. To add a default gateway: 'ip route add default via 192.168.1.1'. To see your current IP configuration: 'ip addr show'. To see your routing table: 'ip route show'. The old 'ifconfig' equivalents are 'ifconfig eth0 up', 'ifconfig eth0 192.168.1.10 netmask 255.255.255.0', and 'route add default gw 192.168.1.1'.

Now, how do you test if this configuration works? The most basic tool is 'ping'. Ping sends a small packet to another IP address and waits for a reply. If you get replies, the network path is working. The command is 'ping 8.8.8.8'. You can also ping by hostname: 'ping google.com', but that requires DNS (Domain Name System) to work first. If ping fails, the next tool is 'traceroute' (or 'tracepath' on some systems). Traceroute shows every router the packet passes through on its way to the destination. This helps you find exactly where the path breaks.

Another critical tool is 'ss' (socket statistics) or the older 'netstat'. These show you which ports are listening on your computer. A 'port' is like a door number on your computer's IP address. For example, a web server listens on port 80 (HTTP) and port 443 (HTTPS). If you run 'ss -tuln', you see a list of all listening ports. This is crucial for troubleshooting because you might have configured the IP address correctly, but the service (like a web server) might not be listening on the expected port.

Finally, you need to understand the 'hosts' file. The file '/etc/hosts' maps hostnames to IP addresses locally, before any DNS lookup. For example, you can add '192.168.1.10 myserver.local' to that file, and then 'ping myserver.local' will work even if DNS is broken. The order of resolution is defined in '/etc/nsswitch.conf' and usually looks at the hosts file first, then DNS.

This entire system — interfaces, IP addresses, routes, gateways, and testing tools — is what the LPIC-1 exam calls "Network Configuration and Troubleshooting". The exam expects you to be able to set a static IP, add a default gateway, check if an interface is up, and diagnose why a computer cannot reach the internet. You will not need to configure complex routing protocols like OSPF or BGP; that is for higher-level certifications. You just need to know how to set up a simple network, verify it, and fix common problems.

Flowchart showing how a Linux computer connects to the internet through a network interface, router, and routing table, with testing tools to verify connectivity.

Walk-Through

1

Identify the interface

Run 'ip link show' to list all network interfaces on your system. Identify the one you want to configure (e.g., eth0, enp0s3, wlan0). Note its current state (UP or DOWN). If it shows 'state DOWN', you will need to bring it up later.

2

Bring the interface up

Use 'ip link set <interface> up' to activate the interface. For example, 'ip link set eth0 up'. This makes the interface ready to send and receive data. Without this step, the interface will not respond to any network traffic.

3

Assign an IP address and netmask

Run 'ip addr add <IP>/<prefix> dev <interface>'. For instance, 'ip addr add 192.168.1.100/24 dev eth0'. The '/24' is shorthand for netmask 255.255.255.0. This gives the interface its unique local address.

4

Set the default gateway

Run 'ip route add default via <gateway_IP>'. For example, 'ip route add default via 192.168.1.1'. This tells your computer to send all traffic for unknown networks to the router. Without this, you cannot access the internet.

5

Test connectivity

First, ping the gateway to confirm local connectivity: 'ping -c 4 192.168.1.1'. Then ping a public IP like 'ping -c 4 8.8.8.8' to test internet access. Finally, ping a hostname like 'ping -c 4 google.com' to test DNS resolution. Each step isolates a different potential problem.

6

Make the configuration permanent

Edit the appropriate configuration file for your distribution (e.g., /etc/netplan/01-netcfg.yaml for Ubuntu, /etc/sysconfig/network-scripts/ifcfg-eth0 for RHEL/CentOS). Add the static IP, netmask, gateway, and DNS servers. Apply the changes with the distribution-specific command (e.g., 'sudo netplan apply' or 'sudo systemctl restart network').

What This Looks Like on the Job

Imagine you are the sole IT support person for a small design agency. They just moved to a new office. You have been given a server running Ubuntu Server, and your boss asks you to make sure the server is reachable on the local network and can access the internet for updates. Here is exactly what you do, step by step.

First, you walk to the server room. You plug an Ethernet cable from the server into the office switch. The switch is a box that connects all the office computers together, and it is itself connected to the company's router, which connects to the internet. You need to configure the server's network interface. You open a terminal (a text-based command prompt) and type 'ip link show'. This lists all interfaces. You see 'enp0s3' and 'lo'. The 'lo' interface is the loopback — it is a virtual interface the computer uses to talk to itself. The 'enp0s3' is your physical Ethernet port. It says 'state DOWN'. You type 'ip link set enp0s3 up' to bring it up.

Next, you need to assign an IP address. Your office network uses the range 192.168.1.0/24, and the router's IP is 192.168.1.1. You assign the server a static IP so it never changes: 'ip addr add 192.168.1.100/24 dev enp0s3'. Then you add the default gateway: 'ip route add default via 192.168.1.1'. Now you test: 'ping 192.168.1.1'. You should see replies. If you do not, you check the cable, check that the switch port is active, or check that the IP address is not already taken by another device.

Now you test internet access: 'ping 8.8.8.8'. If that works, you know your routing is correct. Next, you test that the server can be reached from other computers. You go to a colleague's laptop and open a command prompt (or terminal) and type 'ping 192.168.1.100'. If you get replies, the server is reachable. If not, you check that the server's firewall (like iptables or ufw) is not blocking incoming ping requests.

Finally, you need to ensure the settings survive a reboot. Static IP addresses set with 'ip addr add' disappear when you restart the computer. So you edit the configuration file: for Ubuntu with netplan, you edit '/etc/netplan/01-netcfg.yaml'. You add:

network:

version: 2

ethernets:

enp0s3:

dhcp4: no

addresses: [192.168.1.100/24]

gateway4: 192.168.1.1

nameservers:

addresses: [8.8.8.8, 8.8.4.4]

You run 'sudo netplan apply' to apply it. Now the settings are permanent. If you accidentally misconfigure something, you can boot into recovery mode or use a live USB to fix the file. This is the reality of daily IT work: you configure, test, document, and persist the configuration.

How LPIC-1 Actually Tests This

The LPIC-1 exam objective 102.2 is very specific in what it tests. You will get multiple-choice questions that ask you to identify the correct command, the correct option, or the correct output. Here is exactly what you need to know.

First, the exam loves to test the difference between old and new tools. You must memorise the following mappings:

'ifconfig' (old) vs 'ip addr' (new) — both show IP addresses.

'route' (old) vs 'ip route' (new) — both show or manipulate the routing table.

'arp' (old) vs 'ip neigh' (new) — both show the ARP table (mapping IP addresses to MAC addresses).

'netstat -r' (old) vs 'ip route' (new) — routing table.

'netstat -i' (old) vs 'ip -s link' (new) — interface statistics.

Second, the exam tests the exact syntax of these commands. For example, a typical question: "Which command sets the IP address 192.168.1.10 with a 24-bit netmask on interface eth0?" The correct modern answer is 'ip addr add 192.168.1.10/24 dev eth0'. The exam will include distractors like 'ip add 192.168.1.10 netmask 255.255.255.0 eth0' or 'ifconfig eth0 192.168.1.10 netmask 255.255.255.0' (the old syntax is correct, but the exam may test both).

Third, the exam tests your understanding of the routing table. You must know how to read the output of 'ip route show'. For instance, if you see 'default via 192.168.1.1 dev eth0', that means the default gateway is 192.168.1.1. A question might present an output and ask "What is the default gateway?" or "Which network is directly connected?".

Fourth, traps often revolve around the difference between 'ping' and 'traceroute', and what they tell you. A question might say: "A user can ping the local router but cannot ping a remote server. Which tool would you use to find where the packets are being dropped?" The answer is 'traceroute' (or 'tracepath'). Another trap: they might show a 'ping' output that says 'Destination Host Unreachable' vs 'Request Timed Out' — the first usually means a routing problem, the second means a firewall or packet loss further along.

Fifth, the exam tests the '/etc/hosts' file and the order of hostname resolution. You must know that the hosts file is checked before DNS by default, and that the format is 'IP_address hostname alias'. A question might give you a hosts file entry and ask which command would resolve that hostname.

Sixth, you need to know the purpose of the 'ss' command. For example: "Which command shows all TCP ports currently listening on the system?" The answer is 'ss -tln' or 'ss -tuln'. They might also test 'netstat -tuln' as the older equivalent.

Finally, the exam expects you to know how to bring an interface down and up, and what 'ping -c 4' does (sends exactly 4 packets and then stops). Memorise these key points and you will be ready for objective 102.2.

Key Takeaways

Every network interface needs a unique IP address and a correct netmask to function on a local network.

A default gateway is the router that allows your computer to reach networks outside its own subnet.

Use 'ip addr show' to view current IP addresses and 'ip route show' to view the routing table.

The command 'ping' tests basic connectivity, but 'traceroute' shows the exact path packets take and where they stop.

Changes made with 'ip' or 'ifconfig' are temporary and disappear after a reboot unless saved in a configuration file.

The '/etc/hosts' file can override DNS lookups by mapping hostnames directly to IP addresses.

The 'ss -tuln' command lists all listening ports and is essential for verifying that a service is ready to accept connections.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

ifconfig

Part of the net-tools package, now deprecated

Uses 'ifconfig eth0 192.168.1.10 netmask 255.255.255.0' syntax

Does not support many modern features like multiple IP addresses per interface easily

ip addr

Part of the iproute2 package, the modern standard

Uses 'ip addr add 192.168.1.10/24 dev eth0' syntax

Supports multiple IP addresses, namespaces, and advanced features natively

route

Older command from net-tools

Uses 'route add default gw 192.168.1.1' syntax

Output is in a simpler, table-like format

ip route

Modern command from iproute2

Uses 'ip route add default via 192.168.1.1' syntax

Output shows more detail, including protocol and scope

ping

Tests if a remote host is reachable

Sends ICMP echo requests and waits for replies

Only tells you if the destination is reachable, not where the path breaks

traceroute

Identifies the path packets take to a destination

Sends packets with increasing TTL to force routers to reply

Shows each hop, helping to locate where packets are dropped or delayed

Watch Out for These

Mistake

"ifconfig and ip do the same thing but ip is newer, so I only need to know ifconfig for the exam."

Correct

The LPIC-1 exam tests both tools. You must know both the old syntax (ifconfig, route, arp) and the new syntax (ip addr, ip route, ip neigh).

Many beginners assume that because the exam is modern, only modern tools matter. But the older tools are still widely used in legacy systems and are explicitly listed in the exam objectives.

Mistake

"As long as I set the IP address correctly, the server will automatically have internet access."

Correct

You also need to set a default gateway and ensure DNS is configured. Without a default gateway, your computer can only talk to devices on its own local network.

This confusion stems from home networks where DHCP (Dynamic Host Configuration Protocol) automatically provides IP, gateway, and DNS. Beginners think setting a static IP alone is enough.

Mistake

"If ping fails, the computer is completely offline."

Correct

Ping can fail for many reasons: the remote host might have a firewall blocking ICMP (ping packets), the DNS resolution might fail, or the network path might be broken partway. Ping failure does not necessarily mean your own network configuration is wrong.

People trust ping as a binary 'online/offline' test, but it is a specific protocol that can be disabled. IT professionals know to use multiple tools to diagnose.

Mistake

"I can change the IP address of an interface while it is up, and it will work immediately with no issues."

Correct

You can change the IP address without bringing the interface down, but existing connections (like SSH sessions) using the old IP will break. Always plan for service interruption when changing IP addresses.

Commands like 'ip addr add' and 'ip addr del' work on a live interface, so beginners think it is harmless. They do not realise that active network sessions rely on the original IP.

Mistake

"The networking configuration files in /etc/network/interfaces and /etc/sysconfig/network-scripts are automatically read on modern Linux distributions."

Correct

Different distributions use different tools: Debian/Ubuntu use /etc/network/interfaces (older) or netplan (newer), Red Hat/CentOS use /etc/sysconfig/network-scripts/ (older) or NetworkManager (newer). You must know which configuration system your distribution uses.

Linux is fragmented across distributions, and beginners often learn one distribution's way and assume it is universal. The exam tests awareness of both major families.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between 'ping' and 'traceroute'?

Ping tests if a remote host is reachable and measures response time. Traceroute shows every router (hop) between your computer and the destination, so you can see exactly where packets are being delayed or dropped.

Why does my ping work with an IP address but not with a hostname?

That means your network connectivity is fine, but DNS resolution is failing. Check your DNS server settings in /etc/resolv.conf or your network configuration file, and ensure you have a valid DNS server (e.g., 8.8.8.8).

How do I make my static IP settings survive a reboot?

You must edit the persistent configuration file for your distribution. On Ubuntu, edit /etc/netplan/*.yaml and run 'sudo netplan apply'. On CentOS, edit /etc/sysconfig/network-scripts/ifcfg-eth0 and restart the network service. Temporary ip commands are lost after reboot.

What does 'Destination Host Unreachable' mean in ping output?

It usually means there is no route to the destination in your routing table. Check your default gateway with 'ip route show'. If the gateway is missing, add it. It can also mean the destination subnet is simply not reachable from your network.

How do I find out what IP address my computer is using?

Use 'ip addr show' to see all interfaces and their assigned IP addresses. Look for the line 'inet' under your active interface (e.g., eth0). The number after 'inet' is your IP address.

What is the loopback interface (lo) used for?

The loopback interface is a virtual network interface that a computer uses to communicate with itself. It always has the IP address 127.0.0.1. It is used for testing and for services that need to connect to the same machine.

Terms Worth Knowing

Keep going

You've finished Network Configuration and Troubleshooting. Continue through the LPIC-1 study guide to build a complete picture of the exam.

Done with this chapter?