How to get my own IP
dsc at swcp.com
Mon Dec 30 22:08:01 EST 2002
On Monday, December 30, 2002, at 04:55 AM, Björnke von Gierke wrote:
> I was trying to get my IP for a little chat program I wrote, but with
> my code I always get the local IP of my subnet (192.168.1.2) To my
> understanding it is not possible to connect to me if the other Host
> does only know that IP. So is there a bug, is it because I coded this
> wrong, or is that IP sufficient? (www.yanku.net is the URL of a friend
> of mine)
Probably, none of those. The code and IP address are fine. You get
the IP address of your computer.
But that is probably not what you want.
I assume you want to provide an Internet service from your computer.
(This question has come up a few times.)
You seem to be behind a firewall (perhaps a router) and your Internet
packets are subject to Network Address Translation (NAT). There are
two common methods (and combinations). With masquerade NAT, all
computers for this service share the IP address of the firewall as
viewed from the outside. With fixed NAT, your computer will have a
fixed public address, one that is not the same as you get with your
If your case is the latter (fixed NAT), find out what that address is
and use that. If your case is the first, this takes a little more work.
Typically, a firewall can have a setting so that a service on an inside
computer can be exposed to the outside. The firewall typically listens
on a port for that service and then translates it to the port and
There are a few web sites that will probe back and get the IP address
your connection seems to be coming from and those might give you some
information that will help. (I'm on a new computer and don't have my
bookmarks moved over, but I think if you go to grc.com, click on
"Shields Up! and follow the directions you will get some information.)
More information about the Use-livecode