Route (command)


In computing, route is a command used to view and manipulate the IP routing table in Unix-like and Microsoft Windows operating systems and also in IBM OS/2 and ReactOS. Manual manipulation of the routing table is characteristic of static routing.

Implementations

Unix and Unix-like

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.

Syntax

The command-syntax is:
route List kernel routing tables
route ... Modify routing table for AF.
route Detailed usage syntax for specified AF.
route Display version/author and exit.

Example


user@linux:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.101.0 192.168.102.102 255.255.255.0 UG 0 0 0 eth0
192.168.102.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.103.0 192.168.102.102 255.255.255.0 UG 0 0 0 eth0
192.168.12.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.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.

Syntax

The command-syntax is:
route metric Metric if Interface

Parameters

The -p parameter is only supported on Windows NT 4.0, Windows 2000, Windows Millennium Edition, and Windows XP. It is not supported on Windows 95 or Windows 98.

IBM OS/2

Syntax

The command-syntax is:
route MODIFIERS] args]

Parameters

Syntax

Print the route table:
route print
Add a route:
route add
Delete a route:
route delete