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
Solved

How to check default router ip address?

Posted on 2011-03-10
6
420 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

792 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