Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

DI 2.13: Firewall rules and address translation

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

60 minutes

A private street with one front door

Imagine a street of houses with private numbers: 1, 2, 3. Letters from outside cannot use those numbers. They are all sent to one front door, and a clerk sorts them.

A gateway works like that clerk. It also has a list of rules saying who may come in.

Today you set up both.

Key words

WordWhat it means
Firewalla device or program that allows or blocks traffic by rules
Porta number that says which service on a computer the traffic is for
Protocolan agreed set of rules for sending data
NATnetwork address translation: changing addresses as traffic passes a gateway
MasqueradeNAT where private addresses are swapped for the gateway's own
Port forwardingsending outside traffic for one port to a device inside
Gatewaythe device between a private network and the outside
Load balancera device that shares requests between servers
Private addressan address used inside a network, not on the open internet
DNSa service that turns a name into an address
Packeta small piece of data sent over a network
Networkcomputers and devices joined so they can share data
IP addressthe number that identifies a device on a network

The cells students fill in are left blank in this preview.

By the end of this lesson

Note

I can choose ports and protocols for a firewall, apply a rule, set up address translation and port forwarding, and test them.

Starter

Have a go

Starter

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Ports and protocols you will meet

PortProtocolWhat it is forAllow it when
80HTTP over TCPWeb pages, not encryptedYou run a public web page
443HTTPS over TCPWeb pages, encryptedYou run any web site
22SSH over TCPSecure remote command lineStaff manage a server remotely
53DNS over UDP and TCPTurning names into addressesDevices need to look up names
67 and 68DHCP over UDPGiving out addressesOnly inside the network that gives them
25SMTP over TCPSending email between serversYou run a mail server

The cells students fill in are left blank in this preview.

The rule that is already there

The gateway starts with a short firewall. The rule list says: drop everything that is passing through, except replies and anything that starts inside the LAN.

That is the safe way to build a firewall. Block first, then allow only what you need.

Press Start the lab. Then ask the outside server for its page from the LAN.

Ask the outside server for a page

Command
sudo ip netns exec lan curl -s --noproxy '*' -m 3 http://203.0.113.2:8000/

A command for the lesson’s lab terminal. It is shown here and not run.

The lesson goes on

17 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.