Choosing a Mode
Conflux runs a machine in one of three modes: conflux up gives the host a network interface, conflux proxy publishes chosen ports without one, and conflux observe inventories the host's traffic without joining a realm.
The Three Modes
up and proxy each run an anchor and connect the machine to its realm. They differ in what the host gets, and so in how programs on the machine use the overlay. observe runs no anchor and joins no realm. It records the cryptography of the host's own traffic.
TUN mode
conflux up runs in TUN mode. It creates a network interface on the host, and the host owns the overlay addresses. Every program on the machine, from ping and ssh to a browser, can use the overlay without changes.
To publish a service in TUN mode, bind it as you would on any network. On Linux and Windows, the anchor names the interface after itself: anchor and the start of its AnchorID, such as anchor6btpa3gn6. To choose another name, pass --interface NAME. macOS names it utunN and the BSDs tunN, and the system chooses the number. The interface row of conflux status shows the actual name.
Proxy mode
conflux proxy runs in userspace mode. It creates no interface, and nothing on the host can see the overlay addresses. Peers reach only the ports you publish, and the anchor passes each connection to a backend that the machine can reach.
Proxy mode is not an HTTP proxy. It publishes any TCP or UDP service, such as a database, DNS, SSH or a message broker. Each published port answers at the machine's overlay IPv4 address and at its IPv6 address, as on a VPN.
A proxy machine can still act as a subnet router or exit node. The anchor forwards that traffic from its own process, so the destination sees this host's address. The anchor needs no privilege, and you need root only to register the boot service.
Observe mode
conflux observe runs the observer and no anchor. The host copies the start of every flow to anchord, which reads each handshake. It records whether each key exchange is post-quantum, hybrid, classical or absent. Nothing is enrolled, and no credential is needed.
The observer reads a copy, so it can't slow down or break a connection. To run it next to an anchor instead, add --observe to up or proxy. See Observing Traffic.
With conflux up, the host owns the overlay addresses on an interface named after the anchor, such as anchor6btpa3gn6, and every program on the host can use them. With conflux proxy, the anchor owns the overlay addresses itself, IPv4 as well as IPv6, and no interface appears on the host. Peers reach only the TCP and UDP ports you publish, and the anchor opens a new connection to the backend for each one.
Quick Start uses up, which suits a laptop. A server that only publishes ports can run proxy instead, and then nothing changes on the host.
To run up or proxy with nothing written to disk, add --ephemeral. It is a way to run either mode, not a fourth mode. See Ephemeral Runs.
Comparing the Modes
This table compares the three modes:
| conflux up | conflux proxy | conflux observe | |
|---|---|---|---|
| What the host gets | A TUN interface for ping, ssh and every other program | Nothing | An inventory of its own traffic's cryptography |
| What the realm gets | This machine, at an overlay address | The services you name, at overlay ports, and any subnet or exit it routes | Nothing: no realm is joined |
| Privilege | Root, CAP_NET_ADMIN, or Administrator | Root only to register the boot service | Root only to register the boot service |
What anchord runs with | Its own account with CAP_NET_ADMIN on Linux; root on macOS and the BSDs; SYSTEM on Windows | Its own account with no privileges; LOCAL SERVICE on Windows | Its own account with capture access: CAP_NET_RAW on Linux and /dev/bpf* on macOS; LOCAL SERVICE on Windows |
| Needs a credential | Yes | Yes | No |
| An IPv4 address | Yes, on the host's interface | Yes, inside the anchor; peers reach published ports at it, as on a VPN | Kept for the next up or proxy |
| Protocols | Anything bound on the interface | Any TCP or UDP service; add /udp to the port for UDP | Records the handshake of every flow |
| Can connect out as a client | Yes | No: there is no interface to connect from | No: there is no overlay |
| Act as a subnet router | Yes: the host forwards | Yes: the anchor forwards from its own process | No |
| Serve or use an exit node | Yes | Yes; using one covers only the anchor's own traffic | No |
| Run over an uplink | Yes | Yes | No |
| wintun.dll on Windows | Needed | Not needed | Not needed |
mode row in conflux status | tun — interface the anchor's own name: anchor and the start of its ID | proxy — userspace, no host interface | observe — this host's traffic inventoried; no anchor, no realm |
With --observe, the observer runs next to either kind of anchor, and anchord also gets the capture access listed in the observe column.
Which Mode to Choose
Choose a mode based on what the machine does:
- Choose up for any machine that connects out, such as a laptop, a workstation, a jump host or an application server that calls a database on another machine. A client always runs
up. - Choose proxy for a machine that only offers services, or where
CAP_NET_ADMINis not available, such as a container, a CI runner or a locked-down host. Proxy mode changes nothing on the host. - Choose observe to inventory the cryptography a host's traffic negotiates, on a machine that does not join the overlay. To inventory a machine that runs an anchor, add
--observetouporproxyinstead. - Either anchor mode can act as a subnet router or exit node, and can reach the realm over the host's network or over a serial cable.
The mode decides what the machine gets from the realm. The medium decides how the anchor reaches the realm. By default the medium is the host's IP network, but it can also be a serial cable that you name with --uplink.
For up and proxy, the two choices are independent, so all four combinations work. Uplinks run on Linux, macOS and the BSDs:
| Over the host's network | Over a cable | |
|---|---|---|
up | sudo conflux up | sudo conflux up --uplink /dev/ttyUSB0:115200 |
proxy | sudo conflux proxy 8080=127.0.0.1:3000 | sudo conflux proxy 8080=127.0.0.1:3000 --uplink /dev/ttyS1 |
To publish from each mode, see Publishing Services. To set up the cable, see Serial Uplink.
Switching Modes
To switch modes, run the command for the mode you want. Conflux replaces the current mode and tells you that it has done so.
$ sudo conflux proxy 8080=127.0.0.1:3000 conflux: this machine was running in TUN mode. Userspace mode replaces that: one daemon holds one anchor, and an anchor with a host interface cannot also serve a reverse proxy -- with a TUN the kernel owns the overlay address, so a service binds it directly and needs no proxy.
A switch keeps the identity, so the machine keeps its AnchorID and overlay address. It also keeps every setting that both anchor modes use: the subnets, the exit settings, the IPv4 address, the taints, the uplink, the starting peers, the port and low-latency mode.
Switching to up clears the proxy specs, because only proxy mode serves them. To turn routing off in either mode, pass --no-subnet, --no-serve-exit or --no-use-exit.
Switching to and from observe
If you run conflux observe on a machine that runs an anchor, it stops the anchor, and the machine leaves its realm. At a terminal, conflux asks you to confirm first:
$ sudo conflux observe This machine runs an anchor (a network interface). Observing alone stops it: the machine leaves its realm until the next conflux up or proxy, which come back with the identity and settings kept. conflux up --observe or conflux proxy --observe observes beside the anchor instead, and conflux anchorctl observe reports on a running observer. Stop the anchor and observe? [y/N]
In a script, pass --yes. Without it, conflux refuses and stops nothing. The switch clears the proxy specs, as up does, and keeps the identity and every other setting.
To go back, run conflux up or conflux proxy. The anchor starts next to the observer, which stays on. To turn the observer off, add --no-observe.