LCA Network Configuration & Troubleshooting 2 — Questions and Answers
Question 1: Which command displays the current routing table on a Linux system using the iproute2 suite?
- route -n
- ip route show (Correct answer)
- netstat -r
- ifconfig route
Correct answer: ip route show
The 'ip route show' command from the iproute2 suite displays the kernel routing table.
Question 2: A server cannot reach hosts outside its subnet. The default gateway is set to 192.168.1.1, but pinging it fails. What is the FIRST step to diagnose this?
- Restart the network service
- Check if the gateway IP is reachable via ARP using 'arping' (Correct answer)
- Flush the routing table with 'ip route flush'
- Reinstall the network drivers
Correct answer: Check if the gateway IP is reachable via ARP using 'arping'
Using 'arping' confirms whether the gateway's MAC address is reachable at Layer 2 before investigating higher-layer issues.
Question 3: Which file in a Red Hat-based system stores the DNS resolver configuration?
- /etc/hosts
- /etc/nsswitch.conf
- /etc/resolv.conf (Correct answer)
- /etc/named.conf
Correct answer: /etc/resolv.conf
The /etc/resolv.conf file specifies nameserver addresses and search domains used by the resolver library.
Question 4: What does the 'ss -tulpn' command display?
- All active SSH tunnels
- Listening TCP and UDP sockets with associated process names (Correct answer)
- Network interface statistics
- Firewall rules for TCP/UDP
Correct answer: Listening TCP and UDP sockets with associated process names
'ss -tulpn' lists all listening (-l) TCP (-t) and UDP (-u) sockets with process names (-p) and numeric ports (-n).
Question 5: You want to add a static route so that traffic to 10.20.0.0/24 goes through gateway 192.168.1.254 permanently on a systemd-networkd system. Where do you configure this?
- /etc/network/interfaces
- /etc/sysconfig/network-scripts/ifcfg-eth0
- A .network file in /etc/systemd/network/ with a [Route] section (Correct answer)
- /etc/iproute2/rt_tables
Correct answer: A .network file in /etc/systemd/network/ with a [Route] section
systemd-networkd reads .network files in /etc/systemd/network/ where [Route] sections define static routes.
Question 6: Which tool performs a path MTU discovery test to a remote host to detect where packets are being fragmented?
- tracepath (Correct answer)
- mtr
- ping -s 1500
- nmap -sV
Correct answer: tracepath
'tracepath' probes each hop along the route and reports the PMTU by sending incrementally larger UDP packets.
Question 7: A host has two NICs: eth0 (192.168.1.10/24) and eth1 (10.0.0.5/24). Traffic to 10.0.0.0/24 is unexpectedly using eth0. What is the most likely cause?
- The NIC driver is outdated
- A more specific route for 10.0.0.0/24 is missing, so the default route via eth0 is used (Correct answer)
- IPv6 is interfering with IPv4 routing
- The firewall is redirecting packets
Correct answer: A more specific route for 10.0.0.0/24 is missing, so the default route via eth0 is used
Without a specific route for 10.0.0.0/24 via eth1, the kernel falls back to the default route, which exits through eth0.
Which command displays the current routing table on a Linux system using the iproute2 suite?