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 add default via 192.168.50.1 dev eth1 metric 10
ip addr add 192.168.50.1/24 dev eth1
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...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .