Hello!
How to or What function can detect an ip is wan ip or lan ip in fwh/harbour ?
Best regards!
Shuming Wang
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Hello!
How to or What function can detect an ip is wan ip or lan ip in fwh/harbour ?
Best regards!
Shuming Wang
The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets (local networks):
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
Also, IP addresses in the range of 169.254.0.0 -169.254.255.255 are reserved for Automatic Private IP Addressing.
These IP's should not be used on the Internet.
If you know the above range of IP's, you can easily write a function to grab your system's IP and then compare whether the IP address of your system falls in any of the above given three IP ranges or not. If it belongs to the above given IP blocks, it is a private/LAN IP else it is a WAN IP.
Regards
Anser
If Mysql server running on windows , select substring_index(user(),_utf8'@',-1) returns windows computer name instead of ip.
While Mysql on linux, select substring_index(user(),_utf8'@',-1) returns ip, like 'myserver','001',...
Shuming Wang