I need to know the public IP (aka ISP's IP) of a client when it connects to my server. I tried learn-address
script but it does not provide real IP.
Currently it is possible to get it from OpenVPN log files, (pattern: MULTI: Learn: 10.2.1.5 -> client-5/27.147.X.Y:34244
).
The server runs a heavily busy Asterisk PBX. So it is inefficient to parse logs frequently (it become worse when log file gets huge in size).
Whenever a client connects/re-connects from a different IP, I need to update the database. I need an easy solution for it.
Presisely, I need the mapping of inner ip to outer ip of the OpenVPN tunnel.
N.B. I use staticly assigned IP addresses (e.g. 10.2.1.5 for common name client-5) from CCD files (exclusive ccd) in tun
mode.