aboutsummaryrefslogblamecommitdiffstats
path: root/roles/pf/templates/pf.conf.j2
blob: 6d67f4f07f102ab6259532a71edc1a42627caef3 (plain) (tree)
1
2
3
4
5
6
7

                                

                    
   
                           
   






                       

                                                                                  

            
   
                        







                                                 
 
                                                                                  
 
   
                            
   



                                 

{# pf ~~ templates/pf.conf.j2 #}
# pf ~~ /etc/pf.conf

# *
# common config. by Ansible
# *

set block-policy drop
set loginterface egress
set skip on { lo tun0 }

block all

{% for service in services %}
pass in quick on egress proto {{ service["proto"] }} to port {{ service["port"] }}
{% endfor %}

# *
# sub-config. by Ansible
# *

{% if hypervisor is defined and vms is defined %}
# hypervisor network passthrough
{% for i in range(vms | length + 5) %}
set skip on tap{{ i }}
{% endfor %}
{% endif %}

{% include "templates/" + inventory_hostname + "/etc/pf.conf.j2" ignore missing %}

# *
# out. interface by Ansible 
# *

pass out quick inet
pass in proto { icmp, icmp6 } all

remember that computers suck.