VeilNet

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.

Fig. 01 — What each mode gives the host
HOST · CONFLUX UPsshpingbrowserKERNEL · anchor6btpa3gn6fd80:… · 10.128.0.1TUN · IP PACKETSanchordVIRTUAL KERNELROUTES · HOST NIC ⇄ MESH NICNEEDS ROOT OR CAP_NET_ADMINHOST · CONFLUX PROXYsshpingbrowserNO INTERFACE · HOST SEES NOTHINGSERVICE · 127.0.0.1:3000NEW CONNECTIONanchordVIRTUAL KERNEL10.128.0.5 · [fd80:…]TCP + UDP · NO TUN · NO PRIVILEGEETHERNET FRAMESETHERNET FRAMESTHE SWITCH · THE REALMPEERS REACH ANY PORT BOUNDPEERS REACH THE NAMED PORTS

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 upconflux proxyconflux observe
What the host getsA TUN interface for ping, ssh and every other programNothingAn inventory of its own traffic's cryptography
What the realm getsThis machine, at an overlay addressThe services you name, at overlay ports, and any subnet or exit it routesNothing: no realm is joined
PrivilegeRoot, CAP_NET_ADMIN, or AdministratorRoot only to register the boot serviceRoot only to register the boot service
What anchord runs withIts own account with CAP_NET_ADMIN on Linux; root on macOS and the BSDs; SYSTEM on WindowsIts own account with no privileges; LOCAL SERVICE on WindowsIts own account with capture access: CAP_NET_RAW on Linux and /dev/bpf* on macOS; LOCAL SERVICE on Windows
Needs a credentialYesYesNo
An IPv4 addressYes, on the host's interfaceYes, inside the anchor; peers reach published ports at it, as on a VPNKept for the next up or proxy
ProtocolsAnything bound on the interfaceAny TCP or UDP service; add /udp to the port for UDPRecords the handshake of every flow
Can connect out as a clientYesNo: there is no interface to connect fromNo: there is no overlay
Act as a subnet routerYes: the host forwardsYes: the anchor forwards from its own processNo
Serve or use an exit nodeYesYes; using one covers only the anchor's own trafficNo
Run over an uplinkYesYesNo
wintun.dll on WindowsNeededNot neededNot needed
mode row in conflux statustun — interface the anchor's own name: anchor and the start of its IDproxy — userspace, no host interfaceobserve — 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_ADMIN is 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 --observe to up or proxy instead.
  • 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 networkOver a cable
upsudo conflux upsudo conflux up --uplink /dev/ttyUSB0:115200
proxysudo conflux proxy 8080=127.0.0.1:3000sudo 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.

0 of 3 done
  1. $ 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.