Hi,
Thanks for the tip, I should have think using 'env' way before.
There's indeed two variables which stores the OpenVPN server IP :
trusted_ip (or trusted_ip6) :
Actual IP address of connecting client or peer which has been authenticated. Set prior to execution of --ipchange, --client-connect, and --client-disconnect scripts. If using ipv6 endpoints (udp6, tcp6), trusted_ip6 will be set instead.
untrusted_ip (or untrusted_ip6)
Actual IP address of connecting client or peer which has not been authenticated yet. Sometimes used to nmap the connecting host in a --tls-verify script to ensure it is firewalled properly. Set prior to execution of --tls-verify and --auth-user-pass-verify scripts. If using ipv6 endpoints (udp6, tcp6), untrusted_ip6 will be set instead.
I'm ok to use those variables, but I don't understand the meaning of the man page for those variables. What I understand is that those variables are filled with the IP of the "client" not the server. It may be true if you are on the server side but apparently, it's exactly the opposite when you are on the client side : it's the public IP of the server.
Am I right ?