Glossary

Perimeter Firewall

A perimeter firewall sits where an internal network meets the outside world and decides which traffic may cross that boundary in each direction.

What is the perimeter in a perimeter firewall?

Picture an office or a server room with one cable to the internet. Everything on the inside is considered yours, everything outside is not, and the device on that cable is the checkpoint. It drops unsolicited inbound connections, lets internal machines start outbound sessions, and allows a short list of published services, for example a mail gateway or a public website. For decades this castle-and-moat layout was the core of network security: harden the wall, and the inside can be relatively relaxed.

How does a perimeter firewall decide what to allow?

Classic devices work with ordered rules that match on source and destination addresses, protocol and port, combined with connection tracking. Connection tracking is what makes a firewall stateful: once an inside host opens a session to a web server, the reply packets are recognized as part of that session and let through, while a fresh connection attempt from outside meets the default rule, usually drop. Rules are read top to bottom, the first match wins, and a final catch-all denies whatever was not explicitly allowed.

What is a DMZ?

A demilitarized zone is a separate segment for machines that must accept connections from the internet. The perimeter firewall has three legs: outside, DMZ and inside. The internet may reach the web server in the DMZ on 443, the web server may reach one database port on the inside, and nothing from outside reaches the inside directly. If the public server is compromised, the attacker is still behind a second set of rules. Larger designs stack two firewalls from different families for the same effect.

Why did the perimeter idea weaken?

  • Remote work: laptops spend most of their time outside the wall and connect back over tunnels.
  • Hosted services: mail, files and business apps moved to providers that never sit behind your edge device.
  • Encrypted traffic: nearly everything is TLS now, so a packet filter sees ports and addresses but not content.
  • Lateral movement: once one inside machine is phished, a flat trusted network lets the attacker roam freely.

These shifts led to identity-based models; ZTNA describes the main one. The perimeter did not disappear, it shrank to each host and each service.

Where is the perimeter on a rented dedicated machine?

On a single box the perimeter is the machine itself. Our network filters volumetric attacks at the edge (Edge DDoS filtering), but which ports are open is your decision, made with the host firewall. Treat the public interface as the outside leg and the loopback interface as the inside. Services that only the machine needs, like a database or a cache, listen on 127.0.0.1; services the world needs listen on the public address with explicit allow rules.

ufw default deny incoming      # nothing reaches the box unless listed
ufw default allow outgoing     # updates, backups and API calls still work
ufw allow from 198.51.100.0/27 to any port 22 proto tcp comment 'office SSH'
ufw allow 443/tcp comment 'public site'
ufw enable
ufw status numbered

On AlmaLinux or Rocky Linux the same boundary is built with firewalld zones; the Rocky Linux page includes a starter set.

How do I build a perimeter across several machines?

With no private network between our machines, the boundary between them is built from tunnels. Give each box a WireGuard interface, allow database and replication ports only on that interface, and keep the public side as small as on a single machine. One machine can also act as a gateway in front of others: it holds the only public web listener and forwards to backends over the tunnel, much like a DMZ host. VPN shows the tunnel setup.

How do I check what my perimeter really exposes?

Look from outside, not from the machine. From a second computer run nmap -Pn -p- --min-rate 2000 203.0.113.80 and compare the open ports with your list of intended services. On the host, ss -lntu shows every listener with its bound address, so anything on 0.0.0.0 or the public IP that you did not plan for is a candidate to close. Repeat the outside scan after every new install; package installs on some distributions start services immediately.

What about outbound rules?

Most single-server setups allow all outgoing traffic, and that is a reasonable start. Tightening it pays off on machines that hold sensitive data: a database box rarely needs to open connections to arbitrary hosts, so limiting it to package mirrors, the backup target and the time servers makes data theft and malware callbacks far harder. Build the allow list by watching real traffic for a few days with ss -tnp state established or a logging rule, then switch the outbound default to drop. Keep DNS and NTP in the list, or updates and certificate renewals will fail in confusing ways.

Which hardware suits a gateway machine?

Packet filtering at a few gigabits barely touches a modern CPU. The S1 with 2x 10 Gbps ports makes a capable gateway for a small cluster, and the S13 adds 2x 25 Gbps links when the backends push more traffic than that.

Machines That Make Good Gateways

ServerProcessorCores / threadsMemoryStorageNetworkPer monthSmallest order
E1Intel Xeon E3-1240 v34 / 816 GB DDR32x 240 GB SSD2x 1 Gbps$30.52$91.56 (3 months)
S1Intel Xeon E-2276G6 / 1264 GB DDR41x 1 TB NVMe2x 10 Gbps$53.32$53.32 (1 month)
S2Intel Xeon E-2356G6 / 1264 GB DDR41x 1 TB NVMe2x 10 Gbps$58.39$58.39 (1 month)
S13AMD EPYC 4345P8 / 16128 GB DDR52x 2 TB NVMe2x 25 Gbps$237.92$237.92 (1 month)

Keep Reading

Firewall

What a firewall does, packet filters versus stateful and application firewalls, and the Linux tools that set the rules on a dedicated machine.

Open

Edge DDoS filtering

How common volumetric attacks are filtered at the network edge before they reach your ports, and what you still handle on the box.

Open

Data Center Firewall

Firewalls built for server halls: east-west segmentation, very high throughput and failover, and how the same goals are met on rented hardware.

Open

Rocky Linux

Rocky Linux 9, a free Red Hat compatible rebuild focused on staying bug for bug identical to its upstream.

Open

FAQ

Quick Answers

A firewall at the boundary between a trusted network and the internet that allows or blocks traffic crossing that boundary according to rules.

The network filters DDoS floods at the edge. Port-level rules are set by you on the machine with ufw, nftables or firewalld.

The DMZ holds servers the internet may reach. The inside holds systems that only accept connections from the DMZ or internal hosts.

Rarely on its own. Remote users and encrypted traffic mean each host and service also needs its own controls.

Connect them with an encrypted tunnel and allow internal service ports only on the tunnel interface.