LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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: 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
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
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
kbp
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
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, 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:

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: 188

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration