A Linux administrator receives complaints that a web server with two NICs cannot reach any public Internet hosts, but it can still communicate with systems on the company's internal 10.10.0.0/16 network. The current IPv4 routing table is:
$ ip route
default via 10.10.0.1 dev eth0 proto dhcp metric 100
10.10.0.0/16 dev eth0 proto kernel scope link src 10.10.0.50
192.168.50.0/24 dev eth1 proto kernel scope link src 192.168.50.10
Corporate firewalls are configured to allow outbound traffic only from the 192.168.50.0/24 segment, and the correct gateway for that network is 192.168.50.1. Which command will most effectively restore Internet connectivity while leaving the existing internal routes intact?
ip route del default via 10.10.0.1 && ip route add default via 192.168.50.1 dev eth1 metric 10
Adding a second default route that points to 192.168.50.1 on eth1 with a lower metric gives it higher priority than the existing default route on eth0. The kernel therefore selects the 192.168.50.1 gateway for outbound traffic, yet keeps the original default as a backup path. Simply adding an address does not change routing at all, deleting the original default route removes the fallback and briefly interrupts routing, and writing to /etc/sysconfig/network has no immediate effect (and is not portable across all distributions).
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.
What does a 'default route' do in a routing table?
Open an interactive chat with Bash
What is the purpose of setting a metric in routing?
Open an interactive chat with Bash
Why does simply adding an IP address not affect routing?
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