# PF doesn't work



## Alex159 (Apr 14, 2016)

Hello.

I was going to use the PF on my FreeBSD 10.2 amd64 system, so I downloaded the source for it, added the ALTQ options to the kernel, built and installed it.

```
device pf
device pflog
device pfsync

options         ALTQ
options         ALTQ_CBQ
options         ALTQ_RED
options         ALTQ_RIO
options         ALTQ_HFSC
options         ALTQ_PRIQ
options         ALTQ_NOPCC
```
I added this to rc.conf:

```
pf_rules="/etc/pf.conf"
pf_enable="NO"
pf_flags=""
pflog_enable="YES"
pflog_log="/var/log/pflog"
pflog_flags=""
```

The pf_enabled="NO" is correct, if I do a mistake or something the firewall won't start again when the server reboots.

The firewall rules are also correctly placed under /etc/pf.conf.

After that I rebooted the server and connected again, then I tried to start PF with `pfctl -e` but it gives me this error:

```
pfctl -e
pfctl: /dev/pf: No such file or directory
```
tried the onestart also:

```
/etc/rc.d/pf onestart
kldload: can't load pf: module already loaded or in kernel
/etc/rc.d/pf: WARNING: Unable to load kernel module pf
```
and kldload(8):

```
kldload pf
kldload: can't load pf: module already loaded or in kernel
```
I already used the search on the board/google but found no solution for my problem. Hopefully someone knows how to solve this issue.


----------



## jrm@ (Apr 14, 2016)

Alex159 said:


> I was going to use the pf on my freebsd 10.2 amd64 system, so i downloaded the source for it


There's no need to download the source.  pf is already in the base system.


----------



## kpa (Apr 14, 2016)

Unless you're sure you will need ALTQ (under normal home use ALTQ is next to useless) you can just use the pf modules bundled with the system, saves your from fiddling with custom kernels.


----------



## Alex159 (Apr 14, 2016)

Well those answers don*'*t help me at all, *I* still can*'*t start PF.


----------



## SirDice (Apr 14, 2016)

Revert to the GENERIC kernel and try again.


----------



## Maxnix (Apr 14, 2016)

Give a look here: http://lists.freebsd.org/pipermail/freebsd-pf/2008-January/004062.html
Perhaps you commented out `device bpf`?


----------

