Skip to main content

Crate dslite_b4

Crate dslite_b4 

Source
Expand description

§dslite-b4

dslite-b4 is a Unix daemon that provides the B4 function from RFC 6333 on Linux and illumos. It establishes IPv4 connectivity through an IPv4 in IPv6 tunnel to an AFTR. It continues to reconcile the configured tunnel with operating system state.

The daemon runs as root. It creates and manages a tunnel interface, assigns the reserved B4 IPv4 endpoint, and installs an IPv4 default route through that interface. Packet encapsulation and forwarding remain in the operating system network stack.

§Install

Install the executable from crates.io:

cargo install dslite-b4

cargo install installs only the executable. The crate also contains an example configuration, dslite-b4(8) and dslite-b4.toml(5) manual pages, and service definitions for systemd and illumos SMF.

System packages should install the executable as /usr/sbin/dslite-b4, the configuration as /etc/dslite-b4.toml, and the manuals under /usr/share/man. The systemd unit is intended for /usr/lib/systemd/system. The SMF manifest and method are intended for /lib/svc/manifest/network and /lib/svc/method.

On OmniOS, build a native IPS archive with crates/dslite-b4/packaging/ips/build.sh. It writes target/dslite-b4-<version>.p5p. The package is disabled by default. Install it with pfexec pkg install -g ./target/dslite-b4-<version>.p5p network/dslite-b4, configure /etc/dslite-b4.toml, validate with dslite-b4 check-config, then enable it with pfexec svcadm enable dslite-b4.

§Configure and run

The executable reads /etc/dslite-b4.toml by default. Another path can be selected with --config. The packaged example-config.toml describes every setting and its default.

Validate a configuration before starting the daemon:

dslite-b4 check-config

Run it in the foreground, normally under systemd or SMF:

dslite-b4 run

Inspect the last operational snapshot with dslite-b4 status. Use dslite-b4 status --json for output intended for programs. set-aftr and clear-aftr update the runtime AFTR override and signal a running daemon to reconcile immediately.

§AFTR selection

An AFTR may be configured statically, supplied at runtime, or discovered using the optional HB46PP integration enabled by default. Static configuration takes precedence over the runtime value, which takes precedence over discovery.

RFC 6334 DHCPv6 integration is external to the daemon. dslite-b4 exposes set-aftr and clear-aftr for a DHCP client hook to update its runtime AFTR state. This approach has been tested only with ISC dhclient.

HB46PP discovery accepts only provisioning servers using certificate validation (t=b) by default. Providers requiring t=a can be enabled explicitly with discovery.allow_unauthenticated, which permits HTTP or HTTPS without certificate validation. HB46PP still trusts the access network DNS response to select the provisioning server hostname.

§Building

From the workspace root:

cargo build --release -p dslite-b4
cargo test -p dslite-b4

§License

Licensed under either of the following:

Modules§

aftr
Selection policy for resolved AFTR endpoints.
aftr_discovery
Discovers an AFTR and retains protocol results in memory.
config
TOML configuration types, defaults, and safe diagnostics.
discovery
Discovery of the local IPv6 source address.
dns
IPv6-only resolution of configured AFTR endpoints.
lifecycle
Pure reconciliation planning and backend action execution.
network_changes
Receives routing and interface notifications from the operating system.
runtime_state
Locked PID file and AFTR runtime state provided by the operator.
status
Versioned operational status stored in a file on each supported platform.
supervisor
Notifications for platform service managers.
tunnel
Tunnel state and backend interface shared by each platform.