Each IP packet contains information about its origin and destination.
A routing table contains the information necessary to forward an IP packet along the best path toward its destination.
In this note i will show how to display the routing table in Windows using the route print
command.
Cool Tip: Check if TCP port is opened in PowerShell! Read more →
Show Routing Table in Windows
To display the routing table in Windows, use the route
command with the print
option.
Display all routing tables:
C:\> route print
Print IPv4 routing table:
C:\> route print -4
Print IPv6 routing table:
C:\> route print -6
Show only the network destinations that match 192*
:
C:\> route print 198*
Example of the routing table in Windows:
IPv4 Route Table ================================================================================== Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.31 50 127.0.0.0 255.0.0.0 On-link 127.0.0.1 331 127.0.0.1 255.255.255.255 On-link 127.0.0.1 331 192.168.1.0 255.255.255.0 On-link 192.168.1.31 306 192.168.1.31 255.255.255.255 On-link 192.168.1.31 306
Column | Description |
---|---|
Network Destination & Netmask | Specifies the pattern that a request must match with its destination address (IP address or CIDR range). |
Gateway | Specifies where to route a request i.e. the next hop to which the packet is to be sent on the way to its final destination. |
Interface | Indicates a local interface that is responsible for reaching the gateway. |
Metric | Indicates the associated cost of using the indicated route (“distance” to the target). In case of multiple feasible routes, the traffic will go through the gateway with the lowest metric. |
On-link
in the “Gateway” column means that the destination network is directly attached to the interface i.e. the NIC is in direct contact with the destination
network – on the same subnet.
The traffic that matches such route entry will trigger an ARP request on the interface to resolve the destination IP address directly i.e. find out a MAC-address of the target device (without contacting the gateway).
Cool Tip: How to show an ARP table and clear its cache in Windows! Read more →