Razorlabs Ovh-4
Razorlabs Ovh-4
set skip on lo
it's simple, and self expanatory, but what I want is something like what I did in my simple
nftables configuration article.
#!/sbin/pfctl -f
having added this as the first line of the config, we'll be able to reload the pf configuration by
executing /etc/pf.conf as root.
as for the rest of the config, we'll add a variable holding all of the tcp ports we want to let
through.
you can specify the service name (check /etc/services), or port number. to use this variable;
pass in on egress inet proto tcp from any to any port $tcp_services
this rule will let in any tcp traffic on the ports defined in the tcp_services macro on the egress
interface. the egress interface is naturally the device from which data egresses, or "leaves".
we're also gonna add a table that's going to be contained in /etc/blacklist. all traffic from the
hosts in the blacklist table will be immediately rejected.
to add a host;
you'll have to reload pf.conf every time you apply a modification in blacklist.
#!/sbin/pfctl -f
# allow ping
pass on egress inet proto icmp all icmp-type 8 code 0
to check our config file for any syntax errors, we can run pfctl -nf /etc/pf.conf to read it
without loading.
it's a good idea to /etc/pf.conf ; sleep 30 && pfctl -d in case you did something to block yourself
out. -d disables pf, use -e to enable it again.