Open In App

How to Identify a HTTP Request is Sent by a Local Network Computer or by an Internet Client?

Last Updated : 21 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Answer: If it falls within private IP ranges e.g., 10.x.x.x, 172.16.x.x to 172.31.x.x, 192.168.x.x, it’s from a local network, otherwise, it’s from an internet client.

Capture the Client’s IP Address

When your server receives an HTTP request, it typically includes the client’s IP address in the request headers or the server’s access logs.

Analyze the IP Address

Check if the IP address falls within the private IP address ranges:

  • 10.0.0.0 to 10.255.255.255
  • 172.16.0.0 to 172.31.255.255
  • 192.168.0.0 to 192.168.255.255

These ranges are reserved for private networks and are not routable on the internet.

Determine the Source

If the IP address is within these ranges, the request is coming from a local network computer. If the IP address does not fall within these ranges, it is from an internet client.

Conclusion

Identify local versus external clients by comparing incoming IP addresses with private IP ranges to secure and analyze network traffic.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads