Network security for internet-facing servers
Network security protects the traffic to, from and between your systems. For rented servers on the public internet it is a set of layers, each catching what the one before it lets through.
What does network security cover?
Controlling who can reach which services, keeping traffic private and unaltered in transit, keeping services available under attack, and noticing when something unusual moves across the wire. In an office that includes switches, Wi-Fi and VPN gateways; for servers in a data centre it centres on the public interface of each machine and the links you build between them.
What are the layers on a rented server?
| Layer | Control | Stops |
|---|---|---|
| Network edge | DDoS filtering, included and always on | Volumetric and protocol floods |
| Host | nftables, firewalld or ufw with default deny | Connections to services you did not open |
| Transport | TLS for services, WireGuard between servers | Eavesdropping and tampering |
| Service | Authentication, rate limits, bind addresses | Misuse of open ports |
| Detection | Flow and log monitoring, alerts | Undetected intrusions and leaks |
How do I segment servers without a private network?
Build the segment yourself. We do not sell a private network between servers, so every machine has only its public port. A WireGuard mesh gives each server a private address, such as in 10.10.0.0/24 or an IPv6 unique local range, and encrypts everything between them. Databases, caches, queues and admin interfaces then listen only on those tunnel addresses, while the public side exposes just the web, game or mail ports. This is in some ways stronger than a plain private network, since traffic between servers is encrypted by default.
[Interface] Address = 10.10.0.3/24 ListenPort = 51820 PrivateKey = (from wg genkey, kept in /etc/wireguard with mode 600) [Peer] PublicKey = (db01 public key) AllowedIPs = 10.10.0.2/32 Endpoint = 203.0.113.71:51820
How small can the public footprint be?
Only those your users need, and SSH only from where you work. Review exposure regularly from outside, not from the server itself, because the host's view does not show what the internet sees. A scan from another machine, compared with a list of intended ports, catches the debug service someone opened last month.
nmap -Pn -sS -sU --top-ports 200 203.0.113.71 -oG /root/exposure-$(date +%F).txt
Why encrypt traffic between my own servers?
Because it crosses networks you do not control. Even inside one data centre, traffic between two rented machines passes through shared switching equipment. TLS on every service and WireGuard between hosts mean that a captured packet reveals nothing and a modified one is rejected. It also removes a whole class of audit questions.
How do I spot unusual traffic?
Know what normal looks like. Record per-host traffic volumes and the set of destinations each server talks to, and alert on large departures: a database host sending gigabytes to an unknown address, a web server opening outbound SSH connections, or a spike in refused connections. Tools such as vnStat give quick history on one host; Zeek or flow exporters give richer data for larger estates. Ports in Europe and Canada are unmetered, so watch volume yourself, since no bill will flag it.
vnstat -i enp1s0f0 -d 7
conntrack -L -p tcp --dport 22 2>/dev/null | awk '{print $5}' | sort | uniq -c | sort -rn | head
How does DNS fit into network security?
It is part of the attack surface. Protect the registrar and DNS host accounts with strong authentication, use DNSSEC where your provider supports it, and publish CAA records so only your chosen certificate authorities can issue certificates for your names. Resolvers on your servers should validate DNSSEC and never answer queries from the internet. DNS poisoning explains the threats in more detail.
How should administrators reach the servers?
Through one controlled path. A common design keeps SSH closed to the world and open only on the WireGuard interface, with a small jump host or the administrators' own devices as tunnel peers. Losing a laptop then means removing one peer key, not rotating every server's firewall. Keep one emergency route that does not depend on the tunnel, such as SSH allowed from a single fixed office address, and remember that our console's rescue boot is always available if both fail. Log every administrative session centrally so you can later see who connected, from where and when.
What does this look like as a checklist?
Default-deny host firewall on every machine; management and data services only on tunnel addresses; TLS everywhere; regular outside scans; volume and destination alerts; locked-down DNS accounts. With those in place, the included edge filtering handles floods and your own layers handle the rest. What a firewall does, IT security basics and Company VPN gateways go deeper.
Related pages
What a firewall does
Firewalls explained from packets up: stateful filtering, default-deny policies, host and network firewalls, nftables examples and mistakes that lock you out.
Read moreCompany VPN gateways
Small, efficient machines for WireGuard and IPsec gateways that connect staff, offices and servers privately.
Read moreIT security basics
The parts of IT security that matter for a team running servers: identity, patching, network exposure, data protection, logging and a practised response.
Read moreDDoS protection on bare metal
How network edge filtering stops volumetric attacks before they reach your port, and what you still handle yourself.
Read moreQuestions and answers
What is network security?
Controls that decide who can reach which services, keep traffic private and intact, keep services available and detect unusual activity.
Do your servers have a private network?
No. Build one with a WireGuard mesh over the public ports; it also encrypts all traffic between your servers.
Is DDoS protection enough for network security?
No. It stops floods. You still need a host firewall, encryption, authentication and monitoring.
How do I check which ports my server exposes?
Scan it from another machine, for example with nmap, and compare the results with the ports you intend to have open.
Should traffic between my own servers be encrypted?
Yes. It crosses shared equipment, so use TLS for services and WireGuard between hosts.