nerdexam
Linux_Foundation

LFCS · 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. The route add command is used to add a static route to the routing table, including a default route, by specifying the gateway IP address.

Submitted by joshua94· Apr 18, 2026Networking

Question

Which of the following statements would create a default route using a gateway of 192.168.1.1?

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

(27 responses)
  • B
    4% (1)
  • D
    93% (25)
  • E
    4% (1)

Why each option

The `route add` command is used to add a static route to the routing table, including a default route, by specifying the gateway IP address.

Anetstat -add default gw

`netstat` is primarily used for displaying network connections, routing tables, and interface statistics, not for adding routes.

Broute default 192.168.1.1

The syntax `route default 192.168.1.1` is incomplete and syntactically incorrect for adding a default route using the `route` command.

Cip route default 192.168.1.1

While `ip route add default via 192.168.1.1` is a correct modern command, the provided option `ip route default 192.168.1.1` is syntactically incorrect.

Droute add default gw 192.168.1.1Correct

The `route add` command is used to manually add an entry to the kernel routing table. The `default gw` syntax specifies that the entry is for the default route, directing all traffic for unknown networks through the specified gateway IP address.

Eifconfig default gw 192.168.1.1 eth0

`ifconfig` is used for configuring network interfaces (like setting IP addresses), not for adding routes to the routing table.

Concept tested: Adding a default route using `route` command

Source: https://man7.org/linux/man-pages/man8/route.8.html

Topics

#Routing#Default Gateway#Network Configuration#Linux Commands

Community Discussion

No community discussion yet for this question.

Full LFCS Practice