I think this may be a common problem that may not have an answer for every tool. Right now we are trying to use amazons Redshift. The only problem we have now is we are tryi
Try using between, listing the table with the target value second:
between
select * from table1 t1 join table2 t2 on t2.ip between t1.startip and t1.endip
And make sure there's an index on table2.ip.
table2.ip
It should perform pretty well.