Hello. I am trying to watch at an IP address and i cant. There is something i do not have very clear. I will explain a little more:

I wanna create a program to see at IP addresses of machines. I can do it, and i have already done it, but when i see at the IP address of my machine in a network we have with some friends only appears the IP of the network. So, when we want to access our machines we cant because the internal IP of our network is not recognized when we are out of the network.

For example, the IP address of my machine is: And when i wanna access from my other computer (not in the net) it is not recognized. For example (and of course) i ping and the results are: "destination host unreachable" or equivalent.

So, my question is: If i can access the Internet from my computer in the network, why then I cannot access it from another computer? Does it have another IP? Maybe in the server? How can i code a program to read both IP? To read it from the server? I would appreciate a lot your help, we really need to know this.

Thanks in advance and sorry for my poor english, and for being a newbie in networking.

Thanks again.
Posted on 2001-12-01 13:20:22 by CodeLover
There is a difference between both directions. When accessing the internet from the local network, the gateway (or router) takes your internal IP, changes it to the external internet IP and sends the packet to the internet.. When a package returns, this package gets the right local IP again and is sent to the right local machine.. In this case, many local machines use the same external IP.
However when doing the opposite, connecting from the internet to a computer in some local network, the connecting computer only knows one IP (the internet IP of that network). The router can never know which local machine to forward it to.
For the outside world, your local network seems like one computer with one IP. This is no problem when connecting *to* the outside world (the internet), but it is when connecting to your local network. As it's seen as one computer, the router doesn't know which local PC it needs to forward the package to.
The solution is using port mappings, which are set in the router. This tells the router to forward all packages on a specific port to a specific computer in the local network.
There are several ways to determine the external IP of a local network. One is sending a simple HTTP request to some external website that returns the requesting IP as the response. This IP will be the external IP. If your gateway has a socks proxy, I think you can ask the proxy for the external IP.

I hope this helps, feel free to ask more / other things,

Posted on 2001-12-01 16:34:56 by Thomas
Thanks Thomas. I will try it.
Unfortunately i do not have access to the computers of the net in this moment, but tomorrow i will see if i can do something.
Thanks again by your help, i will post my advances.

Why below your name says Code Warrior? I think you should have something else.


Posted on 2001-12-01 17:35:13 by CodeLover
just ask the one who made/setup the network or the admin about this, trust me, you'd pretty much get your answers right away and it would save you alot of time and trouble :). just hope he's/she's not the BOFH type, hehe.

Posted on 2001-12-02 02:22:27 by clip

Any IP that starts with those numbers is a "Private-Block" IP address and as such is not visible from the Internet.

There are some others, but back to the issue at hand.
Your network (a local-area network, or LAN) is connected to the Internet via one (generally) machine which has TWO NETWORK CARDS !!! (When I say CARD, I refer to the Network Interface Card which could be a real netcard or could be part of a modem, etc ... so there may be one netcard on the LAN and one inside a modem for example) Each card has its own IP, and so that machine (your "gateway" machine) has TWO IP's

One IP is in the Private Block (192.168.blah.blah)
and the other is the externally-visible IP which you seek...
You still have the problem of getting your internet connections to jump from the LAN networkcard to the one thats actually on the Net, and I would bet my boots that you are running a proxy-server on that machine which does exactly that.
It's job is to take connections from the LAN and pass them to the Net, and also to take replies from the Net and pass them to the LAN, so there is your problem and its solution. If you do not have access to the proxy software running on the true internet-connected gateway machine, you don't have much power to decide what can and cannot travel between the Net and the LAN.
Posted on 2001-12-03 02:31:43 by Homer
However my solution was not very elegant.

What I did was accesing from my "net machine"(using FTP port) my "home machine", so then i read the log files and there appears the external IP of the net.

Inclusively, in this moment, i am downloading a file from the server.

Thanks guys!!
Posted on 2001-12-03 18:52:08 by CodeLover
Accessing private/Class C IP's from outside the LAN/WAN is impractical unless you want to share files over the internet (vpn in windows i think) or use internet sharing software... in those cases, just route specific ports (i.e. 21, 80, 8080, 137, 138, 139) to the different machines and then have some sort of dns translation service like www.cjb.net so the computer can be seen without direct IP translation. IP's get a little tricky when using Windows. I use Mandrake-Linux 8.1 and the FREE firewall software acts as a masquerade (automatic internal->external/external->internal IP translation), firewall, and router :grin:
Posted on 2001-12-07 14:03:08 by SpooK
That solution will not work, because even network address translation services require an externally-visible ip address to redirect traffic towards...

The traffic will still be redirected to the externally-visible "gateway" address for the LAN(public ip), and then you STILL require software to proxy the socket connections between it and any other machines on the LAN (private ip)
Posted on 2001-12-08 02:47:49 by Homer