Discussion:
load ipfw table addresses from file
(too old to reply)
Alex Keda
2010-04-09 06:57:31 UTC
Permalink
hi!
is there any plans to implement such opportunities?
for large files (we have 60k lines) it's very slow work

srv1# sh -E
# wc -l /root/scripts/db/table.25.txt
61073 /root/scripts/db/table.25.txt
# date && for i in `cat /root/scripts/db/table.25.txt`; do ipfw table 25
add $i; done && date
пятница, 9 апреля 2010 г. 10:42:01 (MSD)
пятница, 9 апреля 2010 г. 10:52:43 (MSD)
#
it took more than 10 minutes on busy server =(
Hizel Ildar
2010-04-09 07:14:12 UTC
Permalink
В Fri, 09 Apr 2010 10:57:31 +0400
Post by Alex Keda
hi!
is there any plans to implement such opportunities?
for large files (we have 60k lines) it's very slow work
srv1# sh -E
# wc -l /root/scripts/db/table.25.txt
61073 /root/scripts/db/table.25.txt
# date && for i in `cat /root/scripts/db/table.25.txt`; do ipfw table
25 add $i; done && date
пятница, 9 апреля 2010 г. 10:42:01 (MSD)
пятница, 9 апреля 2010 г. 10:52:43 (MSD)
#
it took more than 10 minutes on busy server =(
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to
my variant:

***@serv4 ~ >wc -l ip2.txt
65536 ip2.txt
***@serv4 ~ >sudo ipfw table 25 flush
***@serv4 ~ >sudo time ipfw /home/se/ip2.txt
0.94 real 0.54 user 0.39 sys
***@serv4 ~ >sudo ipfw table 25 list | wc -l
65536

but file like:
table 25 add 192.168.0.36
table 25 add 192.168.0.37
table 25 add 192.168.0.38
table 25 add 192.168.0.39
table 25 add 192.168.0.40
table 25 add 192.168.0.41
table 25 add 192.168.0.42
Alex Keda
2010-04-09 08:02:51 UTC
Permalink
Post by Hizel Ildar
В Fri, 09 Apr 2010 10:57:31 +0400
Post by Alex Keda
hi!
is there any plans to implement such opportunities?
for large files (we have 60k lines) it's very slow work
srv1# sh -E
# wc -l /root/scripts/db/table.25.txt
61073 /root/scripts/db/table.25.txt
# date&& for i in `cat /root/scripts/db/table.25.txt`; do ipfw table
25 add $i; done&& date
пятница, 9 апреля 2010 г. 10:42:01 (MSD)
пятница, 9 апреля 2010 г. 10:52:43 (MSD)
#
it took more than 10 minutes on busy server =(
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to
65536 ip2.txt
0.94 real 0.54 user 0.39 sys
65536
table 25 add 192.168.0.36
table 25 add 192.168.0.37
table 25 add 192.168.0.38
thanks, it is faster, but - this is a crutch =)
Julian Elischer
2010-04-09 08:06:46 UTC
Permalink
Post by Alex Keda
Post by Hizel Ildar
Post by Alex Keda
# wc -l /root/scripts/db/table.25.txt
61073 /root/scripts/db/table.25.txt
# date&& for i in `cat /root/scripts/db/table.25.txt`; do ipfw table
25 add $i; done&& date
пятница, 9 апреля 2010 г. 10:42:01 (MSD)
пятница, 9 апреля 2010 г. 10:52:43 (MSD)
#
it took more than 10 minutes on busy server =(
_______________________________________________
[...]
Post by Alex Keda
Post by Hizel Ildar
table 25 add 192.168.0.36
table 25 add 192.168.0.37
table 25 add 192.168.0.38
thanks, it is faster, but - this is a crutch =)
yes but it is a crutch that is 600 times faster.
Ivan Voras
2010-04-09 09:25:46 UTC
Permalink
Post by Julian Elischer
Post by Alex Keda
Post by Hizel Ildar
Post by Alex Keda
# wc -l /root/scripts/db/table.25.txt
61073 /root/scripts/db/table.25.txt
# date&& for i in `cat /root/scripts/db/table.25.txt`; do ipfw table
25 add $i; done&& date
пятница, 9 апреля 2010 г. 10:42:01 (MSD)
пятница, 9 апреля 2010 г. 10:52:43 (MSD)
#
it took more than 10 minutes on busy server =(
_______________________________________________
[...]
Post by Alex Keda
Post by Hizel Ildar
table 25 add 192.168.0.36
table 25 add 192.168.0.37
table 25 add 192.168.0.38
thanks, it is faster, but - this is a crutch =)
yes but it is a crutch that is 600 times faster.
I've never used the feature but ipfw has "-p preprocessor" argument
which looks like it might be used to process the file containing raw IP
addresses with a simple script that appends "table 25 add" to each
address before returning it to ipfw.

Loading...