Hi,
I am trying to set up PF on a remote machine to be my primary firewall as an experiment. I'm not too familiar with PF so I'd like to test it out before I deploy it. The steps I use are:
1. vi /etc/sysctl.conf and I append "net.inet.ip.forwarding=1" to that file to enable packet forwarding.
2. kldload pf
3. create my pf.conf in /etc
4. /etc/rc.d/pf onestart (this way i can reboot my box when I mess up the rules)
My pf.conf file is:
Any help that could be given as to why nothing is being blocked or that if I uncomment the block in all and block out all rules I lose contact with the box (since I work remotely).
Thank you!
I am trying to set up PF on a remote machine to be my primary firewall as an experiment. I'm not too familiar with PF so I'd like to test it out before I deploy it. The steps I use are:
1. vi /etc/sysctl.conf and I append "net.inet.ip.forwarding=1" to that file to enable packet forwarding.
2. kldload pf
3. create my pf.conf in /etc
4. /etc/rc.d/pf onestart (this way i can reboot my box when I mess up the rules)
My pf.conf file is:
Code:
#block the inbound traffic from the server itself
block in log quick from webserver to any
block in log quick from imap to any
block in log quick from snortips to any
block in log quick from windows to any
block in log quick from NFS to any
block in log quick from FreeBSD to any
#allow ICMP traffic to get through the firewall
block in log quick proto icmp from any to any
block out log quick proto icmp from any to any
#allow inbound traffic to ssh, http, NFS
#webserver
pass in log quick proto tcp to webserver port 80
#NFS Server
pass in log quick proto tcp to NFS port 2049
#SSH Server
pass in log quick proto tcp to webserver port 22
pass in log quick proto tcp to imap port 22
pass in log quick proto tcp to snortips port 22
pass in log quick proto tcp to windows port 22
pass in log quick proto tcp to nfs port 22
#allow new outbound traffic to ssh and web servers
pass out log quick proto tcp from any to any port 22
pass out log quick proto tcp from any to any port 80
#pasively ignore all other traffic
#block in all
#block out all
Any help that could be given as to why nothing is being blocked or that if I uncomment the block in all and block out all rules I lose contact with the box (since I work remotely).
Thank you!