Linux routing configuration On a Linux router or host, which command is used to add, delete, or view entries in the kernel routing table?

Difficulty: Easy

Correct Answer: route

Explanation:


Introduction / Context:
Routing determines where IP packets are forwarded. On classic Linux systems, administrators use user-space tools to interact with the kernel's routing table. Although modern distributions prefer the ip command from iproute2, many legacy systems and exam questions reference the older route tool.


Given Data / Assumptions:

  • We need the command traditionally used to add routes.
  • System runs a standard Linux environment.
  • We differentiate between viewing statistics and manipulating routes.


Concept / Approach:
The route command (now largely superseded by ip route) can add, delete, and display routes in the kernel routing table. Tools like netstat display network statistics and routes but are not typically used to add new routes. Nonstandard names like addroute or net do not represent the canonical Linux tools for this task.


Step-by-Step Solution:
Identify legacy command used to modify routes: route.Exclude report-only tools such as netstat.Exclude nonexistent or platform-specific aliases (addroute, net).Select route as the correct answer.


Verification / Alternative check:
Modern equivalent is ip route add or ip route show. Testing with either tool verifies route manipulation concepts are consistent.


Why Other Options Are Wrong:
addroute: not a standard Linux command.netstat: reports statistics and can display routes but does not add them.net: ambiguous/nonstandard in Linux for routing tasks.


Common Pitfalls:

  • Forgetting persistence; add routes permanently via network scripts or systemd-networkd.
  • Adding host routes when a default route is intended.
  • Not updating firewall rules to permit forwarding when acting as a router.


Final Answer:
route

More Questions from Linux

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion