LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-08-2004, 02:12 PM   #1
otisthegbs
Member
 
Registered: May 2003
Location: Vancouver
Distribution: RH9
Posts: 100

Rep: Reputation: 15
Universal default gateway address resolution


Thats what I need! A universal default gateway address resolution.

Here's the scenario:

I'm building an embedded linux router off of an SBC, and I need a way of finding the gateway IP address of the internet connection. AKA the "default" gateway address. This is gotten easily by issuing the command "%route | grep default". At home mine comes up as "d-154-251-x-x" The numbers in between the dashes is the IP address of the gateway. At my fathers the command results in "24.82.x.x". It gives an actual IP!

Since different ISP's issue the gateway address via dhcp in different formats, as indicated above, I need to find a way of finding the IP address of the gateway. This has to be universal because I have a perl cgi script that displays the IP connection settings of my router on a web page.

How do I find the gateway IP address?

Oh, BTW: i tried to use traceroute, and it worked great, the problem is the firewall is very secure and when it's on it blocks traceroute from doing its job.
 
Old 07-08-2004, 02:48 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
Try using "route -n" this will use ips and not hostnames.
 
Old 07-09-2004, 02:28 AM   #3
otisthegbs
Member
 
Registered: May 2003
Location: Vancouver
Distribution: RH9
Posts: 100

Original Poster
Rep: Reputation: 15
THANK YOU DAVID!

I promise to read the --help before I post from now on! :P
 
  


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
How do I set the ip address for eth0, eth1 and the default gateway? abefroman SUSE / openSUSE 5 05-19-2005 04:15 AM
what is needed to have a universal address book? Lleb_KCir Linux - Software 3 08-02-2004 11:51 AM
Obtaining a default gateway IP address from a Win2K workstation Linh Programming 1 02-20-2004 02:55 AM
How do I get iptables to redirect my default gateway address? Paul Woodhouse Linux - Networking 3 11-11-2003 08:52 AM
odd default gateway address, uses addr ~.ip.~ whatzat? piratebiter Linux - Networking 0 09-07-2003 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:19 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