FreeBSD Stop IPFW Firewall

Q. How do I IPFW firewall in FreeBSD using a shell prompt or over remove ssh login?

A. ipfw is a FreeBSD IP packet filter and traffic accounting facility. Its ruleset logic is similar to many other packet filters except IPFilter.

The IPFW stateless rule syntax is empowered with technically sophisticated selection capabilities which far surpasses the knowledge level of the customary firewall installer.

IPFW is the default firewall in FreeBSD. If you can’t reach your FreeBSD server, it is a good idea to stop the firewall first to see if the firewall is the problem.

FreeBSD command to stop IPFW Firewall

To stop the firewall, issue the command:
# /etc/rc.d/ipfw stop
To disable firewall remove following line from /etc/rc.conf file:
firewall_enable="YES"
OR set it as follows:
firewall_enable="NO"


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 2 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
2 comments… add one
  • Leo Oct 9, 2012 @ 19:26

    With IPFIREWALL enabled in my kernel, I had to put this in /etc/sysctl.conf:

    net.inet.ip.fw.enable=0
    net.inet6.ip.fw.enable=0
  • Leo Oct 9, 2012 @ 21:45

    I made a typo in my previous comment:
    in /etc/sysctl.conf I also need:

    net.inet.ip.fw.enable=0
    net.inet6.ip6.fw.enable=0

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum