Solved

How to check default router ip address?

Posted on 2011-03-10
6
417 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

777 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