From: Robert Hardy Subject: Re: Optimizing rule loading, iptables-1.3.0 and iptables-batch Date: Tue, 7 Sep 2004 21:30:41 -0400 (EDT) Sender: netfilter-devel-bounces@lists.netfilter.org Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: netfilter-devel@lists.netfilter.org Return-path: To: Henrik Nordstrom In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org On Tue, 7 Sep 2004, Henrik Nordstrom wrote: > On Tue, 7 Sep 2004, Robert Hardy wrote: >> iptables-restore still only allows you to save and restore whole tables. > > Not entirely true. There is the --noflush (-n) option to iptables-restore > which allows you to do any kinds of operations you please. > Load a user chain: > > iptables-restore --noflush << EOF > *filter > -F userchain > -A userchain ..... > COMMIT > EOF Ah Good! I obviously missed that somehow.... As a side note for the same ~30000 rules: Time to load rules via iptables-batch using CIDR syntax: 23 mins 13 secs Time to load rules via iptables-batch using IPRANGE syntax: 26 mins 36 secs Time to load rules via iptables-restore (originally using CIDR syntax): 4 mins 25 secs The time to process the rules set isn't linear with size. In general if you double a rule set it takes four times longer to load. At 30000 rules iptables-restore is still 5 times faster than iptables-batch. Regards, Rob -- ---------------------"Happiness is understanding."---------------------- Robert Hardy, B.Eng Computer Systems C.E.O. Webcon Inc. rhardy webcon ca GPG Key available (613) 276-7327