Linux: How To Find the Default Gateway

Contributor Icon Contributed by Rob Rogers  
Tag Icon Tagged: Linux networking  

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.

 

2 Comments -


  1. ajit rai said on February 15, 2010

    thank you

    pls add some more useful data.

  2. Calucop said on July 27, 2011

    but if reboot the system. it loss default gateway 

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -