LFCS: Networking (25%)
This section covers Linux networking, hostname resolution, time synchronization, OpenSSH configuration, packet filtering, routing, bridges, and load balancing.
Goals
Networking 25%
- Configure IPv4 and IPv6 networking and hostname resolution
- Set and synchronize system time using time servers
- Monitor and troubleshoot networking
- Configure the OpenSSH server and client
- Configure packet filtering, port redirection, and NAT
- Configure static routing
- Configure bridge and bonding devices
- Implement reverse proxies and load balancers
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 using
chronyc 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 SSH 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 firewalls using
iptablesorfirewalld. - Perform NAT and port 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
# Add 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 (e.g., 2222 → 22).
- Enable masquerading to share internet from one interface to another.
6. Static Routing
Learn
- Add static routes to control network traffic 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 using
pingortraceroute.
7. Bridge & Bonding Devices
Learn
- Create network bridges for virtual machines or containers.
- Create 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
# Create bonded 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 bridge interface and attach an Ethernet device.
- Configure a bonded interface using two NICs in active-backup mode.
8. Reverse Proxies & Load Balancers
Learn
- Understand reverse proxies and load balancing concepts.
- Use Nginx as a basic reverse proxy or load balancer.
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.
- Implement round-robin load balancing for multiple backend servers.
- Test the setup using
curlor a web browser.
🧪 Exam Tips
- Always verify connectivity and DNS resolution (
ping,dig,nslookup). - Understand network configuration files:
/etc/NetworkManager/system-connections//etc/sysconfig/network-scripts/(RHEL-based)
- Practice switching between NetworkManager CLI (
nmcli) andipcommands. - Familiarize yourself with firewalld zones and NAT configurations.
- Understand basic Nginx directives for proxying and load balancing.
No comments to display
No comments to display