A firewall is used to prevent unauthorized access to a network. A network can be made up of a company's local area networks, wide area networks, and the Internet, or it can be just an Internet service provider preventing inappropriate access to its customers' files.

The firewall's role is to ensure that all communication between an organization's network and the Internet, in both directions, conforms to the organization's security policies.