Skip to content
IT glossary
SecurityUpdated December 3, 2026

Firewall

Файрвол

A firewall controls which network traffic can pass. It applies rules to allow or block traffic entering or leaving a device or network, or moving between network segments.

Also known as: межсетевой экран, брандмауэр

What a firewall does

A firewall limits which systems can communicate over a network. An online store, for example, needs to accept connections from shoppers, but its database should accept connections only from the application. A firewall can enforce that distinction on a single machine, at a network gateway, or through cloud controls attached to resources. It can also restrict outgoing traffic, such as which external services a server is allowed to reach.

How a firewall makes a decision

A basic network firewall can match traffic by source and destination IP address, protocol, and, for TCP or UDP, port. Depending on the policy, it can allow the traffic, silently drop it, or reject it with a response. Check how the platform combines rules: in a first-match rule set, a broad allow rule can take precedence over a more specific deny rule below it. A common default for new inbound connections is to deny anything that has not been explicitly allowed.

A stateless firewall evaluates each packet on its own. A stateful firewall tracks active connections and can recognize that a packet belongs to a connection it has already allowed. For example, when a server initiates an allowed HTTPS connection through a stateful firewall, the firewall can let the reply back in without allowing unrelated inbound connections.

Example: keep the database private

Imagine a public load balancer in front of an app backed by PostgreSQL. Let internet clients reach the load balancer on TCP port 443. Allow the load balancer to reach the app on its internal listening port, and give only the app servers access to PostgreSQL on TCP port 5432. Each rule covers a separate connection. The database does not need a public rule, and placing it on a private network does not mean every other service on that network should be able to connect.

What a firewall does not do

A network rule grants access to a service, not permission to use its data. The service still needs authentication and authorization. A basic network firewall also cannot distinguish URLs or inspect request bodies inside encrypted HTTPS traffic. A Web Application Firewall (WAF) can apply HTTP-specific rules when it has access to the decrypted requests. The two controls do different jobs and can be used together.

How it comes up in interviews

You may be asked why one service cannot connect to another. Start by identifying the source, destination, protocol, and port. Then check whether the destination is listening on the expected address, whether routing works, and which firewall policies apply along the path. A timeout is consistent with a silent drop, but it is not proof of one.