Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-05-2012, 07:21 PM   #1
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Rep: Reputation: Disabled
need help with finding a router that I am connected to

Hi all

I have a quick question. I have a linux machine that is connected to a router.

I am trying to find out the ip of that router. I did ifconfig and got a whole bunch of IPs. But is there a way to know which of them is the ip of the router?

As for the distro of linux, it is some kind of corporate modified version of suse, not entirely sure.

Thanks everyone

below is my output, I have removed a few that's obviously not it, such as loopback and broadcast:

Proc_m1_s1# ifconfig
inet addr: Bcast: Mask:

inet addr: Bcast: Mask:

inet addr: Bcast: Mask:

inet addr: Mask:

inet addr: Mask:
Old 06-05-2012, 08:08 PM   #2
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Home-networking routers have outward facing IPs and inward facing IPs. Commercial routers just keep track of routes with a routing table. Addresses are given out by a DHCP server.
Old 06-05-2012, 08:20 PM   #3
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
The router will %99.9999 of the time be your default gateway, try
netstat -nr
ip route
Old 06-05-2012, 10:12 PM   #4
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,085
Blog Entries: 28

Rep: Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086Reputation: 6086
This site will give you your outward facing ip:

The router's local ip is most likely x.x.x.1 is by convention the gateway (router) address in a home network.

This is without a doubt the best online tutorial on subnetting I've ever read. Don't be fooled by the HTML 3 format. It's well-written, clear, and easy to read:

Last edited by frankbell; 06-05-2012 at 10:16 PM.
Old 06-12-2012, 10:31 AM   #5
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Original Poster
Rep: Reputation: Disabled
thanks guys

hey guys

thanks for all your help, the netstat -nr helped quite a bit.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding all IP addresses connected on LAN arnuld Linux - Networking 1 10-07-2009 07:40 AM
finding the connected computers in lan kaushiksolanki Linux - Networking 2 03-02-2009 01:30 AM
Wifi connected to router, ping to router ok, no webaccess. what is wrong? deepcore Linux - Wireless Networking 5 01-07-2008 02:59 AM
finding out which access point we are connected to socialjazz Programming 2 04-09-2007 08:34 AM
Limit connected items connected to my router andersh3 Linux - Newbie 1 03-16-2004 12:10 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration