In Linux distributions based on 2.2.x Linux kernels, the ifconfig and route commands are operated together to connect a computer to a network, and to define routes between computer networks. Distributions based on later kernels have deprecated ifconfig and route, replacing them with iproute2.
Route for Linux was originally written by Fred N. van Kempen.[3]
Syntax
The command-syntax is:
route[-nNvee][-FC][<AF>]# List kernel routing tables
route[-v][-FC]{add|del|flush}...# Modify routing table for AF.
route{-h|--help}[<AF>]# Detailed usage syntax for specified AF.
route{-V|--version}# Display version/author and exit.
Example
user@linux:~$ route-n
Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.101.0 192.168.102.102 255.255.255.0 UG 0 0 0 eth0192.168.102.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0192.168.103.0 192.168.102.102 255.255.255.0 UG 0 0 0 eth0192.168.12.0 0.0.0.0 255.255.255.0 U 0 0 0 eth00.0.0.0 192.168.12.1 0.0.0.0 UG 0 0 0 eth0
Microsoft Windows
The command is only available if the TCP/IP protocol is installed as a component in the properties of a network adapter.
-p: The route is added to the Windows Registry and is used to initialize the IP routing table whenever the TCP/IP protocol is started (only when used with the add command)
Command: The command to run (add, change, delete, print)
John Paul Mueller (2007). Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000. John Wiley & Sons. ISBN978-0470165799.