IPFilter Firewall Quick Start Guide

26-01-2024 02:39:55

IPFilter (IPF) is an open-source firewall software that operates on the FreeBSD operating system and is loaded as a kernel module in the default FreeBSD setup. This quick start guide lists some common commands for IPF, enabling system administrators to rapidly master the usage of IPFilter.

Starting IPF:

# service ipfilter start

Viewing Current Active Rules:

# ipfstat -io

Deleting All Current Rules:

# ipf -F a

Stopping IPF:

# service ipfilter stop

Allow SSH access from IP address 192.0.2.123 and deny all others:

Add the following code to /etc/ipf.conf.

block in on any all
pass in quick on any proto tcp from any to 192.0.2.123/32 port = 22 keep state

For more information, refer to the official IPFilter documentation.

https://docs.freebsd.org/en/books/handbook/firewalls/#firewalls-ipf