Friday, May 15, 2009

Determine your default gateway in Linux

Need to find out what your default gateway address is in Linux? Using the route program you can manipulate your Linux computer's internal routing tables and print out the current settings. Use this command to see your default gateway:
route -n
This will print out several columns of information. The second column should have a heading that reads "Gateway." The bottom entry in that column is the default gateway. If you leave the -r option off of the the route command it will assign applicable host names to those addresses that it can.

This is just one function of the route program. Check out the manual pages for more details of what you can do with route.

No comments:

Post a Comment