205.1 Basic networking configuration (weight: 3)

Tech Tutorial: 205.1 Basic Networking Configuration #

Introduction #

In the realm of Linux system administration, understanding how to configure networking is essential. Networking allows your system to communicate with other computers and services on the internet or local networks. This tutorial aims to equip you with the knowledge to handle basic networking configurations on a Linux system.

Exam Objective #

The objective 205.1 focuses on basic networking configuration, which is a crucial skill for any Linux system administrator. This includes configuring and troubleshooting network interfaces, as well as setting up routing and DNS clients.

Key Knowledge Areas #

  • Configuring network interfaces
  • Basic TCP/IP networking, including knowledge of IP addresses, netmasks, and subnets
  • Route tables
  • Resolve files
  • Utilities to configure and troubleshoot network interfaces

Utilities #

  • ip
  • ifconfig
  • route
  • ss
  • ping
  • netstat
  • cat
  • echo
  • grep

Step-by-Step Guide #

1. Configuring Network Interfaces #

Using ip #

The ip command is a versatile tool for network configuration. It can be used to show and manipulate routing, devices, policy routing, and tunnels.

List all interfaces:

ip link show

Set an IP address:

sudo ip addr add 192.168.1.100/24 dev eth0

Bring an interface up:

sudo ip link set eth0 up

Bring an interface down:

sudo ip link set eth0 down

Using ifconfig (deprecated) #

Although deprecated, ifconfig is still widely used in many systems for network interface configuration.

List all interfaces:

ifconfig -a

Configure an IP address and netmask:

sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up

2. Viewing and Modifying Route Tables #

Using route #

List route entries:

route -n

Add a default gateway:

sudo route add default gw 192.168.1.1 eth0

Delete a route:

sudo route del -net 192.168.1.0 netmask 255.255.255.0 eth0

3. Testing Connectivity #

Using ping #

Ping is used to test the reachability of a host on an IP network.

ping -c 4 google.com

Using ss and netstat #

List all TCP sockets with ss:

ss -t -a

List all UDP sockets with ss:

ss -u -a

Display routing table with netstat:

netstat -r

Display all network interfaces with netstat:

netstat -i

4. DNS Client Configuration #

/etc/resolv.conf #

DNS client settings are configured in /etc/resolv.conf.

View DNS settings:

cat /etc/resolv.conf

Set a DNS server:

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf

Conclusion #

In this tutorial, we’ve covered how to configure and troubleshoot basic network settings on a Linux system. We looked at how to manage network interfaces, modify route tables, test connectivity, and configure DNS settings. With these skills, you should be able to handle fundamental networking tasks in your Linux environment.