Routing, NAT and firewalls

Unit 4 of 5 in Networking fundamentals.

You will be able to explain what a router, NAT and a firewall each do to a packet and why a firewall should deny by default.

Lesson

Routers move packets between networks

A router is a device that performs the network-layer forwarding function. Older documents called these devices gateways. The selection of a path for a datagram is called routing, and each router along the way looks at the destination address and passes the datagram on toward it.

Your own machine makes the same kind of choice for every packet it sends, and the routing-table lab in this unit lets you see it.

NAT: sharing one public address

Private addresses cannot be used on the public internet, so something must translate them. Basic NAT maps IP addresses from one group to another. Network Address Port Translation maps many addresses and their ports into a single address and its ports. Together they connect a realm of private addresses to an external realm of globally unique addresses.

Many organizations use private addresses inside because most internal hosts never need to be reached from outside, and some use gateways so that only a few systems are visible from the internet.

Firewalls: rules about what may pass

NIST defines firewalls as devices or programs that control the flow of network traffic between networks or hosts that have differing security postures. The most basic feature is the packet filter. Older firewalls that were only packet filters did not keep track of the state of each flow, so they could not associate multiple requests in a single session. Stateful inspection improves on this by tracking the state of connections and blocking packets that deviate from the expected state.

NIST also notes that a firewall at the edge protects internal hosts only in part: it cannot recognize all forms of attack, and attacks from one internal host to another often never pass through a network firewall. That is the reason for host-based firewalls and for splitting a network into zones.

Deny by default

For the firewall policy, NIST recommends blocking traffic the organization does not need. This practice is called deny by default. It decreases the risk of attack, can reduce the volume of traffic on the network, and is described as more secure than permitting everything that is not explicitly forbidden, because hosts, networks and applications keep changing.

NIST lists NAT among the technologies many firewalls use to hide internal addresses. The packet filter is the part NIST describes as providing access control for host addresses and communication sessions, so treat address hiding as a side effect and not as a substitute for a rule set.

Key points

Sources

Lecture

Network segmentation and zero trust: A talk on splitting a network into zones and what zero trust adds, the next step after this unit.

Practice in the labs

Trace how a packet leaves your machine, then build a host firewall that denies by default.

Also try, in the simulators

Knowledge check

  1. What is the function of a router? Answer: It performs the network-layer forwarding function toward the destination address. RFC 1812 describes routers as devices that perform the network layer forwarding function of the Internet protocol suite.
  2. What does 'deny by default' mean for a firewall? Answer: Block traffic the organization does not need and allow only what is required. NIST SP 800-41 describes blocking traffic that is not needed as deny by default and says it is more secure than permitting all traffic that is not explicitly forbidden.
  3. Why is an edge firewall alone not enough? Answer: Attacks between internal hosts often do not pass through it. NIST notes perimeter firewalls cannot recognize all attacks, and attacks sent from one internal host to another often do not pass through network firewalls.

Back to the syllabus or see all classes.

Related