joken-前端工程师

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: :: :: 管理 ::
ipset create chinaip hash:ip maxelem 1000000

 for ip in $(cat './ip.txt'); do
      ipset add chinaip $ip
 done

如上面会导致提示 ipset hash is full

这是因为hash:ip 只能存储固定ip,这样如果你录入的大量的ip段,那么ipset解析的时固定的一堆大量的ip,无法存储很多的大量固定ip,所以会报ipset hash is full

 

解决方法是

ipset create chinaip hash:net maxelem 1000000

 for ip in $(cat './ip.txt'); do
      ipset add chinaip $ip
 done

改成hash:net ,这样才能存储ip段,实现ip段的录入,而不会溢出存储空间,导致报错ipset hash is full

posted on 2018-07-12 21:26  joken1310  阅读(925)  评论(0编辑  收藏  举报