LCA Network Configuration & Troubleshooting 5 — Questions and Answers
Question 1: Which command permanently sets the hostname to 'prod-server-01' on a systemd-based Linux system?
- hostname prod-server-01
- hostnamectl set-hostname prod-server-01 (Correct answer)
- echo prod-server-01 > /etc/hostname && reboot
- nmcli general hostname prod-server-01
Correct answer: hostnamectl set-hostname prod-server-01
'hostnamectl set-hostname' updates /etc/hostname and the running system hostname atomically without requiring a reboot.
Question 2: A packet sent to 8.8.8.8 is dropped at hop 5 during a traceroute. What does this mean?
- The destination is permanently unreachable
- A router at hop 5 is not forwarding packets to the next hop
- The TTL expired at hop 5 and the packet was discarded permanently
- ICMP is blocked at hop 5, but the destination may still be reachable (Correct answer)
Correct answer: ICMP is blocked at hop 5, but the destination may still be reachable
Many routers deprioritize or block ICMP TTL-exceeded responses, so a traceroute timeout at a hop doesn't mean the destination is unreachable.
Question 3: Which command creates a VLAN interface tagged as VLAN 100 on top of eth0?
- ip link add link eth0 name eth0.100 type vlan id 100 (Correct answer)
- ip vlan add eth0 tag 100
- vconfig add eth0 100
- ip link set eth0 vlan 100
Correct answer: ip link add link eth0 name eth0.100 type vlan id 100
'ip link add link eth0 name eth0.100 type vlan id 100' creates an 802.1Q VLAN subinterface using iproute2.
Question 4: What does the 'nft list ruleset' command do?
- Lists all active iptables rules
- Displays the complete nftables ruleset including tables, chains, and rules (Correct answer)
- Shows firewalld zones and their rules
- Lists all open ports using nftables probes
Correct answer: Displays the complete nftables ruleset including tables, chains, and rules
'nft list ruleset' outputs the full nftables configuration including all tables, chains, and rules in a readable format.
Question 5: A DHCP client is not receiving an IP address. After confirming the DHCP server is running, what should you check next on the client?
- Whether the client has a static route configured
- Whether the client's NIC is up and sending DHCPDISCOVER broadcasts (Correct answer)
- Whether the DNS server is reachable
- Whether IPv6 is disabled on the interface
Correct answer: Whether the client's NIC is up and sending DHCPDISCOVER broadcasts
DHCP begins with the client broadcasting DHCPDISCOVER; verifying the NIC is up and the broadcast is sent confirms the client side is working.
Question 6: Which command shows detailed statistics for interface eth0, including TX/RX errors and dropped packets?
- ip addr show eth0
- ip -s link show eth0 (Correct answer)
- ifconfig eth0 stats
- netstat -i eth0
Correct answer: ip -s link show eth0
'ip -s link show eth0' displays per-interface statistics including transmitted/received bytes, errors, and drops.
Question 7: You need to test DNS resolution for the hostname 'api.example.com' against a specific DNS server at 1.1.1.1. Which command does this?
- nslookup api.example.com 1.1.1.1
- dig @1.1.1.1 api.example.com (Correct answer)
- host api.example.com -s 1.1.1.1
- resolve api.example.com 1.1.1.1
Correct answer: dig @1.1.1.1 api.example.com
'dig @server hostname' queries the specified DNS server directly, bypassing /etc/resolv.conf settings.
Which command permanently sets the hostname to 'prod-server-01' on a systemd-based Linux system?