Skip to content

The management link gets its place in OPNsense

Written 2026-10-14 as a plan for issue 374, reviewed, built the same day and proven across a reboot of the XGS 136. Measured first: the link over PCIe is whole in both directions once the host brings mvmgmt0 up, and OPNsense's default deny drops every frame the coprocessor sends in, because the interface is nobody's. The driver needed no change; the plugin did. What follows is what was built, with the two places where the plan said one thing and the appliance said another.

What the plugin does at install, and at every boot

  1. Assigns the interface. mgmt-link.php assign, run by the installer on the ARMADA appliance, makes mvmgmt0 an interface of this firewall named NPUMGMT with the fixed link-local address 169.254.254.1/30, written through the same config.inc every page uses, with a revision line and a backup beside it. Idempotent: an assignment that already carries mvmgmt0 is kept and only its name and address made right. On the XGS 136 it became opt15. The installer can do it only where mvmgmt0 is there when it runs: on an appliance already running its driver, as at every update. An appliance installed from a ready-made image runs the installer at its first boot from the stick, where no driver is loaded yet, so until 2026-11-06 its link was never assigned - nor after a factory reset - and the coprocessor was told its address at every boot and never answered over the link (the review's A4). Since then the early hook src/etc/rc.syshook.d/early/31-xgs-mgmt-link (mgmt-link.sh early) assigns it at a boot that has it and no assignment: after 07-npuep, whose loading of the driver makes mvmgmt0, and before OPNsense checks the interfaces it has assigned and configures them, so the link has its address and its rules in that same boot. Nothing is done where it is assigned already, or not there, and never on the XGS 3300, whose link is assigned by the bootup hook once it has started. An owner who removes it keeps it removed (#1072, since 2026-11-21): mgmt-link.sh records in config.xml what it last saw of NPUMGMT (the XGS model's general/npumgmt: assigned optN, or removed and when), so an assignment it had seen and that is gone is taken as the owner's choice - no boot, install or recovery assigns it again, the coprocessor is reached over its console, and one line says so, on the console on the XGS 136 and in the XGS log on the XGS 3300. Assigning the link again in Interfaces: Assignments brings it back as the plugin makes it, enabled and with its address, since that page adds an interface disabled and with none. A factory reset or a restored configuration carries its own record, so neither is taken for a removal. Tried on both appliances on 2026-11-21: removed, then two boots without it and with one line said once, then assigned again from the page's way and made right at the next boot.
  2. Admits the coprocessor. Not a rule in the configuration: the plugin's own firewall hook, xgs_firewall, registers two rules at every reload on whichever interface key carries mvmgmt0 - ICMP, and TCP 22 for the coprocessor's sshd, from 169.254.254.2 to this host alone, quick, logged. Nothing is forwarded, nothing else enters, and a machine with no such assignment gets no rule at all.
  3. Brings it up. 07-npuep, the early hook that loads the driver, ends with ifconfig mvmgmt0 up once the front ports are present, so the link establishes before OPNsense configures its interfaces. Measured on the boot after: mgmt: link 0x00 -> 0x82, 0x82 -> 0x83 at 38 seconds, the assignment then found the link already up.
  4. Tells the coprocessor its address. Its root filesystem is read-only and forgets every address at its reset, and nothing on its side knows the pair, so the plugin's bootup hook (xgs_configure -> mgmt-link.sh coprocessor, in the background) and a recovery in place (recover.sh) set 169.254.254.2/30 there over the console - through npu-run.sh, under the console's lock, as every other reader of the coprocessor does - then ping it, and tell it again while it does not answer, for about five minutes. The log says the coprocessor answers at 169.254.254.2. Until 2026-11-04 the XGS 136's family wrote to the console itself, once and without the lock: after a recovery on 2026-11-03 its login was typed into feeder.py's own session on the console, the address was never set, and the link stayed down until it was given its address by hand eight and a half hours later (1010). Each telling waits up to 30 s for the console behind another reader, and on the XGS 3300 the start hook's switch-jumbo.sh waits for the link while the address is being given instead of taking the console first (1018).
  5. Trusts the host. mgmt-link.sh trust makes the host's key for this link, /root/npu/id_ed25519_npu, and appends its public half to the coprocessor's /root/.ssh/authorized_keys - one line, guarded by the key itself, a line of an earlier install replaced rather than added beside. Guarded by its own comment, until 2026-10-21: the coprocessor's file outlives the host's disk, so a host installed again found its old line under the same comment and added nothing. Since 2026-10-21 it is not a step done by hand: the bootup hook's mgmt-link.sh coprocessor, once the coprocessor answers its ping, tries the link's ssh and runs trust when it is refused. Done once, by hand - which an appliance installed from an image never had, so every reader of the coprocessor queued on its console (668). The plan said this would go on the coprocessor's /persistent partition. That partition is mounted by the vendor's start-up script and holds only its breakouts/; nothing there is read for keys. What the vendor does have is xgs-remount.sh rw|ro, its own script for taking the root filesystem writable and back, and that is what trust uses, around the one appended line.
  6. Uses it. mgmt-link.sh ssh [command] is a root shell, or one command, on the coprocessor at PCIe speed - four megabytes in about a second against the 115200 console - with the console kept as the fallback and the boot log. The vendor's xgs-* tools, mvsw, the platform store and the sensors are all reachable through it.

mgmt-link.sh status prints the interface, the assignment, any bridge it is a member of, the live rules, a ping and an ssh, which is what the proof below is read from.

What is not done

  • The interface is never bridged, never given a gateway, never offered to the WAN or the LAN. Since 2026-11-22 the Ports page and mgmt-link.sh status say so when it is in a bridge anyway, and mgmt-link.php gives it no interface key the configuration still names elsewhere, such as a bridge's member left behind by a removed interface.
  • No DHCP on either end. No IPv6 on either end.
  • The vendor's firmware image on the coprocessor is changed by exactly one appended line in authorized_keys, under its own remount script; /persistent is not used.
  • Nothing is driven on the coprocessor by the plugin's own initiative; the link is for reading and for tools the owner runs. Since 2026-10-27 the plugin does two three things on the coprocessor of its own accord, all over this link:
  • it starts the coprocessor's watchdog feeder again when the feeder has stopped (measured);
  • it sets the coprocessor's clock from the host's (below);
  • since 2026-10-28 it tells the coprocessor's log forwarder to send the coprocessor's log to the host (below).

Otherwise the link is for reading, and for tools the owner runs.

The coprocessor's clock, since 2026-10-27

Nothing set it. A few minutes into a boot, both XGS 3300s' coprocessors read 1970 and the XGS 136's 2097, so every time the coprocessor writes - in its own log, on its console - was wrong. The vendor's host sets it at every boot, and now this one does too.

  • How: scripts/xgs/npu-clock.sh reads the coprocessor's clock over this link, never the console. When it is more than two seconds from the host's, it sets it in UTC and says so in the system log under the tag xgs-npu-clock, with what it read.
  • When: the start hook 71-xgs-npu-clock runs it at the end of the boot - every 15 s, for up to five minutes, while the coprocessor comes up. Cron runs it every ten minutes after that, so a coprocessor taken up again in place is set again within ten minutes.

Measured on 2026-10-27, on each appliance:

appliance vendor version the coprocessor's clock read
the first XGS 3300 23 1970-01-01 00:15:20
the second XGS 3300 22 1970-01-01 00:13:23
the XGS 136 21 2097-07-24 07:19:10

Each was within a second of the host's afterwards, the next run left it alone, and the fast path's heartbeat stayed alive throughout.

The coprocessor's log, since 2026-10-28

The coprocessor's syslogd keeps its log in RAM - /tmp/messages, half a megabyte at most - so each reset of the coprocessor lost it, and with it the lines that said why. Its syslogd also hands every line to a small forwarder on the coprocessor, which sends nothing until it is told where. The vendor's host tells it at every boot, and now this one does too. The forwarder's source is in the vendor's open-source drop (xgs-bsp/tools/xgs_log_fwd.c).

  • How: scripts/xgs/npu-log.sh writes this host's end of the link into the forwarder's address file - 169.254.254.1%mvmgmt0%514: the address, the coprocessor's own interface, the port - and signals it. From then on every line goes to 169.254.254.1, port 514. syslog-ng cannot listen on that address: it starts before the interfaces have theirs, and one source that cannot bind stops it whole. So it listens on 127.0.0.1:5140 (/usr/local/etc/syslog-ng.conf.d/xgs-coprocessor.conf), and the plugin's firewall hook redirects the link's port 514 there, from the coprocessor's address alone - rdr pass, the way a transparent proxy is reached.
  • Where: a source of its own, never mixed with this host's lines, written as OPNsense writes its own logs: a file a day under /var/log/xgs/coprocessor, kept as long as the others, shown on XGS: Coprocessor Log, and the last 256 KB of it in the support bundle. Each line is dated when it arrives - the coprocessor's times carry no zone, and its clock is wrong until this host sets it - and carries the sender's address as its origin, which is also what OPNsense's log viewer needs to read a line's date, severity and process: without it the whole line showed under Line.
  • And further (since 2026-11-14): to every remote server OPNsense sends its own log to (System: Settings: Logging: Remote). OPNsense writes each destination with one log path from s_all, this host's lines; an overlay on its Syslog templates (templates/OPNsense/Syslog/+TARGETS.D/xgs.TARGET, the way the Intrusion Detection's is overlaid) writes /usr/local/etc/syslog-ng.conf.d/xgs-coprocessor-remote.conf with them: a second log path to each of those destinations, from the coprocessor's source, the host named coprocessor, through the destination's own program, level and facility choices. The destination is OPNsense's and is not written again, so the coprocessor's log follows what is set there and nothing is set on the XGS pages. Not yet seen at a remote server.
  • When: the start hook 72-xgs-npu-log at the end of the boot, every 15 s for up to five minutes; cron every ten minutes after that, so a coprocessor taken up again in place is told again within ten minutes. While the forwarder's file holds this host's address, nothing is done. Telling it is said under the tag xgs-npu-log, on the Log File page.
  • Removal: the uninstaller starts the forwarder again, sending nothing, before the redirect goes; otherwise every line would be refused by the default rule, and logged.

What the coprocessor writes before it is told - its own start - stays in its RAM; the console page, XGS: Coprocessor Console, has that part. The vendor's script writes the forwarder's file from a second file, which the coprocessor's start-up also reads to choose its path, so that second file is left alone and the forwarder's own written directly.

Measured on 2026-10-28, on each appliance, with every piece above in place:

appliance vendor version the coprocessor's forwarder the log arrives by
the first XGS 3300 23 14,448 bytes, TCP with UDP while TCP is refused TCP, one connection
the second XGS 3300 22 the same binary TCP, one connection
the XGS 136 21 10,320 bytes, UDP only UDP

On each, a line written with logger on the coprocessor was in the host's file as it was written, dated, with its severity and process, and on the page. A coprocessor at rest writes almost nothing: the first XGS 3300's wrote no line between 17:54 and 18:34 that day; what it writes comes with its events - its start, an error, a port, a reset.

Sources

The link itself - the rings in host memory, the status word, the polling - is on mvmgmt.md, read out of Marvell's pcinet source and checked against the module on the appliance; the measurements that led here are on issue 374; the coprocessor's console and the vendor's tools on it are in the family page; the scripts are src/opnsense/scripts/npuctl/mgmt-link.sh and mgmt-link.php, the hooks src/etc/rc.syshook.d/early/07-npuep and src/etc/rc.syshook.d/early/31-xgs-mgmt-link, the rules in src/etc/inc/plugins.inc.d/xgs.inc; the board, with its photographs, is on the hardware page.

Proven on the XGS 136, 2026-10-14

The installer ran assign (opt15 NPUMGMT 169.254.254.1/30), a filter reload put the two rules in the live set, coprocessor set the far address and trust the key, then the appliance was rebooted. On the boot after: the link established at 38 seconds from the hook's up, OPNsense gave opt15 its address, pfctl -sr carried both rules, the bootup hook logged the coprocessor answering, and mgmt-link.sh ssh returned from the coprocessor ninety seconds into its uptime. Fourteen front ports and the WAN lease as before. Issue 374 closes on that.

Discussion

The discussion of this page is held in the project's GitHub Discussions. Showing it here loads giscus from giscus.app and GitHub, and writing in it needs a GitHub account - what that means.