# Software or firewall to count connections to specific host



## atmosx (Oct 30, 2012)

Hello,

I need to setup a program that monitors all outgoing connection from my host to a specific host. If they reach a max of 16k in less than 24 hours. I'd like to block access to that host.

Can I do this sort of thing by using only PF or specific (cli) software or do I need to write a script that monitors the connections and issues a PF block if max connections are reached?

Thanks in advance for your time.


----------



## atmosx (Oct 30, 2012)

I did it using this: 


> pass out on vte0 from any to 'example.host' flags S/SA keep state (max-src-conn 16000, max-src-conn-rate 1/6184000)



example.host is resolved using the system's DNS to 'IP'. S/SA keep state permits the user to 'ping' the remote host but not establish any connection!


----------

