102-500 · Question #166
Identify the statement that would create a default route using a gateway of 192.168.1.1.
The correct answer is B. route add default gw 192.168.1.1. Option B is correct because route add default gw 192.168.1.1 is the valid Linux/Unix syntax for adding a default route - route add is the command, default specifies the destination (equivalent to 0.0.0.0/0), and gw is the required keyword preceding the gateway IP. A is wrong…
Question
Options
- Anetstat -add default gw 192.168.1.1
- Broute add default gw 192.168.1.1
- Cip route default 192.168.1.1
- Droute default gw 192.168.1.1
- Eifconfig default gw 192.168.1.1 eth0
How the community answered
(22 responses)- A14% (3)
- B77% (17)
- C5% (1)
- D5% (1)
Explanation
Option B is correct because route add default gw 192.168.1.1 is the valid Linux/Unix syntax for adding a default route - route add is the command, default specifies the destination (equivalent to 0.0.0.0/0), and gw is the required keyword preceding the gateway IP.
- A is wrong because
netstatis a network statistics tool used for viewing connections and routing tables, not modifying them;netstat -addis not a valid flag combination. - C is wrong because the correct
ip routesyntax requiresaddand theviakeyword:ip route add default via 192.168.1.1. - D is wrong because it omits
add- without it, theroutecommand doesn't know what operation to perform. - E is wrong because
ifconfigconfigures interface parameters (IP, netmask, MTU), not routing; it has no concept of a gateway route.
Memory tip: Think of the route command like a sentence - "route add [destination] gw [gateway]" - you're telling the system to add a path to a destination through a gateway. If the command name isn't route, or the action word add is missing, it won't work.
Topics
Community Discussion
No community discussion yet for this question.