A firewall can be either software-based or hardware-based, and is used to help secure a network by preventing unauthorized access. There are several types of firewalls including network layer, application layer, circuit layer, stateful multi-layer inspection, proxy, host-based, and hybrid firewalls. Firewalls work at different levels, from just packet filtering at the network level, to deep packet inspection and application-level filtering at higher levels.