Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Determine my IP as seen from outside world

Posted on 2011-03-18
7
Medium Priority
?
621 Views
Last Modified: 2012-06-27
www.ipchicken.com shows my IP address which is dynamic, so I use ipchicken to check it sometimes.  I want to, from a C++ program, determine the same IP address as ipchicken does.
How can I do this?  
0
Comment
Question by:tullhead
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35170316
Servers can tell your external IP address from the TCP/IP network connections because the 'source' address is part the process and the server has to know where to send the web page back to.  If you are behind a DSL or cable modem, that IP address doesn't exist on your internal network.  If you have access to the modem admin pages, you may be able to find out what it's external IP address is.  Otherwise, your C++ program would have to connect to an outside source to get that information.
0
 
LVL 3

Accepted Solution

by:
jerbear1337 earned 1000 total points
ID: 35170758
My first quick answer is use c++ to do some sort of website grep of whatismyip.com or something similar and then parse the html for you ip address.
0
 
LVL 3

Expert Comment

by:jerbear1337
ID: 35170796
0
Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

 
LVL 1

Expert Comment

by:amulheirn
ID: 35172090
Alternatively (since the external website might change, and that could stop your grep thingy working) you might be able to set up SNMP on your router, and do an SNMP get of the variable that holds the dynamic IP address maybe?  

I guess it depends on the router and whether it is advanced enough to run an SNMP stack though.
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 1000 total points
ID: 35173861
You can use wget and whatismyip:

    wget www.whatismyip.com/automation/n09230945.asp -O myaddress

The file myaddress will have your address as seen by the outside world.  Or you could write your own C"" code to get the same URL (www.whatismyip.com/automation/n09230945.asp)  and process the response.
0
 

Author Closing Comment

by:tullhead
ID: 35200864
I'm a little worried to build the url

www.whatismyip.com/automation/n09230945.asp

into my application.  There is probably no guarantee that this url will remain stable over the years.....

I have my own server on the net, under my control, could I put some little app there to do whatever it is that whatsmyip is doing?  Then I would control....
0
 
LVL 57

Expert Comment

by:giltjr
ID: 35201835
--> I'm a little worried to build the url

I would not worry about it.

If you go to www.whatismyip.com and look at the page source they have a comment in there telling you to go there.

So they are documenting this as a usable feature.
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question