Page 1 of 2

Users IP Addressez

Posted: Wed Feb 01, 2006 3:59 am
by khaki_monster
helo pepz!

simple question("i guess"). how do i know if an IP address of Location A("192.168.0.1") is
different from an IP of Location B("192.168.0.1")?

cheerz!

Posted: Wed Feb 01, 2006 4:01 am
by feyd
you don't.

Posted: Wed Feb 01, 2006 4:32 am
by m3mn0n
Can you maybe elaborate a bit more?

Posted: Wed Feb 01, 2006 4:52 am
by duk
he have two diferent networks accessing the same internal page...

now what can i think is, if you have a login system, set a cookie with information from the diferent networks, and then you can catch in the cookies the information you need...

Posted: Wed Feb 01, 2006 5:01 am
by duk
you can try to see

http://uk.php.net/gethostbyaddr

you can see other functions as:

http://uk.php.net/manual/en/ref.network.php

$_SERVER['REMOTE_HOST'] -> could help you to to identify dirent names in ip addres's

Posted: Wed Feb 01, 2006 6:03 am
by khaki_monster
im actually thinking of making an IP blocker for my shoutbox, and im concern of
maybe im banning or blocking a wrong visitors because of having same IP's
though they belong from different Location A and B.

sorry... bout question. i know it kind'a confusing... my english grammar kind'a
limited :)

thanx for the responsez.

cheerz!

Posted: Wed Feb 01, 2006 3:29 pm
by nickman013
I dont think it is possible to have the same IP address.

Posted: Wed Feb 01, 2006 4:00 pm
by Roja
nickman013 wrote:I dont think it is possible to have the same IP address.
It is both possible, and common. AOL users, proxy visitors (think of corporate workers going through a proxy from work), kids in schools, various national proxies (Romania and Estonia both have ISP's with proxies that put all users behind one IP)...

The list goes on. I'm excluding people spoofing, dns attacks, and other more malicious approaches that also allow it to occur.

IP addresses are not in any way reliably related to a person.

Posted: Wed Feb 01, 2006 4:31 pm
by nickman013
Oh yeah, the people on the same network have the same IP. I thought you meant like totally different people, not in the same network.

Posted: Wed Feb 01, 2006 7:30 pm
by khaki_monster
is the IP address of network "A" is different from network "B"? though they have same IP's as 192.168.0.1

Posted: Wed Feb 01, 2006 9:06 pm
by nickman013
well, yeah the have the same external. That ip is called internal ip, meaning it is behind some sort of router.

Posted: Wed Feb 01, 2006 9:40 pm
by josh
Actually that's misleading. No two machines can have the same IP address assigned to them at the same time, but multiple machines can be behind a router, or switch thus exposing themselves as the router / switch's IP address. The two machines have different IPs but are visiting you from the same IP, just like two different users using the same proxy are both going through the proxy's IP address. Your only reliable way is setting a session cookie, use PHP's built in session management and just store any info that needs to be associated with each unique user in their session. The users could still trick your system into thinking they are one person but they would have to deliberately do so, not sure if this is what you're after.

Posted: Thu Feb 02, 2006 2:58 am
by duk
i think if you play with get-host-by-addr first you can identify proxys.. if there is a private IP, you can identify the hostname that in most cases they are diferent, because in a internal network, it cant be two machines with the same name with the same internal ip even if they are separated by a switch...

if that happens, the router ddon't know who is who...

is a good way yo start!!

Posted: Thu Feb 02, 2006 3:38 am
by khaki_monster
tanx for the contribution guyz. though im still a bit in confusion. anyway il try to update
with this subject sooner.

cheerz!

Posted: Thu Feb 02, 2006 5:59 am
by Jenk
A quick diag for what khaki means:

Code: Select all

server --------- Router/Gateway A (ip=234.32.1.89)--------- User A (ip=192.168.2.1)
    |
     ----------- Router/Gateway B (ip=86.56.34.12)--------- User B (ip=192.168.2.1)
at least, that's my interpretation..