What command do you use to add routes to a Linux router? A. addroute B. route C. netstat D. net E. None of the above

addroute
route
netstat
net E. None of the above

The correct answer is B. route.

The route command is used to add, delete, and modify routing tables on Linux systems. It can also be used to display the current routing table.

The syntax for the route command is as follows:

route [options] [command] [destination] [gateway] [metric]

The options that can be used with the route command are as follows:

  • -a: Display the current routing table.
  • -d: Delete a route.
  • -i: Specify the interface to use for the route.
  • -n: Do not resolve addresses to names.
  • -p: Print the route in a portable format.
  • -q: Quiet mode. Do not print any output.
  • -v: Verbose mode. Print additional information.

The command that can be used with the route command is as follows:

  • add: Add a route to the routing table.
  • delete: Delete a route from the routing table.
  • flush: Flush the routing table.
  • get: Get the current routing table.
  • show: Show the current routing table.

The destination is the network or host that the route is for. The gateway is the IP address of the router that will forward packets to the destination network. The metric is a number that indicates the cost of using the route. A lower metric indicates a better route.

For example, the following command would add a route to the routing table for the network 192.168.1.0/24 with a gateway of 192.168.1.254:

route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254