SEARCH

How-To Geek

Display the routing table in either Windows or Ubuntu

From a command prompt or terminal window, run this command:

netstat -rn

You should see output that looks similar to this:

 

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 09/11/06

Comments (11)

  1. Kanakan

    This is not working on Windows XP. The correct option is “netstat -r”

  2. squir

    in what file does the routing table sit in Ubuntu

  3. Snezer

    Kanakan> You said that without testing it… didn’t you? Big mistake.

  4. Lynne

    Well the connection says its connected but The laptop will not go on line I Enabled the network sharing on the broad band connection but the laptop ( Ubuntu 8.04 ) is not getting on line . . Using a RJ – 45 connection between them

  5. Kanakan

    I did test this.

    C:\Documents and Settings\xyz>netstat -m

    Displays protocol statistics and current TCP/IP network connections.

    NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]

    -a Displays all connections and listening ports.
    -b Displays the executable involved in creating each connection or
    listening port. In some cases well-known executables host
    multiple independent components, and in these cases the
    sequence of components involved in creating the connection
    or listening port is displayed. In this case the executable
    name is in [] at the bottom, on top is the component it called,
    and so forth until TCP/IP was reached. Note that this option
    can be time-consuming and will fail unless you have sufficient
    permissions.
    -e Displays Ethernet statistics. This may be combined with the -s
    option.
    -n Displays addresses and port numbers in numerical form.
    -o Displays the owning process ID associated with each connection.
    -p proto Shows connections for the protocol specified by proto; proto
    may be any of: TCP, UDP, TCPv6, or UDPv6. If used with the -s
    option to display per-protocol statistics, proto may be any of:
    IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
    -r Displays the routing table.
    -s Displays per-protocol statistics. By default, statistics are
    shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;
    the -p option may be used to specify a subset of the default.
    -v When used in conjunction with -b, will display sequence of
    components involved in creating the connection or listening
    port for all executables.
    interval Redisplays selected statistics, pausing interval seconds
    between each display. Press CTRL+C to stop redisplaying
    statistics. If omitted, netstat will print the current
    configuration information once.

    C:\Documents and Settings\xyz>netstat -r

    Route Table
    ===========================================================================
    Interface List
    0×1 ……………………… MS TCP Loopback interface
    0×2 …00 1c c4 20 9b 38 …… Realtek RTL8169/8110 Family Gigabit Ethernet NIC – Packet Scheduler Miniport
    ===========================================================================
    ===========================================================================
    Active Routes:
    Network Destination Netmask Gateway Interface Metric
    0.0.0.0 0.0.0.0 212.124.45.62 212.124.45.37 20
    127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
    212.124.45.32 255.255.255.224 212.124.45.37 212.124.45.37 20
    212.124.45.37 255.255.255.255 127.0.0.1 127.0.0.1 20
    212.124.45.255 255.255.255.255 212.124.45.37 212.124.45.37 20
    224.0.0.0 240.0.0.0 212.124.45.37 212.124.45.37 20
    255.255.255.255 255.255.255.255 212.124.45.37 212.124.45.37 1
    Default Gateway: 212.124.45.62
    ===========================================================================
    Persistent Routes:
    None

  6. JRM

    They wrote -r -n (-rn) you interpreted it as an m thus it did not work

    Cheers,
    JRM

  7. Lynne

    I got it connected by changing the Network address in the RJ-45 ( network card in windows )
    to 192.168.1.2 . . You get to it by right clicking on the network connection and go down to “Properties” then when it comes up click on “Configure” next to the ( brand of network connection ) and it opens another Item go to “Advanced” and in the “Network Address” add the above 192.168.1.2 Linux will have already made the connection from its end . . Its windows which has problems doing much of any networking and is the biggest Problem of computers
    Do you know I am able to do 2 X the speed of the speed on the windows computer going out the door via the RJ-45 connection and same fire wall ! Down load same file same web site in 1/2 the time in Linux . . 1 in Ubuntu Linux , 1 in windows XP Pro ! Explain that one ! Same USB720 Verizon Modem Linux hits 2.9 megs per and windows if its lucky gets 1.3 megs per . . WHY ?
    I heard they totally re-wrote the Stack in Vista and still slow ( LMAO )

  8. Ihatebloatware

    lol I thought it was an ‘m’ too!

    Routing info you can also get with the commands “ipconfig” (Windows) and “ifconfig” (Linux).

    Also in Linux try “iptables -L” to see the routing (and firewall) rules.

  9. mutilOSer

    Lynne, I get the same speed whether I use Windows XP, Windows Vista, Ubutu, or SLED. ~8Mb/s.

    That is the limit that my ISP has imposed on me because of my lack of desire to spend more money per month.

    I wonder if it might have something to do with the fact that you’re using a USB modem? USB and Windows never really got along well…

  10. mutilOSer

    Hmm, actually, you say RJ-45, but the modem you list is USB wireless only… I dunno.

  11. Iosif

    I tried it in Windows 7 / 64 bits, a small (DOS) screen appeared for a very short time, and than it disappeared. What should I do?

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!