Solved

How to check default router ip address?

Posted on 2011-03-10
6
413 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
6 Comments
 
LVL 3

Accepted Solution

by:
Merlinsmaster earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
netstat -rn should show you your routing table which should show the default router ip
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Assisted Solution

by:Saikapian_4739
Saikapian_4739 earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you! :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now