Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-05-2007, 10:06 AM
|
#1
|
|
Member
Registered: Mar 2006
Posts: 182
Rep:
|
how to find out the gateways IP?
Hi!
ifconfig doesn't list the gateway's IP? How can I found out gateways IP? Thank you!
|
|
|
|
02-05-2007, 10:31 AM
|
#2
|
|
Senior Member
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
|
use the route command Or go to a website like
http://whatismyip.com
or use tracepath
Code:
tracepath google.com
Last edited by Micro420; 02-05-2007 at 10:33 AM.
|
|
|
|
02-05-2007, 01:12 PM
|
#3
|
|
Senior Member
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
|
Will show your gateways for any configured routes (including the default route). This assumes that have already configured your gateway correctly or received it from DHCP.
If you're asking "how do I find out what my gateway should be" then you need to ask your network administrator. There's no way to find out what you should set it to if it's not already set and/or cannot be discovered with DHCP.
|
|
|
|
02-05-2007, 02:37 PM
|
#4
|
|
Member
Registered: Mar 2006
Posts: 182
Original Poster
Rep:
|
Thanks! it's working!
Quote:
|
Originally Posted by chort
If you're asking "how do I find out what my gateway should be" then you need to ask your network administrator. There's no way to find out what you should set it to if it's not already set and/or cannot be discovered with DHCP.
|
No, I just wanted to find out the existing one. Thanks!
|
|
|
|
02-05-2007, 06:45 PM
|
#5
|
|
Senior Member
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
|
Quote:
|
Originally Posted by Shioni
Thanks! it's working!
No, I just wanted to find out the existing one. Thanks!
|
Well in case it wasn't obvious, you can find that out with netstat. Here's an example from my network:
Code:
chort@twdemos:~> netstat -ran
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.22.2.0 0.0.0.0 255.255.255.128 U 0 0 0 eth0
172.16.38.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
192.168.134.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.22.2.1 0.0.0.0 UG 0 0 0 eth0
The last line above that starts 0.0.0.0 is the "default route", i.e. your "gateway" for all traffic that hasn't been specifically routed otherwise. The second column shows the gateway IP (in this case it's 172.22.2.1).
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Two gateways?
|
candyman123 |
Linux - Networking |
1 |
09-08-2005 12:36 PM |
|
Multiple Gateways
|
inforlinx |
Linux - Networking |
1 |
02-22-2005 08:28 PM |
|
Gateways
|
Esmo2000 |
Linux - Networking |
1 |
01-03-2005 02:49 PM |
|
2 Gateways
|
Equis |
Linux - Networking |
1 |
11-15-2003 03:58 AM |
|
2 Gateways
|
def1014 |
Linux - Networking |
3 |
10-24-2002 05:21 PM |
All times are GMT -5. The time now is 12:45 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|