QUOTE (Fisherman)
I found the problem line and it was supposed to be commented out.
I think it's installed and running. How do I know if it's working properly? This time when I started it I got the message below.
QUOTE
/usr/local/sbin/apf -s
Development mode enabled!; firewall will flush every 5 minutes.
Then when I took it out of dev mode I got no message after starting. No error message but I thought it would at least say something like, "Yes sir! I'm on the job."
It should be running as a service so you can try the command
QUOTE
service apf restart
and you should get 2 lines, one for when it stopped and one from when it started. They should say [failed] or [ok].
Also, you can run the command
QUOTE
iptables -L
and compare the results when apf is stopped and when it is started. You should see a LOT of firewall entries that apf has added.
IIRC, when you start APF it just adds a bunch of iptables firewall rules and stops. The Linux firewall takes it from there.
BFD runs every few minutes from a cron job and when it wants to ban an IP, it issues a command something like
QUOTE
apf -d 111.222.333.444
to ban the IP. Actually, I think later versions might have a slightly different syntax for banning an IP since they include a comment when they add a host to /etc/apf/deny_hosts.rules like the two following IPs which my server recently banned
QUOTE
# added 67.114.152.251 on 08/29/05 12:10:02
# {bfd.sshd}
67.114.152.251
# added 66.70.235.202 on 08/30/05 10:30:02
# {bfd.sshd}
66.70.235.202
Typing the followingline will give you some help text for apf. There's no man page.
QUOTE
apf --help
BTW, be careful to always use IP addresses. IIRC, one version of BFD (I think it was the version that was banning hosts exim rejected) was banning using host names. It worked at the time BFD banned the host, but the system would lockup on boot because apf started before the nameserver so it had no way to lookup the names and get IP addresses during boot. It required physical access to the console to get past that problem.
-- David