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 the files of its customers.

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.