Network Defence, Explained
If you are reading this, you have probably seen "firewall", "DMZ", "VPN", "IDS" and "VLAN" on diagrams and in job descriptions, and heard that "the network is protected", without anyone saying what each device actually does, where it sits, or what it cannot do.
By the end you will be able to explain what each of those does, tell the types of firewall apart, read a simple network layout with a DMZ, explain why internal segmentation matters as much as the perimeter, and say which defence answers which attack from the earlier posts. It builds on Computer and Networking Basics and Risk and Security Controls.
1. The idea: control and watch the traffic, in layers
Network defences do three kinds of job:
| Job | Question it answers | Examples |
|---|---|---|
| Control | Which traffic is allowed to pass? | Firewalls, proxies, segmentation, network access control |
| Watch | Is something wrong with the traffic that did pass? | Intrusion detection and prevention, monitoring |
| Protect | Can anyone on the path read or change the traffic? | VPNs, TLS |
No single device does all three well, and none is perfect. The Lockheed Martin paper on the intrusion kill chain (see Threats and Vulnerabilities) explains why layers matter: the attacker must "progress successfully through each stage of the chain", so "just one mitigation breaks the chain." Network defences are several chances to break it.
2. Firewalls
NIST SP 800-41 Rev. 1 (Guidelines on Firewalls and Firewall Policy) defines them: "Firewalls are devices or programs that control the flow of network traffic between networks or hosts that employ differing security postures."
A firewall applies a ruleset to traffic: allow this, block that, based on addresses, ports, protocols, and for some types, the content.
Types of firewall (NIST SP 800-41)
| Type | What it looks at | Strengths and limits (NIST) |
|---|---|---|
| Packet filter (stateless) | Each packet on its own: source and destination address and port, protocol | The most basic type. "Packet filtering is at the core of most modern firewalls." But stateless filters "do not keep track of the state of each flow of traffic", so they cannot associate multiple requests within a session. Packet filters are "not concerned about the content of packets" |
| Stateful inspection | The packet and the state of the connection, kept in a state table | "Improves on the functions of packet filters by tracking the state of connections." For TCP, it checks that a packet belongs to an established connection (see Handshakes) |
| Application firewall (stateful protocol analysis) | The application protocol in use, such as HTTP or email | Can decide based on "how an application is running over the network", for example blocking an executable attachment or instant messaging disguised on port 80 |
| Application-proxy gateway | The application conversation in full, because it sits in the middle of it | "Never allows a direct connection" between the two hosts: each connection becomes two, one to the proxy and one from it. Can inspect content, and some "decrypt packets (e.g., SSL-protected payloads), examine them, and re-encrypt them." The cost is speed and limited support for new protocols |
| Web application firewall (WAF) | HTTP traffic in front of a web server | Detects many web exploits. NIST notes they are "often considered to be very different than traditional firewalls" (and, when it wrote this in 2009, a relatively new technology) |
| Host-based / personal firewall | Traffic to and from one computer | Runs on the device itself. NIST says many host-based firewalls can also act as intrusion prevention systems |
If a gateway decrypts encrypted traffic to inspect it, then it sees that traffic in clear text. It then becomes a very sensitive system that needs the same care as the servers behind it.
A policy, not just a box
NIST's key rule for firewall policy: "firewalls should block all inbound and outbound traffic that has not been expressly permitted by the firewall policy." This is called deny by default, and NIST says it "decreases the risk of attack and can also reduce the volume of traffic carried on the organization's networks", being "a more secure approach than permitting all traffic that is not explicitly forbidden."
A firewall policy should also start with a risk analysis that looks at "threats; vulnerabilities; countermeasures in place to mitigate vulnerabilities; and the impact if systems or data are compromised", and it should be documented and updated "as classes of new attacks or vulnerabilities arise" (see Risk and Security Controls).
Here is the idea as a table of rules for a small company. It is an illustration of the principle, not the syntax of any product:
| Direction | From | To | Port or service | Action |
|---|---|---|---|---|
| Inbound | Internet | Web server (in the DMZ) | HTTPS (443) | Allow |
| Inbound | Internet | Anything else | Any | Deny |
| Outbound | Staff network | Internet | Web (80, 443) and DNS | Allow |
| Outbound | Web server | Internet | Any | Deny (a web server rarely needs to start connections, which also limits damage if it is compromised, see SSRF) |
| Any | Any | Any | Any | Deny (the default) |
The limits of firewalls
NIST is frank about them:
- Firewalls at the network edge "could not recognize all instances and forms of attack, and attacks sent from one internal host to another often do not pass through network firewalls." So designers "now often include firewall functionality at places other than the network perimeter."
- "Threats have gradually moved from being most prevalent in lower layers of network traffic to the application layer, which has reduced the general effectiveness of firewalls in stopping threats carried through network communications." Even so, "firewalls are still needed to stop the significant threats that continue to work at lower layers."
- If a firewall is not at each entry point, "malicious traffic that would normally be blocked by the main ingress can enter the network by other means."
- A firewall cannot stop what it is allowed to pass. If you allow web traffic to your web server, a SQL injection inside that web traffic (SQL Injection) goes straight through unless a WAF or the application stops it.
- A firewall on your own link can be saturated by a big DDoS before it ever sees the traffic (DoS vs DDoS).
NAT is not a firewall. NIST's guidance says "Do not rely on NATs to provide the benefits of firewalls", matching the point made in Computer and Networking Basics.
3. The DMZ: a zone for things the public must reach
Some servers must be reachable from the internet: web, email, and so on. If they sit on the same network as your internal systems, then one compromise reaches everything. The answer is a demilitarized zone (DMZ).
NIST SP 800-41 explains: DMZs "are usually interfaces on a routing firewall that are similar to the interfaces found on the firewall's protected side", but "traffic moving between the DMZ and other interfaces on the protected side of the firewall still goes through the firewall and can have firewall protection policies applied." It adds that "it is common to put public-facing servers, such as web and email servers, on the DMZ."
NIST SP 800-53 (control SC-7, Boundary Protection) says the same in its own words: "Implement subnetworks for publicly accessible system components that are [Selection: physically; logically] separated from internal organizational networks." Such subnetworks "are referred to as demilitarized zones or DMZs."
+----------------+
Internet <------> | FIREWALL | <------> DMZ
| (ruleset: | (web server,
| deny by | mail gateway)
| default) |
+-------+--------+
|
v
Internal network
(staff, databases, files)
Traffic between the internet, the DMZ and the internal network all passes through the firewall, and each path has its own rules. As a rule of thumb, the internal network should accept very little that starts in the DMZ, so a compromised public server cannot reach inward freely.
SC-7 also says that managed interfaces (gateways, routers, firewalls, guards, encrypted tunnels) should be used to connect to external networks, and that organizations should prohibit "external traffic that appears to be spoofing internal addresses" and "internal traffic that appears to be spoofing external addresses" (see Spoofing).
4. Proxies
A proxy is a go-between: the user's connection ends at the proxy, and the proxy makes a new connection on their behalf. NIST SP 800-41 describes dedicated proxy servers as retaining "proxy control of traffic" with "much more limited firewalling capabilities", typically placed behind the main firewall. Its example: "an HTTP proxy deployed behind the firewall—users would need to connect to this proxy en route to connecting to external web servers." The proxy can "filter or log" the traffic. It can also sit on the way in, with the main firewall handing, for example, email traffic to an email proxy that filters it before passing it to internal systems.
What a proxy gives you:
| Benefit | Because |
|---|---|
| Central filtering and logging | All web or email traffic passes through one place |
| Hiding internal systems | External hosts see only the proxy ("internal IP addresses are not visible to the outside world", says NIST of proxy gateways) |
| Content inspection | The proxy sees the whole application conversation |
The cost is that a proxy is another system to run and protect, and each one is limited to the protocols it understands.
5. VPNs
NIST SP 800-77 Rev. 1 (Guide to IPsec VPNs, June 2020) defines it: "A VPN is a virtual network built on top of existing physical networks that provides a secure communications mechanism for data and control information transmitted between computers or networks."
It does this by encrypting the traffic between its two ends and authenticating who is on the other end. NIST lists four architectures:
| Architecture | What it protects |
|---|---|
| Gateway-to-gateway | Communications "between two specific networks, such as an organization's main office network and a branch office network" |
| Remote access (host-to-gateway) | Communications between individual hosts and an organization's network. "Most often used to allow hosts on unsecured networks, such as traveling employees and telecommuters, to gain access to internal organizational services" |
| Host-to-host | Communications "between two specific computers" |
| Mesh | Many hosts each set up VPNs with each other |
NIST covers IPsec VPNs in SP 800-77 and TLS-based ("SSL") VPNs in SP 800-113.
What a VPN does not do
A VPN protects the path between its two ends. It does not:
- clean up a device that already has malware;
- make a site you visit trustworthy, because the traffic is decrypted at the VPN's other end;
- replace the need to control what a VPN user can reach once inside. That is a job for the firewall rules and segmentation described below.
On untrusted Wi-Fi, a VPN is one of the recommended protections (the Australian Federal Police advise a reputable VPN for public Wi-Fi in the Evil Twin case). Organizations use VPNs or a gateway rather than exposing management services such as SSH and RDP to the whole internet, as the Brute Force post recommends.
6. Intrusion detection and prevention (IDS/IPS)
NIST SP 800-94 defines the terms: "Intrusion detection is the process of monitoring the events occurring in a computer system or network and analyzing them for signs of possible incidents." "Intrusion prevention is the process of performing intrusion detection and attempting to stop detected possible incidents." Systems that do this are IDPS.
NIST names four types:
| Type | What it monitors |
|---|---|
| Network-based | Network traffic on particular segments or devices |
| Wireless | Wireless traffic and the wireless protocols themselves |
| Network behavior analysis (NBA) | Traffic flows, to identify threats that generate unusual flows such as DDoS attacks, certain forms of malware, and policy violations |
| Host-based | The characteristics of a single host and the events on it |
NIST says that for most environments, a combination of network-based and host-based technologies is needed.
How they decide something is wrong
| Method | How it works | Strength and weakness (NIST) |
|---|---|---|
| Signature-based | Compares activity with patterns of known threats | "Very effective at detecting known threats but largely ineffective at detecting previously unknown threats, threats disguised by the use of evasion techniques, and many variants of known threats." |
| Anomaly-based | Compares activity with a profile of normal behaviour | "Very effective at detecting previously unknown threats", but depends on good profiles of normal |
| Stateful protocol analysis | Compares activity with vendor profiles of benign protocol use | Understands the state of a protocol conversation |
Detect or prevent: where the sensor sits
| Mode | How | Result |
|---|---|---|
| Inline | The traffic "must pass through it, much like the traffic flow associated with a firewall" | Can block attacks. If it fails or is wrong, it can disrupt normal traffic |
| Passive | It "monitors a copy of the actual network traffic; no traffic actually passes through the sensor" | Can alert but cannot directly stop the traffic |
Limits
NIST states that "it is not possible to eliminate all false positives and negatives; in most cases, reducing the occurrences of one increases the occurrences of the other." Changing the configuration to improve accuracy is called tuning. Attackers also use evasion: "modifying the format or timing of malicious activity so that its appearance changes but its effect is the same." The False Positives and False Negatives post explains why this trade-off cannot be avoided.
Decoys are another detection tool: a honeypot is a system nobody should touch, so any contact is suspicious.
SP 800-94 dates from February 2007 (a later draft revision was never finalised and is marked withdrawn), so use it for the concepts, not for product detail.
7. Segmentation, VLANs and zero trust
A perimeter firewall protects against threats from outside. But once an attacker is inside (through phishing, a stolen password or an infected laptop), a flat internal network lets them move freely. MITRE ATT&CK calls this tactic Lateral Movement.
Network segmentation splits the network into zones with controlled paths between them.
What the standards say
- NIST SP 800-53 control SC-7 asks you to "monitor and control communications at the external managed interfaces to the system and at key internal managed interfaces within the system." Note the words key internal: boundaries are not only at the edge.
- NIST SP 800-41 says "there may be reasons to have additional firewalls on the inside of the network, such as to protect one set of computers from another", and that designers include firewall functionality "at places other than the network perimeter."
VLANs
NIST's glossary defines a VLAN as "a broadcast domain that is partitioned and isolated within a network at the data link layer." One physical network can be divided into several logical ones, so for example staff, guests and cameras can sit on different VLANs.
A VLAN divides the network, but by itself it is not a security boundary. Cisco's small-business router documentation warns that "VLANs need to be set up with best practices in order to keep your network secure." It describes VLAN hopping: hostile actors know VLAN 1 is the default and often used, and may send "spoofed traffic posing as VLAN 1 which enables access to trunk ports and thereby other VLANs." And traffic that is allowed to pass between VLANs is controlled by whatever sits between them (a router with access lists, or a firewall), so rules there are what make the separation meaningful.
Microsegmentation and zero trust
NIST SP 800-207 (Zero Trust Architecture) describes zero trust as moving "defenses from static, network-based perimeters to focus on users, assets, and resources." Its key assumption: "no implicit trust granted to assets or user accounts based solely on their physical or network location (i.e., local area networks versus the internet) or based on asset ownership." NIST adds that definitions of zero trust still often involve perimeters in some form, such as micro-segmentation or micro-perimeters. The glossary version: "a collection of concepts and ideas designed to minimize uncertainty in enforcing accurate, least privilege per-request access decisions in information systems and services in the face of a network viewed as compromised."
In practice that means: being "inside" the network should not be enough to reach a system. Each request is checked.
8. Network access control (NAC)
NIST SP 800-41 describes it as a check on remote users: it "allows access based on the user's credentials and the results of performing 'health checks' on the user's computer." The checks cover items such as the latest antimalware and personal firewall updates, configuration settings, and the patch level of the operating system and applications. NIST adds that if the user has acceptable credentials but the device does not pass the health check, they "may get only limited access to the internal network for remediation purposes."
On Wi-Fi, the enterprise form of authentication uses IEEE 802.1X, and the Evil Twin post explains why clients must also validate the server's certificate.
9. Which defence answers which attack
Each row summarises the defences in the earlier post.
| Attack | Network-level defences | Post |
|---|---|---|
| IP spoofing | Ingress filtering at network edges (BCP 38) | Spoofing |
| ARP spoofing / rogue DHCP | Switch features: Dynamic ARP Inspection, DHCP snooping | Spoofing |
| DoS / DDoS | Upstream mitigation service or CDN, rate limiting, ingress filtering. A firewall on your own link can be saturated | DoS vs DDoS |
| Man-in-the-middle | Encryption (TLS, VPN) so a stolen path is not enough, plus the switch controls above | Man-in-the-Middle Attacks |
| Evil twin / rogue access point | 802.1X with server certificate validation, wireless intrusion detection | Evil Twin |
| Deauthentication | Protected management frames, wireless monitoring | Deauthentication Attacks |
| SSRF | Firewall rules and segmentation so the application server cannot reach internal admin systems (the strongest layer) | SSRF |
| Brute force on exposed services | Do not expose management services; use a VPN, allowlists or a gateway | Brute Force vs Password Spraying |
Notice that some attacks (SQL injection, XSS, phishing) are not stopped by network devices at all. They need secure code, user awareness and the other controls from Risk and Security Controls.
10. A short checklist
- Deny by default at every firewall, and allow only what a documented need requires (NIST SP 800-41).
- Put public-facing servers in a DMZ and let almost nothing start connections from it into the inside.
- Place controls inside the network, not only at the edge. Segment, and apply rules between segments.
- Do not treat a VLAN as a wall. Harden the switches and control the traffic between VLANs.
- Use VPNs or gateways for remote administration instead of exposing management ports to the internet.
- Encrypt traffic on untrusted networks and validate server certificates.
- Watch the traffic. Put detection where you can act on its alerts, and tune it. See Security Operations.
- Review firewall policy regularly. NIST says it should be maintained and updated frequently as new attacks appear and as the organization's needs change.
- Never rely on one layer. Patch, harden and monitor the systems themselves too.
11. Common mistakes
| Myth | The facts |
|---|---|
| "We have a firewall, so we are safe" | It stops only what its rules cover. NIST notes attacks between internal hosts often never cross a network firewall, and application-layer threats reduce a firewall's effectiveness |
| "NAT is a firewall" | NIST: "Do not rely on NATs to provide the benefits of firewalls" |
| "Deny by default is too strict" | NIST calls it the more secure approach compared with permitting everything not explicitly forbidden |
| "A VPN makes me anonymous and safe" | It encrypts the path between two points. It does not clean a device or make the destination trustworthy |
| "A VLAN is a security boundary" | It is a way to divide a network. The controls between VLANs and the switch configuration make it secure (Cisco) |
| "An IDS stops attacks" | A detection-only IDS alerts. Only an inline prevention system can block, at the risk of blocking real traffic |
| "Signature detection catches everything" | NIST: it is largely ineffective against previously unknown threats and many variants |
| "Zero trust is a product you can buy" | NIST describes it as concepts and architecture for access decisions in a network viewed as compromised |
| "Perimeter defence is enough" | Phishing, stolen passwords and infected devices put attackers inside. Segmentation and monitoring limit what they can do next |
Closing
Network defence is a set of layers. Firewalls control which traffic may pass, ideally with a deny-by-default policy. A DMZ keeps public-facing servers away from the inside. Proxies put a filtering go-between in the path. VPNs protect traffic over untrusted networks. IDS and IPS watch for signs of attack, with the unavoidable trade-off between false positives and false negatives. Segmentation and VLANs limit movement once an attacker is inside, and zero trust drops the idea that being on the network is proof of trust. Each layer has limits that NIST documents plainly, which is why none of them works alone.
Keep these points:
- Firewall = controls traffic between networks with different security postures. Types: packet filter, stateful, application, application-proxy, WAF, host-based.
- Deny by default.
- DMZ = a separate zone for public-facing servers, with the firewall still controlling traffic in and out.
- VPN protects the path, not the endpoints.
- IDS detects, IPS can block. Both have false positives and false negatives.
- Segment inside as well as at the edge. A VLAN is not a security boundary by itself.
- Zero trust: no implicit trust from network location.
- NAT is not a firewall.
Related: segmentation, defence in depth and zero trust are part of the wider set of Security Design Principles.