LCA Network Configuration & Troubleshooting 3 — Questions and Answers
Question 1: Which NetworkManager command-line tool is used to bring up a connection profile named 'office-vpn'?
- nmcli con up office-vpn (Correct answer)
- networkctl up office-vpn
- ip link set office-vpn up
- ifup office-vpn
Correct answer: nmcli con up office-vpn
'nmcli con up <name>' activates a connection profile managed by NetworkManager.
Question 2: What is the purpose of the /proc/sys/net/ipv4/ip_forward file?
- It stores the system's default gateway
- It enables or disables kernel IP packet forwarding between interfaces (Correct answer)
- It lists all IPv4 network interfaces
- It configures ICMP redirect behavior
Correct answer: It enables or disables kernel IP packet forwarding between interfaces
Writing '1' to ip_forward enables the Linux kernel to forward packets between network interfaces, making it act as a router.
Question 3: A user reports intermittent packet loss to a remote server. Which tool provides continuous per-hop latency and loss statistics in a single view?
- traceroute
- ping
- mtr (Correct answer)
- nmap
Correct answer: mtr
'mtr' combines traceroute and ping, continuously updating per-hop packet loss and latency statistics.
Question 4: Which iptables chain is used to modify packets destined for the local machine before routing decisions are made?
- OUTPUT
- PREROUTING (Correct answer)
- FORWARD
- INPUT
Correct answer: PREROUTING
The PREROUTING chain (in the nat table) processes incoming packets before the routing decision, used for DNAT.
Question 5: You need to capture only TCP traffic on port 443 on interface eth0 using tcpdump. Which command is correct?
- tcpdump -i eth0 port 443
- tcpdump -i eth0 tcp and port 443 (Correct answer)
- tcpdump -i eth0 -p 443 tcp
- tcpdump -i eth0 filter tcp:443
Correct answer: tcpdump -i eth0 tcp and port 443
tcpdump uses BPF filter syntax; 'tcp and port 443' captures only TCP packets on port 443.
Question 6: Which command shows the ARP cache on a Linux system using iproute2?
- arp -n
- ip neigh show (Correct answer)
- ip arp list
- netstat -a
Correct answer: ip neigh show
'ip neigh show' displays the neighbor (ARP) table, which maps IP addresses to MAC addresses.
Question 7: What does setting a network interface to promiscuous mode accomplish?
- It assigns multiple IP addresses to the interface
- It allows the interface to receive all packets on the network segment, not just those addressed to it (Correct answer)
- It enables hardware offloading for better performance
- It disables ARP on the interface
Correct answer: It allows the interface to receive all packets on the network segment, not just those addressed to it
Promiscuous mode causes the NIC to pass all frames to the kernel regardless of destination MAC, essential for packet capture tools.
Which NetworkManager command-line tool is used to bring up a connection profile named 'office-vpn'?