Firewalls can effectively protect networks from external threats while allowing access to outside networks. There are different types of firewalls that use packet filtering, application gateways, or circuit gateways. More complex firewall configurations provide multiple layers of defense by using screened subnets or dual-homed bastion hosts. Trusted systems aim to enhance security through mandatory access control and multilevel security models enforced by a reference monitor.