A Linux web server on the 172.16.20.0/24 LAN suddenly loses the ability to reach any external network, although hosts on the same subnet remain reachable. The following routing table is displayed:
$ ip route show
default via 192.168.1.1 dev eth0 metric 10
default via 172.16.20.1 dev eth0 proto dhcp metric 100
172.16.20.0/24 dev eth0 proto kernel scope link src 172.16.20.55
The address 192.168.1.1 is not present on the current physical network. Which ONE command will immediately restore external connectivity while leaving the DHCP-supplied route in place?
ip route del default via 192.168.1.1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Linux chooses the default route with the lowest metric value. Because 192.168.1.1 has metric 10, all traffic destined for networks outside 172.16.20.0/24 is forwarded to an unreachable gateway and therefore fails. Removing that incorrect default route forces the kernel to fall back to the valid DHCP-provided gateway (metric 100), restoring normal connectivity. Lowering the MTU only affects frame size, NAT masquerading changes outbound address translation, and enabling IPv4 forwarding is relevant only when the host is acting as a router; none of those actions correct the gateway selection problem.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why does the Linux kernel choose the default route with the lowest metric value?
Open an interactive chat with Bash
What does the 'ip route del default via' command do?
Open an interactive chat with Bash
What is the role of the 'metric' parameter in routing tables?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Troubleshooting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access