netstat

This program obtains network information from kernel data structures. The following command displays the routing table on Windows:

C:\>netstat -rn
 
Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 03 47 b8 9d 10 ...... Intel(R) PRO/100 SP Mobile Combo Adapter - SecuR
emote Miniport
0x10004 ...00 09 5b e6 cd 6d ...... NETGEAR WG511 54 Mbps Wireless PC Card
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.3   192.168.1.120       25
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.1.0    255.255.255.0    192.168.1.120   192.168.1.120       25
    192.168.1.120  255.255.255.255        127.0.0.1       127.0.0.1       25
    192.168.1.255  255.255.255.255    192.168.1.120   192.168.1.120       25
        224.0.0.0        240.0.0.0    192.168.1.120   192.168.1.120       25
  255.255.255.255  255.255.255.255    192.168.1.120               2       1
  255.255.255.255  255.255.255.255    192.168.1.120   192.168.1.120       1
Default Gateway:       192.168.1.3
===========================================================================
Persistent Routes:
  None

And the same command on a Unix system:

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0
$

Note the third column, ...

Get Essential SNMP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.