Skip to content

Network and ports ​

What has to be reachable, on which machine, and what each package opens for you. A standard deployment needs no firewall opened by hand, on any machine, before or after a reboot, and nothing is opened beyond the private networks your machines are on.

The five ports ​

PortListenerWho connectsCredential
7443coordinator control planeagents, the api, service credentialsmTLS
7444coordinator enrolmenta machine enrolling, oncea join token, then mTLS
7446coordinator operator planepeople, at the CLI or in the consoleTLS and a session
7445node data listenerthe api machine, and peer nodes when a model is splitmTLS
8443public APIyour applicationsa bearer API key over TLS

The operator plane is bound only when it is configured, and a node's data listener only while that node holds a slice. A machine that is not computing listens on nothing.

Where they listen: private addresses and the loopback ​

A listener configured on 0.0.0.0, the default, binds the machine's private addresses and the loopback, never a public address. A cloud machine with a public and a private address is reached on the private one only, firewall or not. A machine with no private address listens on the loopback alone, and the install prints the line that changes it. To listen on every address, public ones included, say so: listen_public = true in coordinator.toml, DIFFUSE_API_LISTEN_PUBLIC=1 in api.env, data_listen_public = true in agent.toml. An address configured explicitly is bound as written.

When no firewall is active, firewall status and the install say so first, in one sentence: the addresses the ports listen on are then the only thing keeping them off the Internet.

What each package opens, machine by machine ​

Each package opens what its machine needs reachable when it is installed, through ufw or firewalld, to the private networks the machine is on, and to nothing else. Both save their rules, so the rules are back after a reboot.

MachinePackageOpensWhyWhat opening it exposes
the coordinator'sdiffuse-coordinator7443every node's heartbeats, slices, training work and renewalsnothing to a peer without a client certificate from your deployment's authority
7444a machine joining with a tokena listener that accepts join tokens; close it once the park is built
7446the console, and people signing in from the CLIa sign-in page; every action needs an account
8443the OpenAI-compatible APIthe product; every call needs an API key
every machine that computesdiffuse-node-agent7445the api, and the other machines of a split pipeline, send it the model's trafficnothing to a peer without a certificate from your deployment's authority

What each package does, by firewall:

  • ufw or firewalld, on: the rules are added through them, beside yours, each naming the network it lets in.
  • ufw or firewalld installed and off: the rules are registered anyway, so turning the firewall on later does not cut Diffuse off.
  • nftables or iptables rules written by hand: nothing is changed. A rule inserted into a policy the product did not write could reorder or shadow one of yours, so the exact command is printed for you to type.
  • No firewall at all: there is nothing to open, and the install says so.

Each install ends by listing its ports and their state. On the coordinator the opening is also on the audit trail (diffuse-coordinator audit --action firewall.open), and licence set lists the ports again. At any time:

bash
sudo diffuse-coordinator firewall status     # on the coordinator's machine
sudo diffuse-node-agent firewall status      # on a machine that computes

Install opens, upgrade never does. A first install opens, and so does an install after apt purge. An upgrade leaves the firewall exactly as you left it, so enrolment you closed stays closed; if a port the version expects open is shut, the upgrade says so and gives the command.

The default: the machine's local networks only ​

The private networks the machine is on, read from its interfaces when the rules are written, and nothing else: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, IPv4 link-local, and IPv6 unique local and link-local. An interface with a public address gets no rule, so on a machine that has one the ports are not on the Internet. A bridge on the machine, Docker's for instance, is a private network too.

A private network reached through a route counts. Some clouds, Hetzner Cloud among them, give each machine a /32 private address and reach the private network through a route. local reads the routes of the interfaces that hold a private address and lets in the private network they reach, for example 10.0.0.0/16 (enp7s0), not only the machine itself. --from naming a single address warns that it lets in only that machine.

7443  control plane: heartbeats and slices, mTLS         from 192.168.178.0/24 (wlan0)

Widening or narrowing: --from, and DIFFUSE_FIREWALL_FROM at install ​

firewall open --from takes local, a network, or any, alone or separated by commas; at install the same words go in DIFFUSE_FIREWALL_FROM. The choice is remembered, so a later firewall open without --from keeps it.

--fromLets inChoose it whenWhat it exposes
local (the default)the private networks the machine is oncoordinator and nodes share one local network: the standard deploymentyour local network, nothing beyond it
local,10.20.0.0/16those, and one more networksome machines, or the applications calling the API, are behind a router: another building, a VPNthat network too
10.20.0.0/16only that networknarrowing: a machine on several networks where only one should reach Diffusethat network only, not the machine's other local networks
141.20.0.0/16a public network you namea university network with public addressesthat network
anyevery sourceyou filter elsewhere, in front of the machineon a machine with a public address, the Internet: 8443 and 7446 to anyone, 7444 accepting join tokens from anyone, 7443 and 7445 to anyone's TLS handshake. Each still needs its key, account, token or certificate, but the ports can be scanned and flooded
bash
# on the coordinator's machine
sudo diffuse-coordinator firewall open --from local
sudo diffuse-coordinator firewall open --from local,10.20.0.0/16
sudo diffuse-coordinator firewall open --from 10.20.0.0/16
sudo diffuse-coordinator firewall open --from any

# on a machine that computes: the same words
sudo diffuse-node-agent firewall open --from local
sudo diffuse-node-agent firewall open --from local,10.20.0.0/16

# at install, before any rule exists
sudo DIFFUSE_FIREWALL_FROM=local,10.20.0.0/16 apt-get install ./diffuse-coordinator_amd64.deb
sudo DIFFUSE_FIREWALL_FROM=10.20.0.0/16 apt-get install ./diffuse-node-agent_cpu_amd64.deb

The rules the product removes are only the ones it wrote, never one of yours.

Refusing it all: DIFFUSE_NO_FIREWALL=1 ​

Install with DIFFUSE_NO_FIREWALL=1, on either package, and the firewall is left alone:

bash
sudo DIFFUSE_NO_FIREWALL=1 apt-get install ./diffuse-coordinator_amd64.deb
sudo DIFFUSE_NO_FIREWALL=1 apt-get install ./diffuse-node-agent_cpu_amd64.deb

The ports are still listed with the commands that would open them, and on the coordinator the decision is on the audit trail.

The commands, on each machine ​

CommandCoordinatorMachine that computesWhat it does
firewall statussudo diffuse-coordinator firewall statussudo diffuse-node-agent firewall statusevery port, open or not, from where, and the command that would change it; changes nothing
firewall open [--from …]sudo diffuse-coordinator firewall opensudo diffuse-node-agent firewall openputs the rules right for the networks the machine is on now; adds before it removes, and removes only the product's own rules
firewall close-enrolmentsudo diffuse-coordinator firewall close-enrolmentnone: a machine that computes has no enrolment portremoves every rule for 7444, and records it on the audit trail

When a machine changes network or address ​

The rules name networks and the coordinator's certificate names addresses. A new address on the same network changes no rule, but a node that registered at the coordinator's old address no longer finds it. Give the coordinator a fixed address, a DHCP reservation in the router, and none of this is needed for it. A machine that computes announces the address it had when its agent started: after its address changes, restart its agent, or give it a reservation too. When a machine moves to another network, firewall status says what no longer matches, and nothing is put right by itself:

bash
# on the coordinator's machine
sudo diffuse-coordinator firewall open        # the rules, for the networks it is on now
sudo diffuse-coordinator certificate renew    # its certificate, for the addresses it has now

# on each machine that computes
sudo diffuse-node-agent firewall open
# on one that registered at the coordinator's old address
sudo diffuse-node-agent config set-coordinator https://192.168.20.5:7443
# then, so that it announces its own new address
sudo systemctl restart diffuse-node-agent

No machine is enrolled again. Nodes trust the deployment's root, which does not change; certificate renew issues only the coordinator's own certificate, and needs the root key once.

Enrolling by address ​

A node registers where it enrolled: by the coordinator's name, or by its address. On a network that does not resolve the coordinator's name, enrol by its address, which token create prints:

bash
sudo diffuse-node-agent enroll --endpoint https://192.168.178.20:7444 --token DFE1-7QW2M4ZP-...

The coordinator's certificate names every address on its interfaces, so the connection is verified by address, with no name service.

On an all-in-one machine, only 8443 needs to leave the box: bind the rest to 127.0.0.1 and no rule is written for them.

Who starts each connection ​

Every control connection is opened by the machine that computes. Enrolling, registering, heartbeats, fetching a slice, training work and renewing a certificate all go from the agent to the coordinator. The coordinator never connects to a machine that computes.

The data plane is the exception, and it is why a node opens 7445. The api connects to port 7445 on the machine that holds the first slice of a model. When a model is split across several machines, that machine connects to 7445 on each of the others. A machine that serves a model accepts connections on 7445, even when it holds the whole model. A version in which machines that compute accept no connection at all is designed and has not shipped; estates that require it refuse the opening with DIFFUSE_NO_FIREWALL=1 until it does.

Port by port, by topology ​

TopologyCoordinator machineApi machineEach machine that computes
everything on one machine8443 from your applicationsthe same machinethe same machine
coordinator and api together7443 and 7444 from your machines, 7446 from operators, 8443 from applicationsthe same machine7445 from the api machine
a model split across machinesas abovethe same machine7445 from the api machine and every other machine of that pipeline
the api on a machine of its own7443 from the api machine as well8443 from applications7445 from the api machine

When a node's data port is shut ​

A node whose 7445 is shut enrols and shows as healthy, because every connection it makes is outbound. It fails when it is first asked to serve. The developer calling the API is told what happened and whether to retry, never an address or a command:

503 node_unavailable: "qwen2.5-3b" is served by a machine this server cannot reach:
the network between them does not let the connection through. This is a fault on
the server, not in your request, and retrying will not help until the operator
corrects it. Reference: chatcmpl-….

The operator finds the machine, the address, the port and the command under that reference, in the api's journal and on the audit trail:

bash
sudo journalctl -u diffuse-api | grep chatcmpl-…
sudo diffuse-coordinator audit --action inference

A machine that is switched off is told apart: the caller reads that it is not connected and to retry in a minute, because it answers again the moment it is back.

Enrolment: open by default, closed once the park is built ​

When every machine has joined, close enrolment. It is the right move once the park is built: a listener that accepts join tokens from your whole network is only worth having while machines are joining.

bash
sudo diffuse-coordinator firewall close-enrolment

By hand, the same thing, for each network firewall status lists on 7444:

bash
# ufw
sudo ufw delete allow from 192.168.178.0/24 to any port 7444 proto tcp

# firewalld
sudo firewall-cmd --permanent --remove-rich-rule='rule family="ipv4" source address="192.168.178.0/24" port port="7444" protocol="tcp" accept'
sudo firewall-cmd --reload

Without a firewall, bind the listener to the coordinator itself in /etc/diffuse/coordinator.toml, then restart it:

toml
provisioning_listen_addr = "127.0.0.1:7444"

What closing it does not affect ​

New enrolments stop, and nothing else changes. A machine that has already joined registers, sends heartbeats, fetches its slices, runs training and renews its certificate over connections it opens to 7443. Closing 7444 leaves the park exactly as it was. Reopen it the day a new machine joins, with sudo diffuse-coordinator firewall open.

Closing 7443 empties the pool, since every heartbeat arrives there. Closing 8443 makes no sense: the API is the product.

Checking two real computers ​

What the release tests prove in containers, to run on two real machines. A is the coordinator, B the node; both have a firewall on with a DROP policy (sudo ufw enable). Replace A and B by the machines' names or addresses.

#WhereCommandExpected
1Bnc -zv -w 4 A 7443times out: A's firewall drops it (the control)
2Asudo apt install ./diffuse-coordinator_amd64.debthe ports table: 7443, 7444, 7446, 8443 each from <A's network>, and the ufw allow from ... commands it ran
3Asudo ufw statusthe four ports ALLOW from A's network, never Anywhere
4Asudo diffuse-coordinator licence set licencethe licence, the console address, and the same four ports
5Bnc -zv -w 4 A 7444succeeded
6Bsudo apt install ./diffuse-node-agent_cpu_amd64.deb7445 ... from <B's network> and the rule it ran
7Asudo diffuse-coordinator token create --pool wifi --max-uses 1 --ttl 1ha DFE1-... token, and A's address
8Bsudo diffuse-node-agent enroll --endpoint https://<A's address>:7444 --token DFE1-...This node is in the pool., with no name service needed
9Bsystemctl is-enabled diffuse-node-agentenabled
10Asudo diffuse-coordinator nodesB healthy
11Asudo diffuse-coordinator model pull qwen2.5:0.5bthe download, with its percentage
12Asudo diffuse-coordinator model serve qwen2.5-0.5b --pool wifia slice on B
13Asudo diffuse-coordinator apikey create --name checka dfe_sk_... key
14Aa chat request to https://127.0.0.1:8443/v1/chat/completions asking "What is the capital of France? Answer with one word."Paris
15bothsudo rebootnothing else typed until 18
16Asudo ufw status, systemctl is-active diffuse-coordinator diffuse-apithe four rules; active twice
17Bsudo ufw status, systemctl is-active diffuse-node-agentthe 7445 rule; active
18Asudo diffuse-coordinator nodes, then the request of 14B healthy within two minutes; Paris again
19Bsudo ufw delete allow from <B's network> to any port 7445 proto tcp && sudo systemctl restart diffuse-node-agentthe break, on purpose
20Athe request of 14503, no address and no command in it, and a Reference: chatcmpl-…
21Asudo journalctl -u diffuse-api | grep <that reference>B's name, its address, port 7445, and sudo diffuse-node-agent firewall open
22Bsudo diffuse-node-agent firewall openthe rule is back; the request of 14 answers again

On firewalld, read sudo firewall-cmd --list-rich-rules where the table says sudo ufw status. When A has a public address, one more line proves the rules do not reach beyond your network: from outside it, nc -zv -w 4 <A's public address> 8443 times out. The installation guide carries the same table with the full commands.


Deployment - Surfaces and threat model

Diffuse Enterprise is commercial software. Diffuse Open is AGPL-3.0.