Skip to content
AnchrasDocumentation
Browse documentation

Integrations / User guide

Networking

Preview

MikroTik RouterOS

Connect MikroTik RouterOS read-only inventory through a registered site agent with explicit credentials and completed inspection evidence.

On this page

Connect MikroTik RouterOS or UniFi Network from Integrations using an explicit read-only profile. This preview reads private management inventory through an active registered instance in an organization-owned on-premises site. No vendor configuration is changed by connecting, inspecting or disconnecting.

Connect

Create a secret in Secrets first. RouterOS expects JSON with username and password; use a vendor account restricted to read-only REST access. UniFi expects api_key and the controller site_id, using the official local UniFi Network 10.0.162 API catalog. The connection requires network_device.create, source-instance update permission and explicit secret.reveal permission. Credentials stay owned by the existing secret store and are delivered transiently only for the current agent inspection command.

Choose the site agent, secret and private HTTPS management URL. Use trusted TLS, or an explicit certificate SHA-256 pin and optional server name. A pin verifies peer identity; it does not verify certificate lifetime or PKI trust. Creating a connection does not test it. Choose Inspect now and refresh status to wait for a completed inventory read. Collection coverage, devices, ports, networks and supported routes are available in Network → Devices.

Verify inspection evidence

Health follows completed inspection evidence: a new connection is untested, a queued inspection is not a successful check, partial results need attention, and failed results retain the previous successful timestamp. Evidence becomes stale after five minutes. Directory refresh and background health sweeps do not contact the vendor or renew that evidence. Inspect again to obtain a fresh result. After correcting or rotating the source secret, retry inspection; creating a new target/profile binding remains an explicit operation.

CLI

The existing CLI offers the same native operations:

sh
anchras networks integrations create router-read --agent INSTANCE_ID --target https://10.0.0.1 --secret-id SECRET_ID --profile routeros_rest_read_v1
anchras networks integrations create unifi-read --agent INSTANCE_ID --target https://10.0.0.2 --secret-id SECRET_ID --profile unifi_network_api_read_v10_0_162
anchras networks integrations list
anchras networks integrations get INTEGRATION_ID
anchras networks integrations inspect INTEGRATION_ID
anchras networks integrations delete INTEGRATION_ID

The read-only profiles are routeros_rest_read_v1 and unifi_network_api_read_v10_0_162. A lost create response may have committed: refresh the connection list before retrying the same name. Repeated disconnect succeeds when the connection is already absent.

Disconnect

Disconnect removes the Anchras connection and ends its inspection bookkeeping. It preserves the source secret, vendor devices and configuration. Credential responses admitted before disconnect may finish afterward; already delivered credentials cannot be recalled. After disconnect commits, Anchras admits no new inspection credentials or observations for that binding. Rotate or revoke the vendor credential separately if material already delivered must become unusable. Connections with separately approved write resources cannot be removed until those owned resources have been cleaned and verified.

Availability and limits

This read-only directory cannot enable route or VLAN writes. Physical RouterOS models, UniFi controllers/switches and hardware offload remain unqualified; SwOS is unsupported. UniFi route, LLDP and forwarding-table data remain unknown where the declared API does not expose them. Network Site CIDR suggestions and explicit CIDR acceptance (native inventory CIDR suggestions) and vendor topology (Network → Overview → Physical network, anchras networks integrations topology) are separate workflows that read this inspection evidence; connecting does not perform them, and this lifecycle does not claim production hardware qualification.

Troubleshooting

If inspection remains pending, check the source agent and refresh status. A timeout records an error without inventing vendor health. Authentication failures require correcting the source secret or vendor account. Verify the private HTTPS endpoint, site binding and certificate identity when a connection fails. After a transient status-read error, use Refresh status to retry.

CLI commands

Install and authenticate using the CLI guide. The table describes command families; required arguments are shown in their usage output.

CommandPurpose
networks list [--search S]The project's networks (ADR-073 §6, ListNetworks): slug, name, substrate, the regions its segments span, the segment count and, for a tailnet network, its isolation (enforced, pending or unenforced with the reason code; ADR-008 D5, ADA-2167). --project selects the project (or the global --project, ANCHRAS_PROJECT, the profile's saved project). Before ADA-1800 this listed tailnets: use tailnets list.
networks get <id-or-slug>One network with its segments by region. A slug is unique only within its project, so it needs --project; an id does not. A network in a project you cannot see reads as not found. A tailnet network shows its isolation: enforced, pending (the mesh ACL push has not checked the organization yet, or is holding back new grants while a region's inputs are stale) or unenforced with a reason code (provider_no_policy, device_tags_unsupported, foreign_allow, rule_not_expressible) and its message; -o json carries isolation beside the older enforcement.
networks create <slug> --substrate tailnet\|native [--name NAME] [--tailnet ID]Create a network in a project (admin/owner). The substrate never changes. tailnet is an ACL segment compiled onto the organization's tailnet (--tailnet, default the primary; isolation mode shared_tailnet, while --isolation dedicated_tailnet is reserved and refused); native is site and provider networks whose devices enforce isolation, declared but not yet enforceable. Slugs are unique per project.
networks update <id-or-slug> --name NAME / networks delete <id-or-slug>Rename a network, or delete one with no segments left (refused naming the segment count). A project that still has networks cannot be deleted. Admin/owner.
networks segments list <network> [--region R] / segments get <segment-id>A network's segments, optionally in one region: region, CIDR and site or location binding.
networks segments create <network> --region R [--site S \| --location L] [--cidr C] [--name NAME]Add a segment in an active region (a draining region refuses it), optionally bound to one of your sites (id or slug) or a location of that region. CIDRs may not overlap within a network and may across networks; a CIDR with host bits set is refused. A native network's segment needs a binding and a CIDR. Admin/owner.
networks segments update <segment-id> --name NAME / segments delete <segment-id>Rename a segment (network, region, binding and CIDR are fixed), or delete it; a segment with resources attached is refused naming the count: detach them first. A site bound to a segment cannot be deleted. Admin/owner.
networks attach <resource-arn> --segment <segment-id>Attach an instance (arn:anchras:compute:<region>:<org>:instance/<id>), a guest VM (…:instance/<id>/vm/<vmid>) or a managed cluster node (arn:anchras:cluster:<region>:<org>:cluster/<id>/node/<id>) to a segment (ADR-073 §6, AttachResource). Records the attachment and includes it in network/segment ACL compilation, with managed control-plane, mesh-DNS, monitoring and load-balancer paths. Refused with failed_precondition when the resource is in another project or region, when the network is native (naming the networkdevice or subnetgateway capability its site lacks), or when the resource is already on a segment. Residency-policy enforcement is pending the separate ADA-1936/#2723 slice; device-tag convergence and platform-tag rollout are also required before network isolation is qualified (ADA-1936/#2664). Live and cross-region reachability remain unproven. Member and above.
networks attach <resource-arn> --segment <segment-id> --previewAttach nothing; list who would lose reachability if the resource attached (PreviewAttach, ADA-1804): organization members (their own devices), tailnet devices that carry no resource (laptops, workstations) and the devices of other instances and cluster nodes that reach it now and have no path into the network: no member-or-above role on its project, on no network or on another network. Computed from the compiled mesh ACL with and without the attachment. Devices of resources in projects you cannot read are counted, not named. Refused exactly as attach would refuse. Member and above.
networks detach <resource-arn>Remove a resource's attachment (DetachResource); subsequent ACL compilation uses its unattached rules. Device-tag convergence and live reachability remain rollout dependencies. An attached resource cannot move to another project until it is detached. Member and above.
networks attachments list <network> [--segment S] / attachments show <resource-arn>What is attached to a network's segments (ListNetworkAttachments), or one resource's attachment with the segments of its project and region it could attach to and why any cannot (GetResourceAttachment).
networks tailnet-login show [--user U] / listThe login the compiled tailnet ACL names a member's own devices by in the project user groups (GetTailnetLogin, ListTailnetLogins, ADA-1941): the member's tailnet login when one is set, otherwise their Anchras email. show defaults to you (any member reads their own, read-only); --user takes a user id or a member's email and, like list, needs the right to list members. Partner staff acting through delegated access are not members and reach no project's networks.
networks tailnet-login set <login> --user U / clear --user USet or clear a member's tailnet login (SetTailnetLogin, ClearTailnetLogin): user@domain, user@github, user@passkey, or a Headscale user name with its trailing @, stored lowercase. Organization admins and owners only (team.update), for any member including themselves, always named with --user: a login gives the identity it names the member's project network access, so there is no self-service. A login that is another member's tailnet login, or the email of another member with none set, is refused (already_exists). On a Headscale tailnet the compiled groups name no user (its policy is server-wide), and networks explain says so.
networks settingsProvider kind, optional active provider switch state, and whether a device carries each Anchras platform tag the pushed mesh ACL relies on (GetNetworkSettings, ADA-2095): platform_tag_carriers is ok, missing (with missing platform tag carriers: <tags>), not_applicable (Headscale holds no per-tailnet ACL, or no provisioned tailnet) or unknown. See platform tags.
networks connectConnect NetBird with --provider netbird --credentials-file <private-file>; optional tag:cluster-node and guest_binary fields enable the pinned VM guest bootstrap recipe. Legacy integrations use --tailnet, --client-id, and --client-secret-file; --validate-only checks without saving, and --provider managed / --provider headscale select operator networking. Replacing a current provider requires --replace and unenrolls existing devices. Connect with --tailnet, --client-id, and --client-secret-file. Validates OAuth read access before connecting. Use --validate-only to test without saving, or --provider managed / --provider headscale / --provider anchras for operator networking (anchras is the Anchras coordination server, where the deployment configures it). Replacing a current provider requires --replace and unenrolls existing devices. A switch from Tailscale (managed or your own) to anchras keeps each instance's overlay IPv4 address, and the IPv6 address derived from it, when it enrolls again. A switch from headscale to anchras keeps the IPv4 address, but the IPv6 address changes, because Headscale assigns IPv6 addresses separately. Every other switch gives devices new addresses. The command prints which applies.
networks switch retry/cancel/dismiss <switch_id>Retry a failed connection, cancel during preparation, or dismiss a failure to start over. Check progress with networks settings.
networks show <tailnet_id>One tailnet row (GetTailnet). <tailnet_id> may be a unique prefix, as tailnets list prints it.
networks devicesPaginated Tailscale devices (--tailnet; default primary). INSTANCE is the instance a device is bound to and OWNER the person it is logged in as (Anchras coordination server only; - for a tagged device), so a person's Mac bound to its instance is one row, the machine with its person (ADR-082 §2). A device whose instance is a personal device is marked (personal); a member who is neither its person nor an admin sees only its name, instance, person and whether it is online (LAST_SEEN reads online or offline), not its address, tags, state or key expiry (ADR-082 §4). With -o json, platform_tags are the tags only the platform's rules read while the device is bound, never in tags. At the global endpoint the list holds every region's devices of the tailnet, merged newest enrolment first (ADA-2586); a region that does not answer is named on stderr (note: partial list: ...).
networks devices enroll <instance_id>Enroll an instance or recover a logged-out or removed node (EnrollHost); --tailnet <id> selects a network, otherwise the primary is used. New instance nodes persist until explicitly retired. At the global endpoint an instance of another region is enrolled by its region (ADA-2586).
networks devices importRecord a node no Anchras agent enrolled (for example a Tailscale Aperture node) in the organization's device inventory, by --hostname or --provider-device-id (ImportDevice). Re-run to refresh its address from the provider.
networks dns get / dns updateRead or update MagicDNS, resolvers and search domains (--tailnet; default primary). A resolver is an IP address or, on the Anchras coordination server, a NextDNS or Control D DNS-over-HTTPS endpoint (https://dns.nextdns.io/<profile>, https://dns.controld.com/<resolver>), whose profile policy nodeAttrs nextdns:<profile> / controld:<resolver> override per device (nextdns:no-device-info stops sending device information to NextDNS; it is NextDNS-only, and Control D still receives the device name as its client ID). Headscale writes require operator HEADSCALE_CONFIG_PATH because DNS is server-wide.
networks advice / recommendOrganization-wide non-binding DERP/peer-relay recommendations from current typed observations (GetRelayAdvice); table/JSON includes coverage, freshness, bounded edge evidence, and operator actions.
networks topologyACL-derived graph overlaid with recent agent peer telemetry (GetTailnetTopology); -o json includes edges with latency/path/rate fields; table prints nodes only. At the global endpoint the graph holds every region's nodes, with the policy edges between them (ADA-2586); a region that does not answer is named on stderr.
networks inventory <instance_id>Inspect interfaces, connected subnet candidates, descriptive site associations and Layer 2 observations with freshness, withheld-detail counts and coverage limits.
networks sites list / get <site_id>Read organization-owned on-prem sites, CIDRs, notes and current generation.
networks sites suggestions <site_id> [--integration <id>]Read attached-network CIDR suggestions with immutable observation identity, eligibility, coverage limits and expected site generation. Uses native read integrations only; historical evidence cannot authorize acceptance.
networks sites accept-cidr <site_id> --integration <id> --observation <id> --candidate <sha256> --expected-generation <n> --request-key <key> --yesAppend one exact observed CIDR, preserving all other metadata. Keep the complete request and key after uncertain errors. Replays return the original receipt after source disconnect or manual prefix removal, without adding the prefix again. Already configured prefixes record a no-op receipt without advancing generation. No routing, VLAN or provider change is performed.
networks sites create --name <name> --country <ISO2> [--slug <slug>]Create an on-prem site using the existing region identity.
networks sites update <site_id> --name <name> --expected-generation <n> [--notes <text>] [--cidrs <csv>]Replace site metadata and all configured CIDRs; omitted notes/CIDRs clear them. Refresh after a concurrent edit.
networks sites delete <site_id> --expected-generation <n> --yesDelete only an unreferenced site; current and retained placement/operation references block deletion.
networks sites associate --instance <id> --candidate <id> (--site <site_id> \| --clear-site)Set or clear a descriptive current-interface site override without changing instance placement or routing authorization.
networks underlay [--site <id>] [--page <n>] [--page-size <n>]Read paginated inferred co-location between readable current agents; response reports bounded coverage.
networks privacy get / set --neighbor-detail <off\|anchras_peers_only\|sampled> --expected-revision <n> [--lldp-details] [--interface-mac-details]Read/update organization inventory privacy. Off dominates detail flags and periodic gateway witnesses; setting writes scrub retained inventory detail.
networks explain <name\|address> [--source <instance_id>]Explain every organization resource that claims a name or IP address (the D8 endpoint routing plan): mesh registry names (flat, region, organization-qualified, split-horizon shadow and customer-domain translations), load balancers (tailnet, Funnel, edge ingress, cloud), InternalDNS records including wildcards, private/public/split-horizon customer hostnames, tailnet devices and subnet-routed addresses. Each match shows exposure, transport class, the recorded DNS and TLS story and, for addresses, the covering managed gateways, prefix route policies (including retained DENY) and network sites. Short names are tried under anchras.internal and the organization network domain. With --source, registry matches embed the source connection explanation and tailnet matches show the latest observed peer transport. Customer-name matches hide *.ts.net targets unless --include-provider-details; matches the caller cannot read are omitted. Recorded state only: no DNS query, provider read or probe.
networks explain --from <source> --to <destination>Evaluate the compiled mesh ACL for one path (ExplainNetworkPath, ADR-073 §6, ADA-1804). The source is a user (alice@example.com, their tailnet login, or user:<id>: the user's own devices), an instance or cluster node ARN, an instance id or a tailnet device id; the destination an instance, guest VM or cluster node ARN, an instance id or a mesh registry entry id. Shows whether the path is allowed and via what: the network and segment both sides sit on, the managed rule (control plane, monitoring, load balancers, mesh DNS), the project binding or organization role that admits a user (a member-or-above role on the network's project; a viewer binding admits nothing), a workload grant, the broad mesh-client rule, or flat reachability for a destination on no network. Lists each excluded path with its reason (for example a binding on another project) and the config version evaluated. When the destination (else the source) is on a network, isolation: says whether the tailnet provider enforces that network's isolation, naming the reason code and message when it does not (ADA-2167); the same line appears in the network path section of a connection explanation. Operator-authored tailnet rules are not evaluated. A resource you cannot read is not found.
networks explain <registry_entry_id>Explain the source instance's endpoint selection and linked-LB recorded delivery, DNS and certificate metadata with coverage totals; the network path section is the compiled ACL's decision for the source instance's device (as --from/--to reports it). Qualified customer hostnames are preferred in table output; --include-provider-details reveals canonical addresses, and JSON/YAML retains original API fields; an explicit probe records separate reachability evidence and its route-policy identity/revision. Gateway probes require fresh, command-bound admission and use the selected tailnet without a host-network fallback.
networks native / networks connectorsCreate, apply, probe and remove explicit native endpoint bindings and managed connectors with optional authorized tailnet fallback.
networks gatewaysPreview and manage subnet gateways, source-preserving routes, HA groups, automatic reply paths, registry/prefix gateway policies and managed peer relays.
networks gateways return-paths configure --file definition.jsonExplicitly configure an independent target's automatic per-flow reply path using its current LAN inventory and two admitted router candidates. Optional forwardedPaths bind downstream interface names/prefixes for routed/DNAT replies; the server derives the current interface identity. Remote prefixes additionally require nextHop and an explicit nextHopMac pin, verified against a permanent kernel neighbor by the target agent. This grants no forwarding or NAT permission. Repeating an unchanged create returns its durable intent. Include id and expectedRevision to refresh or reconfigure after acknowledged withdrawal.
networks gateways return-paths get IDRead the current revision, target receipt and freshness.
networks gateways return-paths delete ID --revision NRequest exact withdrawal; an offline target remains pending and its durable ownership is retained.
networks gateways preview / create ... --exit-nodeExit-node mode (ADA-2198): the gateway also advertises 0.0.0.0/0 and ::/0 and forwards its source tags' internet traffic (autogroup:internet) out of its LAN interface, masqueraded. Set at creation; snat mode only, and refused (failed_precondition) unless the provider declares the exit_nodes capability. The gateway approves its exit routes with its prefix and withdraws them with it, and its access rule also grants its source tags autogroup:internet; it applies only while the tailnet policy lets no other source reach the internet and the denied probe source cannot. get shows exit_node.
networks gateways withdraw <id> --revision <n> / force-withdraw <id> --revision <n> --yesWithdraw a gateway (WithdrawSubnetGateway). Its tailnet provider route approval and access rule go once the host reports its runtime withdrawn; a withdraw that ends without that report lands the gateway in error, and withdrawing again sends the next revision. When the gateway's instance is terminated (or released), its agent never answers, so withdraw finishes at once: the server removes the provider state, the gateway's managed peer relays' grants and owned device tags, and records the gateway withdrawn, audited as subnet_gateway.force_withdrawn (ADA-2254). The server withdraws an active gateway whose instance is terminated the same way within a minute, audited as the system's with reason instance_terminated, and notifies the organization's admins (ADA-2331). Once the gateway's runtime is gone (its host reported it withdrawn, or its instance is terminated), the server also deletes the runtime's own tagged tailnet device, audited as subnet_gateway.device_retired (ADA-2330, ADA-2334). force-withdraw (ForceWithdrawSubnetGateway) does the same for a host that is unreachable but not terminated; the withdraw command stays queued, so a host that comes back tears its runtime down. It needs --yes, the same permissions as withdraw (admin/owner: tailnet.update and tailnet.acl.update), and is audited. A provider cleanup that does not complete leaves the gateway withdrawing with the reason; force-withdraw again to retry.
networks integrationsRegister credential references and inspect supported MikroTik RouterOS and UniFi network devices.
networks routesPreview, apply, update, refresh and withdraw an Anchras-owned RouterOS static route.
networks access-vlansPreview, apply, confirm through endpoint evidence, restore and delete RouterOS access-port VLAN assignments.
networks unifi-vlansPreview, apply, update, refresh, remove and delete a bounded UniFi gateway VLAN network.
networks domainsManage customer-domain private bindings, client resolution, public publications and explicit dual-view bindings.
networks domains [private\|dual] list [--project <id\|slug>] [--include-terminated]List public publications, private bindings or dual-view bindings. A binding is in the project of the load balancer it serves (for a dual-view binding, either child's); --project (then the global --project, then the profile's saved project) lists only that project's, and with none every binding you can read is listed.
networks domains organization getRead the organization network domain, authority status, current revision and compiled projection. Compilation does not establish DNS, resolver-search or certificate readiness on an agent.
networks domains organization set --revision <n> --request-key <uuid> --enabled=true\|false --domain <domain> (--managed-zone <uuid> \| --byo-binding <uuid>) [--search-domains]Replace the complete desired setting using the original revision (0 when absent). Disabling still requires the retained domain and authority reference. Search configuration is opt-in and defaults to false. After an uncertain result, replay the same request key and exact original flags; the CLI never fetches a newer revision or replaces the key automatically. A replay can report an older accepted revision alongside a newer current setting.
networks domains organization translations [--registry-entry <uuid>] [--resource-kind <kind> --resource-id <identity>] [--hostname <name>] [--page <n>] [--page-size <n>] [--provider-details]Read customer hostnames with separate DNS and TLS status. Provider targets are omitted unless explicitly requested, including in JSON/YAML output. Resource-kind and resource-ID filters must be supplied together.