A firewall controls which traffic can enter or leave your network, blocking many unwanted connections.