How to find that an IP address is a LAN IP or WAN IP?
问题 How can I find that an IP address is a LAN IP address or WAN IP address? I am writing a C API in Windows.Thanks 回答1: Private IP addresses are usually set from the private IP address spaces : 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 If the interface's IP addresses falls into one of these spaces, you can assume it is a private IP . Otherwise, it is a public (WAN) IP . 回答2: Most likely, what you want to determine is whether the address is a global address, or a private address. The wikipedia