A firewall lets into a port only those its list of firewall rules allows. Everything that is not allowed is closed.