Solved

How to check default router ip address?

Posted on 2011-03-10
6
423 Views
Last Modified: 2012-06-27
Hello, I am using linux and I would like to get the router's ip address my computer is connected with. I am using Ubuntu. I see that default gateway is 0.0.0.0.. I know my box's ip address and subnet mask.. How can I get the router address? Thanks!
0
Comment
Question by:beer9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Accepted Solution

by:
Merlinsmaster earned 100 total points
ID: 35105797
Beer9,

Have a look in these to file paths

Network Interfaces   (Ip address, subnet mask, gateway

cat /etc/network/interfaces

Other network information outside your interfaces

/etc/resolv.conf


See if what you are looking for is found there!

Let us know how you make out?

Michael

0
 
LVL 12

Assisted Solution

by:upanwar
upanwar earned 100 total points
ID: 35105941
route -n is the command to get all the routes configured in your system. Here you will got your systems default route as well.


0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 100 total points
ID: 35106273
netstat -rn should show you your routing table which should show the default router ip
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 2

Assisted Solution

by:Saikapian_4739
Saikapian_4739 earned 100 total points
ID: 35106541
Well you have your answer in your question only. Default router is nothing but the Default gateway only. What is default gateway, its the fisrt gateway that your system passes through to go on a network and default router is the router that is the router that acts as Primary for your system or infact for all systems in your network.

In most cases Default Router and Default Gateway are configured on the same device how ever in some cases it is possible that they are different devices.

Looking at your query, 0..0.0.0 is not a valid Gateway address also.
0
 
LVL 3

Assisted Solution

by:Alberto Cortes
Alberto Cortes earned 100 total points
ID: 35113996
Answer:

There are two ways:
1. type the command netstat -rn, and look for the line with the flag UG. Column gateway should be your router.
2. Display the file /etc/sysconfig/network ,and look for the line GATEWAY=.
0
 

Author Closing Comment

by:beer9
ID: 35154365
Thank you! :-)
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question