LFCS: Networking (25%)
This section covers Linux networking,networking, hostname resolution, time synchronization, OpenSSH,OpenSSH configuration, packet filtering, routing, bridges, and load balancing.
Goals
Networking 25%
1. Configure IPv4/IPv6 Networking & Hostname Resolution
Learn
- Assign IP addresses (static & dynamic).
- Configure hostnames and DNS resolution.
- Understand
/etc/hosts,/etc/resolv.conf, andhostnamectl.
Commands
# View network interfaces
ip addr show
ip link show
# Configure static IP (example)
sudo nmcli con mod eth0 ipv4.addresses 192.168.1.100/24
sudo nmcli con mod eth0 ipv4.gateway 192.168.1.1
sudo nmcli con mod eth0 ipv4.dns 8.8.8.8
sudo nmcli con mod eth0 ipv4.method manual
sudo nmcli con up eth0
# Set hostname
hostnamectl set-hostname myhost
hostnamectl status
# DNS check
cat /etc/resolv.conf
ping google.com
Exercises
- Assign a static IP to an interface and verify connectivity.
- Change the hostname and update
/etc/hostsaccordingly.
2. Time Synchronization
Learn
- Sync system time using
chronyorntpd. - Check and update time zone.
Commands
# Check current time
timedatectl
# Set time zone
timedatectl set-timezone Europe/Paris
# Sync time using chrony
sudo systemctl start chronyd
sudo systemctl enable chronyd
chronyc tracking
chronyc sources
Exercises
- Configure NTP synchronization with a public server.
- Verify time sync
status.status usingchronyc tracking.
3. Monitor & Troubleshoot Networking
Learn
- Use tools to check connectivity and troubleshoot issues.
Commands
ping <host>
traceroute <host>
ss -tulnp # check listening ports
netstat -rn # routing table
curl -I http://example.com
dig example.com # DNS query test
Exercises
- Ping a remote host and check for packet loss.
- Check which service is listening on port 80.
- Use
tracerouteto identify network path latency.
4. OpenSSH Configuration
Learn
- Configure SSH server and client.
- Manage SSH keys and permissions.
Commands
# Start and enable SSH server
sudo systemctl start sshd
sudo systemctl enable sshd
# Connect to remote server
ssh user@remote_host
# Generate keysSSH key pair
ssh-keygen -t rsa -b 4096
# Copy SSH public key to remote server
ssh-copy-id user@remote_host
# Change SSH port (example: 2222)
sudo nano /etc/ssh/sshd_config
# Port 2222
sudo systemctl reload sshd
Exercises
- Configure SSH to listen on a non-default port.
- Set up key-based authentication.
- Disable root password login for security.
5. Packet Filtering, Port Redirection, and NAT
Learn
- Configure
firewallfirewalls usingiptablesorfirewalld. - Perform NAT and port
forwarding.forwarding for network access.
Commands
# Check firewall status
sudo firewall-cmd --state
# Allow SSH port 22
sudo firewall-cmd --add-port=22/tcp --permanent
sudo firewall-cmd --reload
# ExampleAdd NAT rule (masquerade)
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# View rules
sudo iptables -t nat -L -n -v
Exercises
- Open a specific port (e.g., 8080) on the firewall.
- Configure port forwarding for
SSH.SSH (e.g., 2222 → 22).
6. Static Routing
Learn
- Add static routes
forto control network trafficcontrol.paths.
Commands
# Add a static route
sudo ip route add 192.168.2.0/24 via 192.168.1.1 dev eth0
# Delete a static route
sudo ip route del 192.168.2.0/24
# Show routes
ip route show
Exercises
- Add a static route to reach a remote network.
- Verify connectivity via the static
route.route usingpingortraceroute.
7. Bridge & Bonding Devices
Learn
NetworkCreatebridgingnetwork(e.g.,bridges forVMs).virtual machines or containers.BondingCreate bonded interfaces for redundancy or link aggregation.
Commands
# Create a bridge
sudo nmcli con add type bridge con-name br0 ifname br0
sudo nmcli con add type bridge-slave con-name eth0-br0 ifname eth0 master br0
# BondingCreate examplebonded interface
sudo nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
sudo nmcli con add type bond-slave con-name eth1-bond0 ifname eth1 master bond0
sudo nmcli con add type bond-slave con-name eth2-bond0 ifname eth2 master bond0
# View connection status
nmcli con show
Exercises
- Create a
networkbridgebridgeinterface and attach aninterface.Ethernet device. - Configure a bonded interface
withusing twoNICs.NICs in active-backup mode.
8. Reverse Proxies & Load Balancers
Learn
BasicsUnderstandofreverse proxies and load balancing concepts.
Commands
# Install and configure Nginx
sudo apt install nginx -y
# Nginx reverse proxy configuration example
sudo nano /etc/nginx/conf.d/reverse.conf
# Example config:
# server {
# listen 80;
# location / {
# proxy_pass http://backend:8080;
# }
# }
# Enable and reload Nginx
sudo systemctl enable nginx
sudo systemctl reload nginx
Exercises
- Configure Nginx to proxy requests to a backend server.
Set up basicImplement round-robin load balancing for multiple backend servers.
curl or a web browser.
🧪 Exam Tips
ping, dig, nslookup).
Understand network configuration files:
/etc/NetworkManager/system-connections/
/etc/sysconfig/network-scripts/ (RHEL-based)
Practice switching between NetworkManager CLI (nmcli) and ip commands.
Familiarize yourself with firewalld zones and NAT configurations.
Understand basic Nginx directives for proxying and load balancing.