I compiled ipset on CentOS5 32bit machine and i am getting weird errors

My kernel:

[root@localhost ipset-4.5]# uname -a
Linux localhost.localdomain 2.6.18-400.1.1.el5 #1 SMP Thu Dec 18 00:58:32 EST 2014 i686 i686 i386 GNU/Linux

ipset version:

[root@localhost ipset-4.5]# ipset -V
ipset v4.5, protocol version 4.
Kernel module protocol version 4.

Try to create hash.

[root@localhost ipset-4.5]# ipset --create test macipmap --network
ipset v4.5: Unknown set type

I check man example and trying here but no luck

[root@localhost ipset-4.5]# ipset -N test iphash --probes 2
ipset v4.5: Unknown set type

iptables rule:

[root@localhost ipset-4.5]# iptables -A INPUT -m set --set badips src -j DROP
iptables v1.3.5: Couldn't load match `set':/lib/iptables/libipt_set.so: cannot open shared object file: No such file or directory

iptables version:

[root@localhost ipset-4.5]# iptables -V
iptables v1.3.5

[root@localhost ipset-4.5]# rpm -qa | grep iptables

Found solution myself:

need to load ip_set_iphash.ko kernel module.

# insmod /lib/modules/2.6.18-400.1.1.el5/extra/ip_set_iphash.ko

iptables v1.3.5 has missing library libipt_set.so to fix it do following:

# wget http://ftp.neu.edu.cn/mirrors/CentALT/5/i386/iptables-1.3.5-5.6.1.el5.i386.rpm
# rpm2cpio iptables-1.3.5-5.6.1.el5.i386.rpm | cpio -idmv
# cp lib/iptables/libipt_set.so /lib/iptables/libipt_set.so

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.