4.4 Your Computer on the Network (Weight: 2)
📘Linux Essentials (LPI 010-160)
1. What is IP Configuration?
IP configuration refers to the network settings assigned to a computer so it can communicate with other systems on a network.
Important IP configuration information includes:
| Setting | Description |
|---|---|
| IP Address | The unique address assigned to the computer |
| Subnet Mask / Prefix | Defines the network portion of the IP address |
| Default Gateway | The router used to reach other networks |
| Network Interface | The hardware or virtual network adapter |
| DNS Servers | Servers used to resolve domain names |
A Linux system may have multiple network interfaces, each with its own configuration.
Example interfaces:
eth0– traditional wired interface nameenp0s3– modern predictable interface namewlan0– wireless interfacelo– loopback interface
2. Network Interfaces in Linux
A network interface is the connection point between the computer and the network.
Linux systems commonly use these interface types:
| Interface | Purpose |
|---|---|
lo | Loopback interface for internal communication |
ethX | Ethernet wired interface |
wlanX | Wireless interface |
enpXsY | Predictable network interface names |
Loopback Interface
The loopback interface (lo) is used for internal communication within the system.
Important loopback address:
127.0.0.1
This allows software running on the system to communicate with itself.
Example IT usage:
- Database server communicating with a web server running on the same machine
- Local testing of network services
3. Viewing IP Configuration
Linux provides several commands to display the current IP configuration.
The most common commands are:
ipifconfig(older command)
For the exam, the ip command is the modern and recommended tool.
4. The ip Command
The ip command is part of the iproute2 package and is used to view and manage networking settings.
It can display:
- IP addresses
- network interfaces
- routing tables
- statistics
Basic syntax:
ip [OPTIONS] OBJECT COMMAND
Example objects:
addr– addresseslink– interfacesroute– routing table
5. Viewing IP Addresses
To display the IP configuration of all interfaces:
ip addr
or
ip a
Example output:
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP>
inet 192.168.1.25/24
inet6 fe80::a00:27ff:fe4e:66a1/643: lo: <LOOPBACK,UP,LOWER_UP>
inet 127.0.0.1/8
Important information in the output
| Field | Meaning |
|---|---|
| Interface name | Example: enp0s3 |
| inet | IPv4 address |
| inet6 | IPv6 address |
/24 | Network prefix length |
| state UP | Interface is active |
Example:
inet 192.168.1.25/24
Means:
- IP address:
192.168.1.25 - Network prefix:
/24
6. Viewing Interface Status
To display detailed interface information:
ip link show
Example output:
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP>
Important interface states:
| State | Meaning |
|---|---|
| UP | Interface is active |
| DOWN | Interface is disabled |
7. The ifconfig Command (Legacy)
Older Linux systems use the ifconfig command.
Example:
ifconfig
Example output:
eth0 Link encap:Ethernet
inet addr:192.168.1.25
Mask:255.255.255.0
Information displayed:
- IP address
- subnet mask
- broadcast address
- network interface status
However, modern Linux systems prefer the ip command.
8. Understanding Network Routes
When a system sends data to another system, it must know where to send the packets.
This information is stored in the routing table.
A route tells the system:
- which network can be reached
- which gateway should be used
- which interface should send the traffic
Without routing information, a system cannot communicate with networks outside its local network.
9. Viewing the Routing Table
The routing table can be displayed with:
ip route
Example output:
default via 192.168.1.1 dev enp0s3
192.168.1.0/24 dev enp0s3 proto kernel scope link src 192.168.1.25
Explanation:
| Field | Meaning |
|---|---|
| default | Default route |
| via | Gateway address |
| dev | Network interface |
| src | Source IP address |
10. Default Gateway
The default gateway is the router used when the destination network is not local.
Example entry:
default via 192.168.1.1 dev enp0s3
Meaning:
- The system sends external traffic to the router
- Router IP address:
192.168.1.1 - Interface used:
enp0s3
Example IT environment usage:
A workstation inside an office network sends traffic to the default gateway, which then forwards the traffic to:
- the internet
- another internal network
- cloud services
11. Viewing Routes with Older Tools
Older Linux systems may use:
route
or
netstat -r
Example:
route -n
Example output:
Destination Gateway Genmask Iface
0.0.0.0 192.168.1.1 0.0.0.0 eth0
Meaning:
0.0.0.0represents the default route
12. Example of Network Configuration in an IT Environment
A Linux server inside an internal network may have the following configuration:
| Setting | Value |
|---|---|
| Interface | enp0s3 |
| IP Address | 192.168.10.15 |
| Subnet | 192.168.10.0/24 |
| Gateway | 192.168.10.1 |
The routing table may contain:
192.168.10.0/24 dev enp0s3
default via 192.168.10.1 dev enp0s3
This means:
- Traffic inside the local network stays within the interface.
- Traffic to other networks is sent to the gateway.
13. Troubleshooting Network Configuration
Viewing IP configuration is useful when diagnosing network problems.
Common checks include:
Verify the interface is active
ip link
Check the assigned IP address
ip addr
Check the routing table
ip route
Typical problems discovered during troubleshooting:
- Interface is DOWN
- Missing IP address
- Incorrect subnet
- Missing default gateway
14. Key Commands for the Exam
You should remember the following commands for the Linux Essentials exam:
| Command | Purpose |
|---|---|
ip addr | Show IP addresses |
ip a | Short version of above |
ip link | Show network interfaces |
ip route | Show routing table |
ifconfig | Legacy IP configuration tool |
route | Legacy routing command |
netstat -r | Show routing table |
15. Key Concepts to Remember for the Exam
- Every network interface can have its own IP address.
- The loopback interface (
lo) is used for local communication. - The
ipcommand is the modern tool for viewing networking configuration. ip addrdisplays interface IP addresses.ip routedisplays the routing table.- The default gateway sends traffic to other networks.
- Older commands such as
ifconfigandroutemay still appear on some systems.
✅ Exam Tip (Important for LPI 010-160):
The exam commonly tests whether you know:
- how to view an IP address
- how to view network interfaces
- how to view routing tables
- the difference between
ip,ifconfig, androute
Focus especially on:
ip addr
ip link
ip route
