| route | |
|---|---|
TheReactOS route command | |
| Developers | Fred N. van Kempen,Microsoft,IBM, ReactOS Contributors |
| Operating system | Unix-like,OS/2,Microsoft Windows,ReactOS |
| Platform | Cross-platform |
| Type | Command |
| License | OS/2, Windows:Proprietarycommercial software ReactOS:GPLv2 |
Incomputing,route is acommand used to view and manipulate theIProuting table inUnix-like andMicrosoftWindows[1]operating systems and also inIBMOS/2 andReactOS.[2] Manual manipulation of the routing table is characteristic ofstatic routing.
Theroute command originated in 4.2BSD. It is not part of any UNIX standard, but the BSD interface is widely implemented.[3]
Linux contains a version of theroute originally written by Fred N. van Kempen, later merged withnetstat's codebase (another command originating in 4.2BSD). It implements an extended syntax compared to the BSD version. InLinux distributions based on 2.2.xLinux kernels, theifconfig androute commands are operated together to connect a computer to a network, and to define routes betweencomputer networks. Distributions based on later kernels have deprecatedifconfig androute, replacing them withiproute2.[4]
OnmacOS, theroute utility is present but largely nonfunctional. Displaying the routing table is instead performed vianetstat -nr.
The BSD syntax is:
route[-dnqtv]{add|del|flush|get|monitor}[[modifiers]args]
The Linux syntax is:
route[-nNvee][-FC][<AF>]# List kernel routing tablesroute[-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.
In other words, the basicroute add androute del commands are portable.
user@linux:~$route-nKernel 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
The command is only available if theTCP/IP protocol is installed as a component in the properties of anetwork adapter.
The command-syntax is:
route [-f] [-p] [-4|-6] [Command [Destination] [mask Netmask] [Gateway] [[metric Metric]] [[if Interface]]The-p parameter is only supported onWindows NT 4.0,Windows 2000,Windows Millennium Edition, andWindows XP. It is not supported onWindows 95 orWindows 98.
The command-syntax is:
route [-nqv] [COMMAND] [[MODIFIERS] args]
ReactOS is an open-source Windows clone. Theroute implementation will eventually cover all options supported by Windows, but the current (as of 2025) version does not. It instead implements a subset of the options, a "poor man's route":[2]
Print the route table:
route print
Add a route:
route add<target> [mask<mask>]<gw> [metric<m>]
Delete a route:
route delete<target> <gw>
route(8) – FreeBSD System Manager'sManualroute(8) – Linux Programmer'sManual – Administration and Privileged Commands from Manned.org