Linux: How To Find the Default Gateway

Whether you’re troubleshooting network problems or trying to set up a VPN, knowing what address your computer has configured as the default gateway is always useful. Running a simple command from the terminal can give you this.


1. Open a terminal window.

2. Input the following command and hit Enter:

route -n

3. The address contained in the last line (with the UG flag) is the address for your default gateway.

 

About Rob Rogers

Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
View more articles by Rob Rogers

The Conversation

Follow the reactions below and share your own thoughts.

2 Responses to “Linux: How To Find the Default Gateway”

  1. February 15, 2010 at 5:59 am, ajit rai said:

    thank you

    pls add some more useful data.

    Reply

  2. July 27, 2011 at 7:45 pm, Calucop said:

    but if reboot the system. it loss default gateway 

    Reply

Leave a Reply

You may also like-

How to Solve Common Tomcat Problems in WindowsHow to Solve Common Tomcat Problems in WindowsEverything does not always go smoothly in development. Tomcat consists of a fantastic set of tools for developing in JSP, but issues can arise ... How to Play Xbox Live on a College Campus NetworkHow to Play Xbox Live on a College Campus NetworkI started college in the fall of 2010 with great anticipations of faster internet speeds for Xbox Live. However, it did not work because ...