A firewall is a part of a computer system or network that is designed to block unauthorized access while permitting authorized communications. It is a device or set of devices which is configured to permit or deny computer based application upon a set of rules and other criteria. Firewalls can be implemented in either hardware or software, or a combination of both. Firewalls are frequently used to prevent unauthorized Internet users from accessing private networks connected to the Internet, especially intranets. All messages entering or leaving the intranet pass through the firewall, which examines each message and blocks those that do not meet the specified security criteria.

Currently 5 different types of firewall architectures exist and they are:
  • Packet filtering firewalls: Packet filtering inspects each packet passing through the network and accepts or rejects it based on user-defined rules. Although difficult to configure, it is fairly effective and mostly transparent to its users. It is susceptible to IP spoofing.
  • Application level gateways also known as proxy firewalls. These firewalls function at the application layer and are also referred to as application level gateways.
  • Circuit-level firewalls: These firewalls apply security mechanisms when a TCP or UDP connection is established. Once the connection has been made, packets can flow between the hosts without further checking.
  • Proxy server firewalls also known as application level gateways: Intercept all messages entering and leaving the network. The proxy server effectively hides the true network addresses.
  • A firewall is a dedicated appliance, or software running on a computer, which inspects network traffic passing through it, and denies or permits passage based on a set of rules.
  • Next gen firewalls include such functionality as: deep packet inspection which is checking the actual contents of the data packet, TCP handshake checks, and surface level packet inspection. Many next-generation firewalls could be considered intrusion prevention systems - IPSs - which can halt attacks against networks.

    Firewalls are  normally placed between a protected network and an unprotected network and acts like a gate to protect assets to ensure that nothing private goes out and nothing malicious comes in.

    A firewall's basic task is to regulate some of the flow of traffic between computer networks of different trust levels. Typical examples are the Internet which is a zone with no trust and an internal network which is a zone of higher trust. A zone with an intermediate trust level, situated between the Internet and a trusted internal network, is often referred to as a "perimeter network" or Demilitarized zone (DMZ).

    Firewalls function within networks are area similar to physical firewalls with fire doors in building construction. In the former case, it is used to prevent network intrusion to the private network. In the latter case, it is intended to contain and delay structural fire from spreading to adjacent structures.

    This is the Cisco Firepower 2140 which is one of Cisco's high end firewalls and lists for about $45,000.00

    This diagram displays how firewalls can be placed between network segments in order to protect different network segments.