Solved

How to check default router ip address?

Posted on 2011-03-10
6
415 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
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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

863 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

24 Experts available now in Live!

Get 1:1 Help Now