In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
,
route
is a
command
Command may refer to:
Computing
* Command (computing), a statement in a computer language
* command (Unix), a Unix command
* COMMAND.COM, the default operating system shell and command-line interpreter for DOS
* Command key, a modifier key on A ...
used to view and manipulate the
IP routing table
In computer networking, a routing table, or routing information base (RIB), is a data table stored in a router or a network host that lists the routes to particular network destinations, and in some cases, metrics (distances) associated wi ...
in
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
and
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s and also in
IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
OS/2
OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
and
ReactOS
ReactOS is a Free and open-source software, free and open-source operating system for i586/amd64 personal computers that is intended to be binary-code compatibility, binary-compatible with computer programs and device drivers developed for Wind ...
. Manual manipulation of the routing table is characteristic of
static routing
Static routing describes a process by which routing is configured with fixed values that do not change at runtime unless manually edited. Static routes are used with and without dynamic Routing protocols and usually share the same routing table a ...
.
Implementations
Unix and Unix-like
In
Linux distributions
A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel (operating system), kernel functionality. Although the name does not imply distribution (marketing), product distribution pe ...
based on 2.2.x
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
s, the
ifconfig
ifconfig (short for ''interface config'') is a system administration utility in Unix-like operating systems for network interface configuration.
The utility is a command-line interface
A command-line interface (CLI) is a means of inter ...
and
route
commands are operated together to connect a computer to a network, and to define routes between
computer network
A computer network is a collection of communicating computers and other devices, such as printers and smart phones. In order to communicate, the computers and devices must be connected by wired media like copper cables, optical fibers, or b ...
s. 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 nNvee FC ">AF> # List kernel routing tables
route v FC ... # Modify routing table for AF.
route ">AF> # 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 f p -6 ommand [Destination[mask Netmask">estination.html" ;"title="ommand [Destination">ommand [Destination[mask Netmask[Gateway] metric Metric if Interface
Parameters
*
-f: Clears the routing table
*
-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)
*
-4: Force using
IPv4
Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a standalone specification. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. ...
*
-6: Force using
IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
*
Destination: Network destination of the route
*
mask Netmask: The netmask (
subnet mask) associated with the network destination
*
Gateway: The forwarding or next hop IP address over which the set of addresses defined by the network destination and subnet mask are reachable
*
metric Metric: Integer cost metric (ranging from 1 to 9999) for the route
*
if Interface: The index of the interface over which the destination is reachable
*
/?: Command help
The
-p parameter is only supported on
Windows NT 4.0,
Windows 2000
Windows 2000 is a major release of the Windows NT operating system developed by Microsoft, targeting the server and business markets. It is the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RT ...
,
Windows Millennium Edition, and
Windows XP
Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
. It is not supported on
Windows 95
Windows 95 is a consumer-oriented operating system developed by Microsoft and the first of its Windows 9x family of operating systems, released to manufacturing on July 14, 1995, and generally to retail on August 24, 1995. Windows 95 merged ...
or
Windows 98
Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was the second operating system in the 9x line, as the successor to Windows 95. It was Software ...
.
IBM OS/2
Syntax
The command-syntax is:
route nqv OMMAND MODIFIERSargs]
Parameters
*
-n: Bypasses translating IP addresses to symbolic host names
*
-q: Suppresses all output
*
-v: Verbose
*
COMMAND: The command to run (
add,
delete,
change,
get,
monitor,
flush)
*
-net:
is a network address
*
-host:
is host name or address (default)
*
-netmask: the mask of the route
*
: IP address or host name of the destination
*
: IP address or host name of the next-hop router
ReactOS
Syntax
Print the route table:
route print
Add a route:
route add ">ask ">etric
Delete a route:
route delete
See also
*
Routing table
In computer networking, a routing table, or routing information base (RIB), is a data table stored in a router or a network host that lists the routes to particular network destinations, and in some cases, metrics (distances) associated wi ...
*
Internet Protocol Suite
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
*
iproute2
*
BusyBox
BusyBox is a software suite that provides several List of Unix commands, Unix utilities in a single executable file. It runs in a variety of POSIX environments such as Linux, Android (operating system), Android, and FreeBSD, although many of the ...
Further reading
*
*
References
External links
*
*
*
*
route- o
technet.microsoft.com
{{Windows commands
Internet Protocol based network software
OS/2 commands
Routing
Unix network-related software
Windows communication and services
Windows administration