LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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
Davy

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

Proc_m1_s1# ifconfig
eth0
inet addr:172.16.8.129 Bcast:172.16.255.255 Mask:255.255.248.0

eth1
inet addr:172.16.0.129 Bcast:172.16.255.255 Mask:255.255.248.0


eth2
inet addr:10.118.118.88 Bcast:10.255.255.255 Mask:255.255.255.128


tipct0
inet addr:172.16.32.129 Mask:255.255.248.0

tipct1
inet addr:172.16.39.254 Mask:255.255.248.0
 
Old 06-05-2012, 08:08 PM   #2
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 257Reputation: 257Reputation: 257
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
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
The router will %99.9999 of the time be your default gateway, try
Code:
netstat -nr
or
Code:
ip route
 
Old 06-05-2012, 10:12 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,342
Blog Entries: 12

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

http://www.whatismyip.com/

The router's local ip is most likely 172.16.0.1. 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: http://www.ralphb.net/IPSubnet/index.html

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

Original Poster
Rep: Reputation: Disabled
thanks guys

hey guys

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

Thanks
 
  


Reply


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


All times are GMT -5. The time now is 06:51 AM.

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