Tuesday, November 25, 2008

pf IPv4 and IPv6 shortcut

There's a shortcut for creating a pf rule that applies to both IPv4 and IPv6. E.g.:

pass in quick on em0 from { 192.168.86.0/24, 2001:418:c0de:babe::/64 } to any keep state label "experimentation"

Results in:

root@soulfury:~# pfctl -sr | grep experimentation
pass in quick on em0 inet from 192.168.86.0/24 to any flags S/SA keep state label "experimentation"
pass in quick on em0 inet6 from 2001:418:c0de:babe::/64 to any flags S/SA keep state label "experimentation"

No comments: