# Syntax error on ALTQ configuration?



## tommyj27 (Oct 1, 2010)

I am trying to build an altq configuration into my existing pf ruleset. I upgraded my system to 8.1-RELEASE-p1 and compiled the kernel with the following options set.


```
options         ALTQ
options         ALTQ_CBQ                # Class Bases Queuing (CBQ)
options         ALTQ_RED                # Random Early Detection (RED)
options         ALTQ_RIO                # RED In/Out
options         ALTQ_HFSC               # Hierarchical Packet Scheduler (HFSC)
options         ALTQ_PRIQ               # Priority Queuing (PRIQ)
options         ALTQ_NOPCC              # Required for SMP build
```

The altq configuration I have added to the pf.conf is:

```
altq on $wan_if hfsc bandwidth 800Kb queue {ack, realtime, std, bulk}
        queue ack       bandwidth 30%   priority 8 hfsc (realtime 20%)
        queue realtime  bandwidth 40%   priority 7 hfsc (realtime 40%) { phones games ssh-int }
                queue phones    bandwidth 30%   priority 7 hfsc (realtime 20%)
                queue games     bandwidth 100%  priority 6 hfsc (realtime 80%)
                queue ssh-int   bandwidth 50%   priority 5 hfsc (realtime 20%)
        queue std       bandwidth 100%  priority 4 hfsc (realtime 25% default)
        queue bulk      bandwidth 100%  priority 2 hfsc (realtime 10%)
```

However, when I try to reload pf with this configuration, I get the following errors.


```
Reloading pf rules.
/etc/pf.conf:35: syntax error
/etc/pf.conf:36: queue ack has no parent
/etc/pf.conf:36: errors in queue definition
/etc/pf.conf:38: queue phones has no parent
/etc/pf.conf:38: errors in queue definition
/etc/pf.conf:39: queue games has no parent
/etc/pf.conf:39: errors in queue definition
/etc/pf.conf:40: queue ssh-int has no parent
/etc/pf.conf:40: errors in queue definition
/etc/pf.conf:41: queue std has no parent
/etc/pf.conf:41: errors in queue definition
/etc/pf.conf:42: queue bulk has no parent
/etc/pf.conf:42: errors in queue definition
```

Where line 35 is my altq definition.

I have tried the other two queue disciplines, hard-coding the interface name, reordering the arguments. None of these seem to have any effect. It almost seems as though pf doesn't understand altq (even though it is included in the kernel). Any thoughts on where I may have gone wrong?


----------



## triumdh (Oct 2, 2010)

I would use


```
altq on $wan_if bandwidth 800Kb hfsc queue
```

with the hfsc after the bandwidth


----------



## tommyj27 (Oct 2, 2010)

I've tried that as well, it makes no difference.


----------



## triumdh (Oct 2, 2010)

Change realtime to rtime. ALTQ doesn't like queues called realtime.

When you have done that you will have to work on your mathematics.


----------



## tommyj27 (Oct 3, 2010)

That did the trick (and yes, I need to sort out my mathematics). Is that documented somewhere, or is it just a gotcha?


----------



## tommyj27 (Oct 3, 2010)

nm, figured out why it doesn't work..


----------



## DutchDaemon (Oct 3, 2010)

Share your solution. This is a forum.


----------



## triumdh (Oct 3, 2010)

"Realtime" is a specification within pf. Calling a queue realtime or bandwidth or any other specification generally causes a syntax error.


----------



## DutchDaemon (Oct 3, 2010)

Thank you.


----------

