What the network can see: inventory before firewall rules
Correlate listeners with owners, consumers, and actual reachability.
Before configuring a firewall, list what it must allow. The familiar “SSH, HTTP, and HTTPS” list can miss a dependency or preserve unnecessary access. A VPS may run services for readers, administrators, local processes, and a separate private network. These cannot automatically belong to one access class.
An inventory combines two sources: what the system actually listens on and what the products require. The first alone only describes current state. The second alone leaves discrepancies unnoticed.
A practical inventory of the E-01 learning VPS
On the learning VPS, I inspected IPv4 and IPv6 sockets, addresses, and routes separately. The inspection commands did not change configuration, packages, or services. The two ss selections contained 11 sockets in total: 11 records, rather than 11 distinct services.
sudo ss -H -4 -lntup
sudo ss -H -6 -lntup
| Service / client | Family and protocol | Binding and count |
|---|---|---|
| Local DNS for VPS processes | IPv4, TCP and UDP, port 53 | Loopback: two TCP and two UDP sockets |
| Network interface DHCP client | IPv4, UDP, port 68 | Interface address: one socket |
| LLMNR, local name resolution | IPv4 and IPv6, TCP and UDP, port 5355 | Wildcard: four sockets |
| SSH for the administrator | IPv4 and IPv6, TCP, port 22 | Wildcard: two sockets |
The processes were correlated with ssh.service, systemd-resolved.service, and systemd-networkd.service. Observing LLMNR does not yet mean deciding to keep it exposed. The DHCP client should not be treated as a public server for readers either.
ip -4 -o address show scope global
ip -4 route show default
ip -6 -o address show scope global
ip -6 route show default
Separate ip -4/-6 -o address show scope global and ip -4/-6 route show default commands showed an IPv4 address and both default routes. The IPv6 address command succeeded without output. An IPv6 route or a [::] socket alone therefore does not establish external IPv6 reachability. No external IPv6 check was performed here.
From an external observation point, only specific TCP connections to the learning VPS IPv4 address were tested, without application payloads: port 22 accepted a connection; 53, 80, and 443 refused it; 5355 ended in an OS timeout. These are results for one measured path. Refusal and timeout do not identify which layer caused them; external UDP was not tested.
The nft command is unavailable, and two iptables compatibility checks completed with empty output. This does not establish the absence of all kernel rules or provider policy. No firewall policy was applied at this stage.
A separate inspection of the working server confirmed the need to distinguish a trusted administrative route from ordinary public probes. Its topology and parameters are not transferred to the learning VPS.
Frames from the practical inventory


Start with listeners
On Linux with iproute2, an illustrative TCP and UDP review can start with:
sudo ss -lntup
The ss manual documents socket inspection. This example selects listeners, numeric output, TCP, UDP, and process information. Visibility of process details depends on privileges. UDP has a different state model: absence of TCP’s familiar LISTEN state does not mean a UDP service is absent.
Correlate protocol, local address, port, and process. A port alone does not determine purpose: a service can use a nonstandard value. A process name also needs its configuration and owner checked.
A loopback listener is generally intended for local access in that network namespace. Binding to all addresses expands the receiving surface but does not establish external reachability. Routing, local rules, NAT, and provider policy also affect the path.
Account for the runtime environment
Inspecting the main network namespace does not automatically describe every container. Publishing a container port may use redirection and forwarding rules. Unix sockets are separate: they are not TCP ports, but their permissions matter for local boundaries.
Establish whether IPv6 is used. Lack of IPv4 access says nothing about IPv6, and vice versa. Whether an IPv6 socket serves both families depends on configuration; do not infer it from a short address display.
Build a matrix of required access
Each receiving endpoint needs an owner, consumers, and a reason for access. This hypothetical example does not define Solution200’s topology:
| Role | Expected consumer | Decision to review |
|---|---|---|
| Public web entry | Journal readers | Allow agreed public traffic |
| Administrative SSH | Defined management route | Preserve and verify fresh login |
| Application database | Local or defined private client | Do not allow arbitrary public access |
| Metrics exporter | Defined monitoring system | Restrict according to actual collection method |
| Unknown service | Not established | Identify owner and need before writing a rule |
Being open today is insufficient justification for staying open. Equally, do not immediately close an unknown production port: first establish its dependency and impact. Sometimes changing the service’s own binding is preferable to merely hiding it behind filtering.
Account for direction and trust boundaries
A local service may contact an external service. That does not make its listening port public. A public web entry likewise does not require exposing every internal dependency to the internet. Distinguish the connection initiator from the receiving side in the matrix.
Suppose a reader contacts the web layer, which reads the database locally. These need different permissions at different boundaries. Broad public database access is not an inevitable consequence of launching a website. If an authorised private client is added later, explicitly add and separately verify that requirement.
Monitoring also needs a known operating model. One mechanism reads an exporter from another machine; another sends data outward itself. The word “monitoring” does not determine an inbound permission. A rule must match the actual consumer rather than the capability’s name.
Return an unknown service to its owner
When you find an unexpected listener, establish its startup mechanism and owner first. It might be a forgotten test process or a dependency of required work. Without that answer, neither preserving exposure nor declaring the service unnecessary is justified.
Investigation should end in a decision: preserve required access, narrow a binding, change configuration, or remove an unnecessary process. Each decision needs its own check. After narrowing a binding, confirm the intended client and absence of the unnecessary route; after removal, verify dependent scenarios.
An inventory is not permanently correct after its first review. An ordinary deployment can add a new receiving path. Update the matrix and compare it with policy when network needs change. This reveals discrepancies while their cause is still understandable.
Compare local state with reachability
From an authorised control point, test the specific expected path. This is a narrow check of your own system, not a scan of third-party addresses. A public service needs a request using its protocol; administrative access needs a fresh connection from the appropriate source.
A negative test needs interpretation too. A timeout can result from filtering, routing, or a missing response. Connection refusal can mean there is no listening service rather than that a rule protects it. Read local state, rules, and external observations together.
Record the network namespace, observation point, and order of checks. Update the inventory after adding a service, publishing a container port, or changing a binding. This matrix underpins the next article on default-deny: every permission has a reason, and every check has a specific expected result.