Detecting IP adress of PC behind a Internet-Sharing gateway 
Author Message
 Detecting IP adress of PC behind a Internet-Sharing gateway

Hi,

How do I detect the IP of an machine that is in a Windows Internet
Sharing network?  I tried this:

if (getenv(HTTP_X_FORWARDED_FOR))
        $ip=getenv(HTTP_X_FORWARDED_FOR); // in case of proxy
else
        $ip=getenv(REMOTE_ADDR);

But the IP I get is from the gateway machine, not from the client.

Any workaround?



Fri, 28 Jan 2005 09:48:31 GMT  
 Detecting IP adress of PC behind a Internet-Sharing gateway
Hello,


Quote:
> How do I detect the IP of an machine that is in a Windows Internet
> Sharing network?  I tried this:

> if (getenv(HTTP_X_FORWARDED_FOR))
>    $ip=getenv(HTTP_X_FORWARDED_FOR); // in case of proxy
> else
>    $ip=getenv(REMOTE_ADDR);

> But the IP I get is from the gateway machine, not from the client.

> Any workaround?

That seems to be intentional. Why would you want to have the address of
a machine in a private network anyway? Are you sure you are not trying
to solve a problem with the wrong solution?

--

Regards,
Manuel Lemos



Fri, 28 Jan 2005 10:41:50 GMT  
 Detecting IP adress of PC behind a Internet-Sharing gateway

Quote:

> Hi,

> How do I detect the IP of an machine that is in a Windows Internet
> Sharing network?  I tried this:

> if (getenv(HTTP_X_FORWARDED_FOR))
> $ip=getenv(HTTP_X_FORWARDED_FOR); // in case of proxy
> else
> $ip=getenv(REMOTE_ADDR);

> But the IP I get is from the gateway machine, not from the client.

> Any workaround?

As has been said, any addresses you end up with are most likely going to be
RFC 1918 (eh 10.*, 192.168.* or 172.*) and therefore not much use to you.
The whole point of NAT is that the outside world only sees the external (ie
gateway) address.
You would need some kind of client-side code to get the actual IP of the
machine, and then you need to pass this back to your PHP script.

Eto.



Fri, 28 Jan 2005 21:18:27 GMT  
 Detecting IP adress of PC behind a Internet-Sharing gateway

Quote:

> The whole point of NAT is that the outside world only sees the external (ie
> gateway) address.

or be able to "share" your internet thru your home network when your
provider only give you 1 ip address...

--
Danny



Fri, 28 Jan 2005 22:06:14 GMT  
 Detecting IP adress of PC behind a Internet-Sharing gateway
its a mother{*filter*}in way !
sometimes it can be run...
but the reality seems to show another content :(

there will exists some other ways ~ but they are not legal in front of
using !



Quote:


> > Hi,

> > How do I detect the IP of an machine that is in a Windows Internet
> > Sharing network?  I tried this:

> > if (getenv(HTTP_X_FORWARDED_FOR))
> > $ip=getenv(HTTP_X_FORWARDED_FOR); // in case of proxy
> > else
> > $ip=getenv(REMOTE_ADDR);

> > But the IP I get is from the gateway machine, not from the client.

> > Any workaround?

> As has been said, any addresses you end up with are most likely going to
be
> RFC 1918 (eh 10.*, 192.168.* or 172.*) and therefore not much use to you.
> The whole point of NAT is that the outside world only sees the external
(ie
> gateway) address.
> You would need some kind of client-side code to get the actual IP of the
> machine, and then you need to pass this back to your PHP script.

> Eto.



Sat, 29 Jan 2005 00:18:11 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Ip-Adress

2. IP adress

3. Using a Printserver vai IP-Adress

4. resolving IP adresses

5. need a script to set IP-Adress an machine name

6. IP-adress

7. Getting the external IP (behind a router)

8. Get local ip behind a router

9. Adress of Digitalk on Internet ???

10. API to access IP Gateway address ??

11. CLIENT (Windows 3.1 or 95 or NT) to MVS-CICS via TCP/IP or other gateway

12. ParcPlace internet adress?

 

 
Powered by phpBB® Forum Software