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.

Uses your system voice; voice and rate in settings.

≈ 6 min read

Cite, export and learn8 citation formats · 8 exports · lesson and quiz

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

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

  • 1.2 Microsoft Windows
  • 1.3 IBM OS/2
  • 1.4 ReactOS
  • 2 See also
  • 3 Further reading
  • 4 References
  • 5 External links
  • Implementations

    edit edit source

    Unix and Unix-like

    edit edit source

    The route 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 the route originally written by Fred N. van Kempen, later merged with netstat's codebase (another command originating in 4.2BSD). It implements an extended syntax compared to the BSD version. 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.[4]

    On macOS, the route utility is present but largely nonfunctional. Displaying the routing table is instead performed via netstat -nr.

    Syntax

    edit edit source

    The BSD syntax is:

    route [-dnqtv] {add|del|flush|get|monitor} [[modifiers] args]

    The Linux 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.

    In other words, the basic route add and route del commands are portable.

    Example

    edit edit source 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

    edit edit source

    The command is only available if the TCP/IP protocol is installed as a component in the properties of a network adapter.

    Syntax

    edit edit source

    The command-syntax is:

    route [-f] [-p] [-4|-6] [Command [Destination] [mask Netmask] [Gateway] [[metric Metric]] [[if Interface]]

    Parameters

    edit edit source
    • -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
    • -6: Force using IPv6
    • 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 Millennium Edition, and Windows XP. It is not supported on Windows 95 or Windows 98.

    IBM OS/2

    edit edit source

    Syntax

    edit edit source

    The command-syntax is:

    route [-nqv] [COMMAND] [[MODIFIERS] args]

    Parameters

    edit edit source
    • -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: <dest> is a network address
    • -host: <dest> is host name or address (default)
    • -netmask: the mask of the route
    • <dest>: IP address or host name of the destination
    • <gateway>: IP address or host name of the next-hop router

    ReactOS

    edit edit source

    ReactOS is an open-source Windows clone. The route 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]

    Syntax

    edit edit source

    Print the route table:

    route print

    Add a route:

    route add <target> [mask <mask>] <gw> [metric <m>]

    Delete a route:

    route delete <target> <gw>

    See also

    edit edit source

    Further reading

    edit edit source

    References

    edit edit source
    1. ^ "Adding a TCP/IP Route to the Windows Routing Table". Archived from the original on 2016-11-13. Retrieved 2016-11-13. Wikipedia revision 1353523640, retrieved 2026-11-21
    2. ^ a b "Reactos/Reactos". GitHub. 4 November 2021. Wikipedia revision 1353523640, retrieved 2026-11-21
    3. ^ route(8) – FreeBSD System Manager's Manual Wikipedia revision 1353523640, retrieved 2026-11-21
    4. ^ route(8) – Linux Programmer's Manual – Administration and Privileged Commands from Manned.org Wikipedia revision 1353523640, retrieved 2026-11-21
    edit edit source Wikibooks has a book on the topic of: Guide to Windows Commands Windows command-line programs and shell builtinsEcosystem File system navigation File management Archiving Disk management Processes Registry User environment File contents Scripting Networking Maintenance and care Boot management Software development Miscellaneous

    Text derived from https://en.wikipedia.org/w/index.php?oldid=1353523640 under CC BY-SA 4.0; modifications have been made.

    Words in each sectionImplementationsImplementationsImplementations: 703 words703Further readingFurther readingFurther reading: 43 words43See alsoSee alsoSee also: 10 words10
    Words in each section. Measured from the stored article body; sections below the minimum are not plotted.

    Provenance

    snapshot enwiki-001353523640 · captured 2026-05-10 · ledger · version history

    Cite this page as: encyclopegia.org, “Route (command)”, snapshot enwiki-001353523640. https://encyclopegia.org/a/route-command