Firewalls are hardware, software, or a combination of both that are used to prevent unauthorized access to private networks and computers. There are different types of firewalls including hardware firewalls, which protect entire networks, and software firewalls, which protect individual computers. Firewall rules determine whether network traffic is allowed, blocked, or requires user approval to pass through the firewall.