Firewalls are systems designed to prevent unauthorized access to private networks. There are several types of firewalls, including packet-filtering routers, stateful inspection firewalls, application proxies, and circuit-level gateways. Firewalls can be configured in different ways, such as using a single bastion host with a packet-filtering router, a dual-homed bastion host, or a screened subnet configuration with two routers and a bastion host subnet for the highest level of security.