LCA Network Configuration & Troubleshooting 4 — Questions and Answers
Question 1: Which command tests whether TCP port 80 on host 203.0.113.5 is open without using nmap?
- ping -p 80 203.0.113.5
- curl -v telnet://203.0.113.5:80
- nc -zv 203.0.113.5 80 (Correct answer)
- traceroute -p 80 203.0.113.5
Correct answer: nc -zv 203.0.113.5 80
'nc -zv host port' attempts a TCP connection without sending data (-z) and reports the result verbosely (-v).
Question 2: A Linux host with IP 192.168.10.5 needs to masquerade traffic to the internet through eth0. Which iptables command achieves this?
- iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE (Correct answer)
- iptables -A FORWARD -o eth0 -j MASQUERADE
- iptables -t mangle -A OUTPUT -o eth0 -j MASQUERADE
- iptables -A INPUT -i eth0 -j MASQUERADE
Correct answer: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
MASQUERADE in the nat table's POSTROUTING chain dynamically replaces the source IP with the outgoing interface's address.
Question 3: What does the 'ip link set eth0 mtu 9000' command do?
- Sets the maximum transmission rate to 9000 Mbps
- Configures the MTU of eth0 to 9000 bytes for jumbo frames (Correct answer)
- Assigns 9000 as the VLAN ID for eth0
- Limits eth0 to 9000 simultaneous connections
Correct answer: Configures the MTU of eth0 to 9000 bytes for jumbo frames
Setting MTU to 9000 enables jumbo frames, which can improve throughput on high-speed LAN segments that support it.
Question 4: Which configuration directive in /etc/resolv.conf allows the resolver to try multiple domain suffixes when resolving a short hostname?
- nameserver
- search (Correct answer)
- domain
- options ndots
Correct answer: search
The 'search' directive specifies a list of domain suffixes appended when a hostname without dots is queried.
Question 5: You observe high retransmission rates in 'ss -s' output. What does this most likely indicate?
- The DNS server is unreachable
- Network congestion or packet loss causing TCP to resend unacknowledged segments (Correct answer)
- The firewall is blocking UDP traffic
- The MTU is set too low for the interface
Correct answer: Network congestion or packet loss causing TCP to resend unacknowledged segments
TCP retransmissions occur when acknowledgments are not received in time, typically due to packet loss or congestion.
Question 6: Which file persists custom hostname-to-IP mappings on Linux and is consulted before DNS by default?
- /etc/hostname
- /etc/hosts (Correct answer)
- /etc/resolv.conf
- /etc/nsswitch.conf
Correct answer: /etc/hosts
The /etc/hosts file provides static hostname-to-IP mappings and is typically checked before DNS per /etc/nsswitch.conf order.
Question 7: What is the function of the 'bonding' kernel module in Linux networking?
- It encrypts traffic between two NICs
- It aggregates multiple network interfaces into a single logical interface for redundancy or throughput (Correct answer)
- It creates virtual VLAN interfaces
- It limits bandwidth on an interface using traffic shaping
Correct answer: It aggregates multiple network interfaces into a single logical interface for redundancy or throughput
Bonding (Link Aggregation) combines multiple NICs into one bond interface, supporting modes like active-backup and LACP.
Which command tests whether TCP port 80 on host 203.0.113.5 is open without using nmap?