# How to delay opening of ports (using pf firewall) after OS start up?



## ikevinjp (Jun 25, 2012)

I have a server with multiple jails configured to start automatically at bootup. The thing is I'd like to wait for all the jails to have started to allow any traffic in via the ports. This means I'd like the machine to have all ports closed, wait for all jails/services to start up, then open the ports - typically, say, after 5 mins. after bootup.

How do I configure the pf firewall to delay opening the ports?


----------



## SirDice (Jun 25, 2012)

If there's no service listening the port is closed.


----------



## CoTones (Jun 25, 2012)

Have two PF configuration files and use, when needed, pfctl.


----------



## ikevinjp (Jun 27, 2012)

Is this the best way to configure the script: http://osresources.com/content/2/10/en/how-to-execute-a-script-during-boot-up-on-freebsd.html

*U*sing the pf command [cmd=]pf -f /etc/pf2.conf[/cmd]
?


----------



## CoTones (Jun 27, 2012)

Yes, only command should be [cmd=]pfctl -f /etc/pf2.conf[/cmd]


----------

