Skip to content

Instantly share code, notes, and snippets.

@Vaduz
Created November 23, 2013 05:50
Show Gist options
  • Save Vaduz/7611302 to your computer and use it in GitHub Desktop.
Save Vaduz/7611302 to your computer and use it in GitHub Desktop.
Private IP detection
['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16'].any? {|range| IPAddr.new(range).include?(ip)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment