hardMultiple ChoiceObjective-mapped
XK0-006 default gateway Practice Question
A sysadmin needs to set a default gateway for a network interface. Which command(s) accomplish this?
⚠ Common exam trap
Candidates often think only the modern `ip route` command works, forgetting that the legacy `route` command is still accepted on many Linux distributions, or they may mistakenly believe `netstat -rn` can set a route because it displays routing information.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Both B and C
Both the legacy `route` command (route add default gw 192.168.1.1) and the modern `ip route` command (ip route add default via 192.168.1.1) can be used to set a default gateway. Therefore, the correct choice is D, which includes both valid commands. `netstat -rn` only displays routing information and cannot modify routes.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
netstat -rn
Why it's wrong here
netstat -rn only displays the routing table; it does not modify routes. Therefore, it cannot set a default gateway.
- ✗
route add default gw 192.168.1.1
Why it's wrong here
The `route add default gw` command is a legacy method that works on many Linux distributions to set a default gateway.
- ✗
ip route add default via 192.168.1.1
Why it's wrong here
The `ip route add default via` command is the modern standard for setting a default gateway in Linux.
- ✓
Both B and C
Why this is correct
This option combines A and B, but since A is not a command that sets a default gateway, D is incorrect.
Go deeper
Related to this question
About these practice questions
Courseiva writes every XK0-006 question from scratch — 979 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.