LX0-104 · Question #231
Which of the following statements would create a default route using a gateway of 192.168.1.1?
The correct answer is D. route add default gw 192.168.1.1. To establish a default route pointing to a specific gateway, the route add default gw command is used in Linux systems.
Question
Options
- Anetstat -add default gw
- Broute default 192.168.1.1
- Cip route default 192.168.1.1
- Droute add default gw 192.168.1.1
- Eifconfig default gw 192.168.1.1 eth0
How the community answered
(57 responses)- A7% (4)
- B4% (2)
- D88% (50)
- E2% (1)
Why each option
To establish a default route pointing to a specific gateway, the `route add default gw` command is used in Linux systems.
`netstat` is primarily for displaying network connections and routing tables, not for adding routes.
The syntax `route default 192.168.1.1` is incomplete and not the correct way to add a default route using the `route` command.
While `ip route` is the modern command for routing, `ip route default 192.168.1.1` is not the correct syntax; it should typically be `ip route add default via 192.168.1.1`.
The `route add default gw 192.168.1.1` command correctly adds a default route to the routing table, directing all traffic for unknown networks through the gateway at 192.168.1.1.
`ifconfig` is used for configuring network interfaces, not for directly adding default routes to the kernel's routing table.
Concept tested: Linux network routing table configuration (route command)
Source: https://linux.die.net/man/8/route
Topics
Community Discussion
No community discussion yet for this question.