From owner-freebsd-net@FreeBSD.ORG Tue Dec 23 14:51:40 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C79AAA6F for ; Tue, 23 Dec 2014 14:51:40 +0000 (UTC) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F41766ACA for ; Tue, 23 Dec 2014 14:51:39 +0000 (UTC) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.14.9/8.14.9) with ESMTP id sBNEV2IK033841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 23 Dec 2014 15:31:07 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: freebsd-net@freebsd.org Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.14.9/8.14.9) with ESMTP id sBNEUtSu015330; Tue, 23 Dec 2014 21:30:55 +0700 (KRAT) (envelope-from eugen@grosbein.net) Message-ID: <54997C9F.7@grosbein.net> Date: Tue, 23 Dec 2014 21:30:55 +0700 From: Eugene Grosbein User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "IT Department, AkNet ISP" , "freebsd-net@freebsd.org" Subject: Re: Netmap-ipfw, how to fill a table by 15K entries ? References: <20141223130201.83220.333300601.swift@crm.aknet.kg> In-Reply-To: <20141223130201.83220.333300601.swift@crm.aknet.kg> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_96_Q, LOCAL_FROM autolearn=no version=3.3.2 X-Spam-Report: * 2.7 DATE_IN_FUTURE_96_Q Date: is 4 days to 4 months after Received: date * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hz.grosbein.net X-Spam-Level: ** X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2014 14:51:40 -0000 On 23.12.2014 20:02, IT Department, AkNet ISP wrote: > Hello to All > > Can anybody tell, how to fill a table with large number of entries ? > > Sure, It can be done by standard method by ./ipfw table 10 add > xxx.xxx.xxx.xxx in a script, but each entry takes couple of seconds to > be placed into a table: > > ./ipfw table 10 add 192.168.10.50 > connected to 127.0.0.1:5555 > > And takes many hours to do all job. > > May be there is a way to open a socket and place a bulk commands, for > example: > telnet localhost 5555 > table 10 add xxx.xxx.xxx.xxx > > But it doesn't work as written above. > > May be Senior Luigi can explane how to do such work as fast as it > done by ordinary ipfw ? /sbin/ipfw can take full pathname of text file containing list of commands like: table 10 add x.x.x.x table 10 add x.x.x.y ... So, it parses them all and executes at once. Read man ipfw, section: LIST OF RULES AND PREPROCESSING Eugene Grosbein