Valhalla Legends Archive

Programming => General Programming => C/C++ Programming => Topic started by: tenbytes on October 19, 2004, 12:13 AM

Title: help finding real ip
Post by: tenbytes on October 19, 2004, 12:13 AM
How do I go about finding my  real ip address and not the ip of the computer on my network?
Title: Re: help finding real ip
Post by: Falcon[anti-yL] on October 19, 2004, 12:36 AM
www.whatismyip.com
Title: Re: help finding real ip
Post by: tenbytes on October 19, 2004, 12:56 AM
is there anything else that i don't have to parse?
Title: Re: help finding real ip
Post by: Yoni on October 19, 2004, 01:32 AM
Good question - unfortunately the answer is no. :(

There's no way to find out your external IP without consulting an external third party.
Title: Re: help finding real ip
Post by: Mephisto on October 19, 2004, 09:23 AM
You could always write a simple ASP.NET or PHP script that will record your IP and print it to a simple HTML page.  It's not really a conventional way to do things, or simple/easy rather, but it's an option if you don't want to go to another Website you don't know too much about, and rather just go to yours.
Title: Re: help finding real ip
Post by: Adron on October 19, 2004, 04:36 PM
Quote from: Yoni on October 19, 2004, 01:32 AM
Good question - unfortunately the answer is no. :(

There's no way to find out your external IP without consulting an external third party.

Now, what are the ways of finding this out? Perhaps sending a somehow bad packet out and looking at the icmp reply? You should be able to dig your own IP out of the returned part there?
Title: Re: help finding real ip
Post by: CrAzY on November 04, 2004, 02:56 PM
I'm guessing your on a router, Log into your router and you should be able to find it some where on there.  But it is much easier to just type "what is my IP" on google.  :)
Title: Re: help finding real ip
Post by: Newby on November 04, 2004, 05:17 PM
Quote from: CrAzY on November 04, 2004, 02:56 PM
I'm guessing your on a router, Log into your router and you should be able to find it some where on there.  But it is much easier to just type "what is my IP" on google.  :)
I'm assuming he means via code.
Title: Re: help finding real ip
Post by: UserLoser. on November 04, 2004, 05:56 PM
Quote from: Newby on November 04, 2004, 05:17 PM
I'm assuming he means via code.

Write some sort of bot that logs into your router and manages it's way from there? :P
Title: Re: help finding real ip
Post by: Banana fanna fo fanna on November 05, 2004, 11:26 PM
upnp
Title: Re: help finding real ip
Post by: R.a.B.B.i.T on November 06, 2004, 10:30 AM
Quote from: Yoni on October 19, 2004, 01:32 AM
Good question - unfortunately the answer is no. :(

There's no way to find out your external IP without consulting an external third party.
Couldn't you create 2 sockets and bind one, then have the other connect to the first, then grab the remote IP, or would that just return 127.0.0.1?
Title: Re: help finding real ip
Post by: Skywing on November 06, 2004, 10:51 AM
Quote from: R.a.B.B.i.T on November 06, 2004, 10:30 AM
Quote from: Yoni on October 19, 2004, 01:32 AM
Good question - unfortunately the answer is no. :(

There's no way to find out your external IP without consulting an external third party.
Couldn't you create 2 sockets and bind one, then have the other connect to the first, then grab the remote IP, or would that just return 127.0.0.1?
That wouldn't give you the external address if you're behind a NAT.
Title: Re: help finding real ip
Post by: Arta on November 06, 2004, 11:35 AM
Perhaps query network settings to get the IP of the default gateway?
Title: Re: help finding real ip
Post by: Adron on November 10, 2004, 11:40 AM
Quote from: R.a.B.B.i.T on November 06, 2004, 10:30 AM
Couldn't you create 2 sockets and bind one, then have the other connect to the first, then grab the remote IP, or would that just return 127.0.0.1?

What would you connect to? If you connect to 127.0.0.1, that's the IP you'll get back...