Advertisement

05.21.2004 at 07:33AM PDT, ID: 20997692
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

How To Detect My Router's Public IP Address From Inside My Own Network

Tags: ip, router, my, address, how
Greetings All,

I have a web application that is installed at numerours remote locations (I know, not the best solution, its the way my boss wants it).  I have an install package that installs the web application for the user.  Anyway, when the web application is installed I want to detect the router's public ip address.  Anyone know of a quick and easy way to do this programmatically?  Preferably in VB.net or javacript.

Thanks,

CodeYankee
Start your free trial to view this solution
Question Stats
Zone: Web Development
Question Asked By: CodeYankee
Solution Provided By: vikram_1982
Participating Experts: 23
Solution Grade: A
Views: 1012
Translate:
Loading Advertisement...
05.21.2004 at 07:38AM PDT, ID: 11127109

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 07:48AM PDT, ID: 11127214

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 08:18AM PDT, ID: 11127546

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 08:45AM PDT, ID: 11127797

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 09:15AM PDT, ID: 11128052

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 09:25AM PDT, ID: 11128129

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 09:31AM PDT, ID: 11128180

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 09:40AM PDT, ID: 11128260

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 10:34AM PDT, ID: 11128670

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 10:36AM PDT, ID: 11128681

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 10:38AM PDT, ID: 11128695

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 10:43AM PDT, ID: 11128730

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 10:44AM PDT, ID: 11128733

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 10:45AM PDT, ID: 11128750

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 11:09AM PDT, ID: 11128929

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.21.2004 at 11:16AM PDT, ID: 11128980

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.22.2004 at 01:20AM PDT, ID: 11132296

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.25.2004 at 07:07PM PDT, ID: 11157872

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.02.2004 at 04:39PM PDT, ID: 11217846

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.03.2004 at 11:01AM PDT, ID: 11225400

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.10.2004 at 02:31AM PDT, ID: 11277521

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.14.2004 at 08:17AM PDT, ID: 11307296

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.15.2004 at 02:22PM PDT, ID: 11319534

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.18.2004 at 01:51AM PDT, ID: 11342438

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
06.18.2004 at 01:55AM PDT, ID: 11342450

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.19.2004 at 12:06PM PDT, ID: 11586380

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.20.2004 at 02:37PM PDT, ID: 11597743

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.21.2004 at 07:00AM PDT, ID: 11602641

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.27.2004 at 03:18PM PDT, ID: 11651610

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.27.2004 at 06:04PM PDT, ID: 11652436

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.07.2005 at 03:12AM PST, ID: 13243249

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.14.2005 at 09:36AM PST, ID: 13306287

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.11.2005 at 04:48AM PST, ID: 13516263

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.20.2005 at 05:04PM PST, ID: 13587968

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.18.2005 at 12:51PM PDT, ID: 13809681

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.18.2005 at 12:53PM PDT, ID: 13809706

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
07.25.2005 at 08:10PM PDT, ID: 14523678

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
09.29.2005 at 11:35AM PDT, ID: 14986527

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.03.2005 at 02:11PM PDT, ID: 15009955

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.10.2005 at 07:58PM PDT, ID: 15057387

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.21.2004 at 07:38AM PDT, ID: 11127109
yes, if its one of the linksys / home routers goto  http://192.168.1.1/ in your browser window, and type admin/admin as user/pass, then one the first page it will show the wan ip address.


if not,
What connect do you have?
what type fo router?
Static or dynamic ip?
 
05.21.2004 at 07:48AM PDT, ID: 11127214
Yes, that will work manually.  I am looking for a solution that allows it to be done programmatically.  For example, in VB.NET I could get my own ipaddress by calling System.Net.DNS.GetHostByAddress(), but this only gets me the ipaddress for the local machine.  I want the public IP Address for my router.

Any other ideas?
 
05.21.2004 at 08:18AM PDT, ID: 11127546
You can't get the public IP address of your router because you are not in the good side because only another computer out of your lan can see the router IP Address. There is two common solutions :

1/ By Program : Use a site lik http://www.whatismyip.com/ (ther are several sites like this one) to get an html file and parse it with a regular expression parser to get the IP Address

2/ By Program : if you can get the status page of your router, then get this html file and parse it with a regular expression parser to get the IP Address


I have a prototype program in CSharp of this, if you need it as example then let me known and I'll send it to you.
 
05.21.2004 at 08:45AM PDT, ID: 11127797
Well, assuming you have a web server out there that this stuff is downloaded from.  Why not just make a webpage on a remote server that responses out the REMOTE_ADDR Server Variable?  That way you don't have to parse out a ton of crap.
 
05.21.2004 at 09:15AM PDT, ID: 11128052
Ya, that was my solution.  My boss is a friggen idiot when it comes to web development.  He wants everything to remain at the remote location.  Any other ideas???
 
05.21.2004 at 09:25AM PDT, ID: 11128129
hmmmmmmmmm.........

I don't know how you can get the router's IP internally without having to code specifically for different routers.  I think you could pass a username and password to a linksys or similar router and get to the page that shows the external IP address, but damn what a pain in the ass...

Example on a linksys:  http://[router username]:[router password]@192.168.1.1/whatever-the-file-is-that-shows-the-ip.html

You'll still have to parse the output like Christian said using RegExp
 
05.21.2004 at 09:31AM PDT, ID: 11128180
Just a thought, not sure if it is viable though...

Is it not possible to do a trace-route (ping basically with a hop count of just 1). This should return the IP Address of the first wouter that it passes through. Should be easy to do in Java or C#.

This is from DOS..

D:\Documents and Settings\Vikram>ping -r 1 www.yahoo.com

Pinging www.yahoo.akadns.net [66.94.230.42] with 32 bytes of data:

Reply from 66.94.230.42: bytes=32 time=281ms TTL=47
    Route: 203.145.184.1

The "Route" is the id of my external router in this case..
Try to do this programatically..

Vikram
Accepted Solution
 
05.21.2004 at 09:40AM PDT, ID: 11128260
One problem I can see with this is in the instance where the router is behind another router behind another router, etc.

Big companies have this kind of situation sometimes.
 
05.21.2004 at 10:34AM PDT, ID: 11128670
A Router behind a router, behind another in the same network???  This is the first time i am hearing of such a thing..

Why will such a setup be necessary? I am not sure. I have knowledge of switches and bridges and hubs being used behind routers to increase the capacity, but a router behind another router is something i need to look into.

Still, i would reckon that if this is the case, you would never know. How can u determine how many routers there are between the external router of the network and the router to which a particular system is connected to.

Maybe.. u can incrementally perform this ping operation until a time you dont get a 192.168.0.0/24 address.

I guess you can understand what i am trying to say....

Vikram.
 
05.21.2004 at 10:36AM PDT, ID: 11128681
Don't question it...  Just go with it.  The point is people do stupid things and he has to work with it.  Haha
 
05.21.2004 at 10:38AM PDT, ID: 11128695
>>> I have a web application that is installed at numerours remote locations <<<

I believe that you are storing the web application in the web server. I can almost guarantee you that the web server will be behind a single router of the network. If it behind a router, behind another, then the web server would get a local LAN IP Address and it will not be accessible by the outside world. So, i would say it is a safe bet to go ahead with the ping program.

Vikram
 
05.21.2004 at 10:43AM PDT, ID: 11128730
Anyways.. Let us not be banging our heads about something hypothetical as of now.. Let us see if the author of this thread really has this requierement or not..

:)

Vikkki
 
05.21.2004 at 10:44AM PDT, ID: 11128733
Vikram,

I like your solution.  I am going to test it out.  Unless anybody comes up with something better, you get the points.  Give me a day to test this out first.
 
05.21.2004 at 10:45AM PDT, ID: 11128750
Sure man...

Vikkki
 
05.21.2004 at 11:09AM PDT, ID: 11128929