How to get a unique IP address of an incoming request

There are four people who use the same Wi-Fi connection, as defined below, the IP must be unique.
An IP address is a numeric label assigned to each device participating in a computer network that uses the Internet protocol for communication.

Q1. IS IT SO OR NOT?

For unambiguous identification, I tried:

request.remoteAddress 

But I get the same IP address for all four people.

Q2. WHY SHOULD I IDENTIFY THEM? (should I tell them to transfer some kind of token as a thing to uniquely identify them, but I would prefer a unique IP address)

+6
source share
6 answers

The correct phrase is that they all fall behind the NAT firewall - this:

This is the usual way to connect most Internet networks to your home / office networks for two reasons: it requires much less public Internet addresses, and also makes the network more secure, since avoiding public addresses for internal resources means that it’s less likely that you don’t You can configure the firewalls correctly.

The disadvantage is that IP addresses are by no means a unique identifier for users - this is what cookies are for.

+2
source

Perhaps these 4 people are connected from the same network. In this case, the ip address will be considered as the same IP address for external networks.

0
source

Requests sent from the router to a server outside this local network will have the same IP address. This is one of the reasons why session identifiers are useful. If you need an identifier that MUST be unique for each user, even if he is on the same local network, you will need session variables.

Take a look at this entry. Where is session.id in Play 2.0?

Essentially create your own unique identifier. (Code taken from SO reference position)

 // Generate a unique id String uuid=session("uuid"); if(uuid==null) { uuid=java.util.UUID.randomUUID().toString(); session("uuid", uuid); } 
0
source

All 4 users get access to the same Internet line. Thus, the Public IPAddress of all of them will be the same. If you have your own application, then at the first request that you make to your server, send the device identifier with the request. The device identifier in combination with the IP address should be quite unique if the device identifier on all devices is not the same (very rare). Another solution may be that you generate a unique identifier (JSessionID when creating a session on the server that can be used) on the first request to the server and send it in response. Then pass on a unique identifier for all subsequent requests.

If you use a mobile device’s web browser, you can create a session (the JsessionId cookie will be generated by the server). The mobile browser will take care of sending the jsessionid cookie with each request.

0
source

I am afraid there is no easy way to identify users, as they can always change the data that they send to you. That is why almost all web services require a login (their system or Facebook, Google, etc.). The problem, however, is that if someone registers a sufficient number of accounts, they may constantly ask you. To avoid this problem, you can regularly enter a Captcha check, even after registration.

In addition, not every user has a static IP meaning that can change IP every time they block (if you block by IP, if I understand the question correctly).

0
source

They all have unique IP addresses on their internal network (for example, 192.168.xx or another internal IP address), see http://en.wikipedia.org/wiki/Private_network and RFC1918 for details. They connect to the public Internet using a firewall / gateway that translates network addresses (see http://en.wikipedia.org/wiki/Network_address_translation for more details).

-2
source

Source: https://habr.com/ru/post/970439/


All Articles