S
S
Spym2011-12-01 13:58:59
Computer networks
Spym, 2011-12-01 13:58:59

Get address of client connected via NAT by socket descriptor?

There is a client, there is a server on the Internet; the client connects to the server from the local network through NAT.
More precisely, through several NATs:
192.168.3.x (this is the client) ->192.168.3.1 -> 192.168.2.1 -> 192.168.1.1 -> (ISP) -> server
Problem: the server does a getpeername(..) and gets the address client 192.168.1.1; you need its external Internet address (for geolocation).
What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
YourChief, 2011-12-01
@YourChief

nothing. nat because and nat that hides addresses. you can only ask the client for its address at the application level if it is provided in the protocol/application

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question