Route

netstat -r

or

sudo route

justin@Justin:~$ sudo route
[sudo] password for justin:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     1      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

routing table

Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 1 0 0 eth0 default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0

Metric The 'distance' to the target (usually counted in hops). It is not used by recent kernels, but may be needed by routing daemons. Flags Possible flags include U (route is up) H (target is a host) G (use gateway) R (reinstate route for dynamic routing) D (dynamically installed by daemon or redirect) M (modified from routing daemon or redirect) A (installed by addrconf) C (cache entry) ! (reject route)

justin@Justin:~/doc/network$ traceroute www.sohu.com
traceroute to www.sohu.com (183.60.194.10), 30 hops max, 60 byte packets
 1  192.168.0.1 (192.168.0.1)  92.057 ms  91.494 ms  91.370 ms
 2  114.240.80.1 (114.240.80.1)  91.260 ms  91.157 ms  126.372 ms
 3  61.148.44.1 (61.148.44.1)  126.150 ms  32.863 ms  34.669 ms
 4  61.148.154.241 (61.148.154.241)  35.818 ms * *
 5  61.148.154.17 (61.148.154.17)  38.797 ms *  62.849 ms
 6  * * *
 7  219.158.11.66 (219.158.11.66)  104.166 ms  116.188 ms *
 8  202.97.15.29 (202.97.15.29)  136.969 ms  179.630 ms *
 9  202.97.46.21 (202.97.46.21)  179.360 ms  179.217 ms  179.082 ms
10  113.98.166.1 (113.98.166.1)  178.982 ms *  176.783 ms
11  * * *
12  113.98.159.38 (113.98.159.38)  198.758 ms  198.650 ms  198.542 ms
13  * * *
14  59.39.57.234 (59.39.57.234)  142.275 ms * *
15  183.60.194.122 (183.60.194.122)  144.580 ms *  148.963 ms
16  183.60.194.10 (183.60.194.10)  154.218 ms * *
justin@Justin:~/doc/network$ sudo ifconfig -a
[sudo] password for justin:
eth0      Link encap:Ethernet  HWaddr 00:0c:29:7f:16:b5
          inet addr:192.168.0.170  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe7f:16b5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8095 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7537 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7967502 (7.5 MiB)  TX bytes:1031985 (1007.7 KiB)
          Interrupt:18 Base address:0x10a4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)

pan0      Link encap:Ethernet  HWaddr de:e4:48:33:6f:bb
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

justin@Justin:~/doc/network$ netstat -in
Kernel Interface table
Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0       1500 0      8142      0      0 0          7576      0      0      0 BMRU
lo        16436 0         8      0      0 0             8      0      0      0 LRU
Wiki comments powered by Disqus