Network Routes: netstat



next up previous contents index
Next: Reading and Writing Up: Managing Networked Computing Previous: Network Interfaces: netstat

Network Routes: netstat

The -rn option on netstat shows the default routes for your network. Routes are the paths network traffic takes to contact a remote machine. To reach local machines on the same network as your machine, you do not need any extra routes. To reach the rest of the world, you need to define a default route which tells your machine to send all traffic not belonging to your network to this default router. You use netstat -rn to be sure you have the default route properly defined, and then ping the default router to be sure it is alive:     

$ netstat -rn   	Show default routes.   
Routing tables   	   
Destination   Gateway         Flags  Refs   Use  Interface   	   
127.0.0.1     127.0.0.1       UH        3      0 lo0   	   
default       127.29.13.100   UG        0      0 tok0   	   
127.29.136    127.29.13.99    U         2   1696 tok0   	  
$ ping 127.29.13.100   	We ping the default router.   
PING thomas.hal.com: (127.29.13.100): 56 data bytes   	   
64 bytes from 127.29.13.100: icmp_seq=0. time=3. ms   	   
64 bytes from 127.29.13.100: icmp_seq=1. time=3. ms   	   
64 bytes from 127.29.13.100: icmp_seq=2. time=4. ms   	   
[ctrl]-c   	User interrupts the program.   



next up previous contents index
Next: Reading and Writing Up: Managing Networked Computing Previous: Network Interfaces: netstat