Route (command)

Last updated
route
Developer(s) 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: Proprietary commercial software
ReactOS: GPLv2

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.

Contents

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. [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.

Syntax

The command-syntax is:

route [-f] [-p] [-4|-6] [Command [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
  • -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

Syntax

The command-syntax is:

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

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: <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

Syntax

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

Further reading

Related Research Articles

An Internet Protocol address is a numerical label such as 192.0.2.1 that is connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: network interface identification and location addressing.

Internetwork Packet Exchange (IPX) is the network layer protocol in the IPX/SPX protocol suite. IPX is derived from Xerox Network Systems' IDP. It also has the ability to act as a transport layer protocol.

<span class="mw-page-title-main">Internet Protocol version 4</span> Fourth version of the Internet Protocol

Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version deployed for production on SATNET in 1982 and on the ARPANET in January 1983. It is still used to route most Internet traffic today, even with the ongoing deployment of Internet Protocol version 6 (IPv6), its successor.

In computing, traceroute and tracert are computer network diagnostic commands for displaying possible routes (paths) and measuring transit delays of packets across an Internet Protocol (IP) network. The history of the route is recorded as the round-trip times of the packets received from each successive host in the route (path); the sum of the mean times in each hop is a measure of the total time spent to establish the connection. Traceroute proceeds unless all sent packets are lost more than twice; then the connection is lost and the route cannot be evaluated. Ping, on the other hand, only computes the final round-trip times from the destination point.

The Routing Information Protocol (RIP) is one of the oldest distance-vector routing protocols which employs the hop count as a routing metric. RIP prevents routing loops by implementing a limit on the number of hops allowed in a path from source to destination. The largest number of hops allowed for RIP is 15, which limits the size of networks that RIP can support.

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 with those routes. The routing table contains information about the topology of the network immediately around it.

<span class="mw-page-title-main">Network address translation</span> Protocol facilitating connection of one IP address space to another

Network address translation (NAT) is a method of mapping an IP address space into another by modifying network address information in the IP header of packets while they are in transit across a traffic routing device. The technique was originally used to bypass the need to assign a new address to every host when a network was moved, or when the upstream Internet service provider was replaced, but could not route the network's address space. It has become a popular and essential tool in conserving global address space in the face of IPv4 address exhaustion. One Internet-routable IP address of a NAT gateway can be used for an entire private network.

<span class="mw-page-title-main">Subnetwork</span> Logical subdivision of an IP network

A subnetwork or subnet is a logical subdivision of an IP network. The practice of dividing a network into two or more networks is called subnetting.

Internet Connection Sharing (ICS) is a Windows service that enables one Internet-connected computer to share its Internet connection with other computers on a local area network (LAN). The computer that shares its Internet connection serves as a gateway device, meaning that all traffic between other computers and the Internet go through this computer. ICS provides Dynamic Host Configuration Protocol (DHCP) and network address translation (NAT) services for the LAN computers.

<span class="mw-page-title-main">Supernetwork</span> Aggregation of Internet Protocol networks

A supernetwork, or supernet, is an Internet Protocol (IP) network that is formed by aggregation of multiple networks into a larger network. The new routing prefix for the aggregate network represents the constituent networks in a single routing table entry. The process of forming a supernet is called supernetting, prefix aggregation, route aggregation, or route summarization.

netstat Command line network statistics tool

In computing, netstat is a command-line network utility that displays network connections for Transmission Control Protocol, routing tables, and a number of network interface and network protocol statistics. It is available on Unix, Plan 9, Inferno, and Unix-like operating systems including macOS, Linux, Solaris and BSD. It is also available on IBM OS/2 and on Microsoft Windows NT-based operating systems including Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10.

Netfilter is a framework provided by the Linux kernel that allows various networking-related operations to be implemented in the form of customized handlers. Netfilter offers various functions and operations for packet filtering, network address translation, and port translation, which provide the functionality required for directing packets through a network and prohibiting packets from reaching sensitive locations within a network.

ifconfig Network administration utility

ifconfig is a system administration utility in Unix-like operating systems for network interface configuration.

<span class="mw-page-title-main">Linux Virtual Server</span> Load-balancing software

Linux Virtual Server (LVS) is load balancing software for Linux kernel–based operating systems.

A default gateway is the node in a computer network using the Internet protocol suite that serves as the forwarding host (router) to other networks when no other route specification matches the destination IP address of a packet.

In network routing, the control plane is the part of the router architecture that is concerned with drawing the network topology, or the information in a routing table that defines what to do with incoming packets. Control plane functions, such as participating in routing protocols, run in the architectural control element. In most cases, the routing table contains a list of destination addresses and the outgoing interface(s) associated with each. Control plane logic also can identify certain packets to be discarded, as well as preferential treatment of certain packets for which a high quality of service is defined by such mechanisms as differentiated services.

Static routing is a form of routing that occurs when a router uses a manually-configured routing entry, rather than information from dynamic routing traffic. In many cases, static routes are manually configured by a network administrator by adding in entries into a routing table, though this may not always be the case. Unlike dynamic routing, static routes are fixed and do not change if the network is changed or reconfigured. Static routing and dynamic routing are not mutually exclusive. Both dynamic routing and static routing are usually used on a router to maximise routing efficiency and to provide backups in case dynamic routing information fails to be exchanged. Static routing can also be used in stub networks, or to provide a gateway of last resort.

Sockstress is a method that is used to attack servers on the Internet and other networks utilizing TCP, including Windows, Mac, Linux, BSD and any router or other internet appliance that accepts TCP connections. The method does this by attempting to use up local resources in order to crash a service or the entire machine, essentially a denial of service attack.

IP routing is the application of routing methodologies to IP networks. This involves not only protocols and technologies but includes the policies of the worldwide organization and configuration of Internet infrastructure. In each IP network node, IP routing involves the determination of a suitable path for a network packet from a source to its destination in an IP network. The process uses static configuration rules or dynamically obtained from routing protocols to select specific packet forwarding methods to direct traffic to the next available intermediate network node one hop closer to the desired final destination, a total path potentially spanning multiple computer networks.

netsniff-ng Linux networking toolkit

netsniff-ng is a free Linux network analyzer and networking toolkit originally written by Daniel Borkmann. Its gain of performance is reached by zero-copy mechanisms for network packets, so that the Linux kernel does not need to copy packets from kernel space to user space via system calls such as recvmsg . libpcap, starting with release 1.0.0, also supports the zero-copy mechanism on Linux for capturing (RX_RING), so programs using libpcap also use that mechanism on Linux.

References