How do i change ipset maxelem?

Issues related to applications and software problems
Post Reply
postcd
Posts: 13
Joined: 2014/10/11 11:45:27

How do i change ipset maxelem?

Post by postcd » 2017/10/05 23:07:32

Hello,

i have CentOS release 6.6 (Final) and ipset v6.11, protocol version: 6

I have created ipset and its default maxelem is 65536 and i want to increase this value.

I tried: service ipset save
ipset: Saving IP sets to /etc/sysconfig/ipset: [ OK ]
sed -i "s|65536|999888|g" /etc/sysconfig/ipset

service ipset reload
ipset: Current ip*tables configuration requires ipset [WARNING]
ipset: Current ip*tables configuration requires ipset [WARNING]
ipset: Loading IP sets: ipset v6.11: Error in line 1: Set cannot be created: set with the same name already exists [FAILED]
I also tried: ipset save ...
and "ipset restore" failed:
ipset v6.11: Error in line 1: Set cannot be created: set with the same name already exists
Is there any way to change maxelem without removing iptables rule, saving set, replacing maxelem and restoring set?

User avatar
TrevorH
Forum Moderator
Posts: 23652
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How do i change ipset maxelem?

Post by TrevorH » 2017/10/05 23:50:24

Code: Select all

[root@host]# ipset create NEWSET hash:ip maxelem 131072
[root@host]# ipset -L NEWSET
Name: NEWSET
Type: hash:ip
Revision: 1
Header: family inet hashsize 1024 maxelem 131072
Size in memory: 16528
References: 0
Members:
ipset: Current ip*tables configuration requires ipset [WARNING]
You can't restart ipset while there are iptables rules that reference any ipsets. You have to stop iptables first. So service iptables stop;service ipset restart; service iptables start
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply