Jump to content

Way to validate an ip?


dannyb785

Recommended Posts

Ok, so I have my client's site setup so that if the ip you are showing(whether spoofed or not) doesn't fit proper ip pattern(4 separate numbers either 2 or 3 digits separated by periods), it will redirect you somewhere else. My question is, since anyone can spoof their ip to be any of millions of ips that fit the pattern, is there a way I can check that the ip the user is giving me is a valid ip(that pertains to a valid computer). Because if I did an ip lookup of 111.111.11.11 I'm positive it'd give me no results.

 

So I'd like a way to check that the ip I am being shown is the real ip for a real computer and not just made up to fit the pattern

Link to comment
Share on other sites

What would be the point of spoofing an ip for an http transaction? For example, if I were able to make a request originating from, let's say, 192.168.1.1, I'll NEVER get the response. Pointless!

 

Also, why two or three digits? Surely, some public address out there has single digits in an octet. What are you trying to accomplish with the redirect?

 

 

Link to comment
Share on other sites

What would be the point of spoofing an ip for an http transaction? For example, if I were able to make a request originating from, let's say, 192.168.1.1, I'll NEVER get the response. Pointless!

 

Also, why two or three digits? Surely, some public address out there has single digits in an octet. What are you trying to accomplish with the redirect?

 

 

 

Why are you asking my why I want to do this? I have my reasons. If you don't have an answer, why even post?

 

edit: you did have a point with single digits. I adjusted my validator to allow single digits in the ip.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.