<% content_for :title, "IP Address Lookup" %>

IP Address Lookup

Lookup IP addresses to find matching network ranges and intelligence

<%= form_with url: lookup_network_ranges_path, method: :get, local: true, class: "space-y-4" do |form| %>
<%= form.label :ip_address, "IP Address", class: "block text-sm font-medium text-gray-700" %>
<%= form.text_field :ip, value: params[:ip], placeholder: "Enter IP address (e.g., 8.8.8.8)", class: "flex-1 min-w-0 block w-full rounded-none rounded-l-md border-gray-300 focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %> <%= form.submit "Lookup", class: "-ml-px relative inline-flex items-center px-4 py-2 border border-transparent rounded-r-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700" %>
<% end %>
<% if params[:ip].present? && @ranges %>

IP Intelligence: <%= params[:ip] %>

Matching Network Ranges

<% if @ranges.any? %>
<% @ranges.each do |range| %>
<%= link_to range.cidr, network_range_path(range), class: "text-sm font-medium text-blue-600 hover:text-blue-900" %> Priority: <%= range[:specificity] %>
<% intel = range[:intelligence] %>
<% if intel[:company] %>
Company: <%= intel[:company] %>
<% end %> <% if intel[:asn] %>
ASN: <%= intel[:asn] %> (<%= intel[:asn_org] %>)
<% end %> <% if intel[:country] %>
Country: <%= intel[:country] %>
<% end %>
<% if intel[:is_datacenter] %> DC <% end %> <% if intel[:is_vpn] %> VPN <% end %> <% if intel[:is_proxy] %> Proxy <% end %> <% if intel[:inherited] %> Inherited <% end %>
<% end %>
<% else %>

No network ranges found for this IP address.

<% end %>

Suggested Block Ranges

<% if @suggested_blocks.any? %>
<% @suggested_blocks.each do |suggestion| %>
<%= suggestion[:cidr] %>
<%= suggestion[:description] %>
<% if suggestion[:current_block] %> Already Blocked <% else %> <%= link_to "Block Range", new_rule_path(cidr: suggestion[:cidr]), class: "inline-flex items-center px-3 py-1 border border-transparent text-xs font-medium rounded text-white bg-red-600 hover:bg-red-700" %> <% end %>
<% end %>
<% else %>

No suggestions available.

<% end %>
<% end %>

Quick Lookup

Enter any IP address to instantly find matching network ranges

Network Intelligence

View company, ASN, country, and classification data

Create Rules

Block ranges or create surgical exceptions instantly