Link mode (netboot · link · ffx · off)¶
panio netif owns the host side of the point-to-point USB-Ethernet link
to the target and puts it in one of four mutually-exclusive modes.
Never run ifconfig/ip/networksetup on the interface by hand: it desyncs
what netif status reports.
| mode | Host interface | For |
|---|---|---|
| netboot | IPv4 host_ip/24 + DHCP + TFTP + HTTP |
TFTP/HTTP-booting the target (NET-first boot order) |
| link | IPv4 host_ip/24 only — no DHCP/TFTP daemon, no ffx LL |
bringing the bare link up to test it, without serving anything |
| ffx | IPv6 link-local fe80::1/64; no DHCP/TFTP |
reaching a booted Fuchsia target over ffx (fe80::…%<iface>) |
| off | nothing panio set up (host IP + ffx LL released) | parking the link / testing it down |
LL is an IPv6 link-local (fe80::) address. ffx is Fuchsia's host tool;
ffx target list shows RCS:Y when it reaches the device and RCS:N when it
doesn't.
| netboot mode | ffx mode | |
|---|---|---|
| Target boots from | TFTP (NET-first boot order) | SD card (firmware reads the FAT partition) |
| Transport to device | TFTP/netsvc (no shell) | SSH → RemoteControlService over fe80::…%<iface> |
| What you run | panio netboot, panio serial, HDMI capture |
ffx target list/show/shell/log, ffx component |
netif prevents two mistakes:
- Forgetting
netboot stopbefore an SD boot. The NET-first target then TFTP-boots the wrong image instead of the SD card. - No host-side IPv6 link-local.
ffxreaches the device atfe80::<dev-slaac>%<iface>, but withoutfe80::1/64 on the host it stays atRCS:N. A control-host reboot removes it.
Commands¶
# Switch to netboot (IPv4 + DHCP + TFTP + HTTP). Same as `panio netboot start`,
# but first removes any ffx-mode IPv6 link-local.
panio netif mode netboot <target>
# Bring the bare link up: assign the host IP only, no daemon, no ffx LL.
panio netif mode link <target>
# Switch to ffx: stop netboot, then add the host fe80::1/64.
panio netif mode ffx <target>
# Tear down every mode, soft (release the host IP and the ffx LL).
panio netif mode off <target>
# Take the link down HARD: `mode off` + disable Wake-on-LAN + admin-down the
# interface. Whether the peer sees carrier loss depends on the adapter's
# driver; see "Testing the link up and down".
panio netif down-hard <target>
# Show which mode the link is in, its carrier (physical link) state, its
# addresses, and any discovered ffx peer.
panio netif status <target>
# Create, list, or remove an 802.1Q VLAN interface on the control host, so
# several targets share one adapter through a managed switch (one VLAN each).
# Host-level, not per-target; -H <host> runs it on a lab host.
panio netif vlan add --parent <adapter> --tag <1-4094> # prints the device
panio netif vlan list
panio netif vlan rm <device> [--force]
The VLAN verbs, the switch layout, and the per-OS details are in netboot: Several targets through one switch.
Omit <target> when exactly one is configured, or pass it as -t/--target
(panio netif mode link -t pi5). Giving both is refused.
Every mode is idempotent. netif mode ffx re-adds the link-local after a
reboot, netif mode netboot skips a redundant start, and netif mode off
removes only what netif set up.
Interface safety: every mode netboot|link|ffx|off and down-hard
refuses an interface carrying the system default route, like
netboot start:
refusing netif mode link on 'en0': it carries the system default route (your
primary network interface). netif would reconfigure it and break host
networking. Use a dedicated USB-Ethernet adapter for the netboot link.
On a remote control host, bypassing this would lock you out of SSH. Fix the
target's interface in the lab file instead (panio discover lists
candidates).
What each mode does¶
- netboot — removes the
fe80::1link-local, then starts DHCP + TFTP + HTTP through the normal netboot path, which configures the IPv4host_ip. - link — stops netboot, removes the
fe80::1link-local, assigns the IPv4host_ip/24 and brings the interface up. - Linux:
ip addr replacefirst, then other IPv4 addresses are removed, so a failed assignment never leaves the link without one. - macOS: sets the service to manual (
networksetup -setmanual) and applies the address withifconfig. Anetworksetuperror is only a warning. - ffx — stops netboot, then enables IPv6 and adds
fe80::1/64 (Linux:sysctl net/ipv6/conf/<iface>/disable_ipv6=0+ip -6 addr add; macOS:ifconfig … inet6 … alias), using netboot'ssudopath. - off — stops netboot, removes the
fe80::1link-local, and clearshost_ip/24. On macOS it also returns the service to DHCP and releases theifconfigalias.
Testing the link up and down¶
Toggle between link and off and read netif status each time:
panio netif mode link <target> # link up: host IP assigned, no daemon
panio netif status <target> # mode=link, carrier up, inet host_ip/24
panio netif mode off <target> # link down: host IP released
panio netif status <target> # mode=off, inet (none)
mode off is a soft down. It releases the host IP but does not drop the
physical link. Many NICs keep the PHY (physical-layer chip) powered for
Wake-on-LAN (WoL), so carrier can read up in off mode.
mode off tries to remove both host addresses (the IPv4 and the IPv6
link-local) even if one removal fails. It exits nonzero when it cannot confirm
an address is gone: the removal command failed and the interface still holds
the address, or the follow-up probe of the interface failed. A removal command
that errors is not a failure if the probe shows the address absent or the
interface itself missing. On macOS a failed networksetup -setdhcp is always
reported, since the probe cannot see the saved service configuration. The
error names each address and includes the command's stderr.
netif down-hard is the harder down. After mode off it:
- Linux: disables WoL (
sudo ethtool -s <iface> wol d), then admin-downs the interface (sudo ip link set <iface> down). - macOS: admin-downs the interface (
sudo ifconfig <iface> down); WoL is system-wide there (pmset womp).
If mode off cannot confirm the addresses released, down-hard still runs
the WoL and admin-down steps, then exits nonzero with that error (and, when the
link_down_cmd hook failed too, both messages).
mode link or mode netboot bring the link back. WoL stays disabled
until you run sudo ethtool -s <iface> wol g or replug the adapter.
Admin-down does not reliably drop the physical link. Whether the PHY powers off is up to the adapter's driver, and with common USB Ethernet adapters it does not. Measured with a second adapter cabled to the first and watching its link:
| Host | Adapter (driver) | Peer saw link loss? |
|---|---|---|
| macOS | ASIX AX88179A/AX88179B (Apple CDC-NCM) | no |
| macOS | Realtek RTL8153 (Apple CDC-ECM) | no |
| Linux | Realtek RTL8153 (r8152) |
no |
Apple's NCM/ECM drivers have no way to power the PHY down, so on macOS no
software step drops the link for these adapters. On Linux, r8152 parks the
PHY in its out-of-band mode on admin-down rather than powering it off, and
ax88179_178a only disables receive (read from the driver source; not
measured).
netif status cannot tell you whether the drop happened. Once the
interface is admin-down, the host reports carrier down regardless of the
PHY: macOS ifconfig shows status: inactive, and Linux refuses to read
/sys/class/net/<iface>/carrier, which panio treats as down. Check from the
other end of the cable: the target's own link state, or the link LED.
For a drop the target is guaranteed to see, take the link away outside the host: unplug the cable, disable the target's port on a managed switch between host and target, or cut the adapter's USB power from a hub with per-port power switching.
A managed switch port works. Measured on a TP-Link TL-SG108PE with the host on one port and a second adapter on another: disabling the second port dropped that adapter's link within 0.8 s, and re-enabling it brought the link back about 1.7 s later (normal gigabit renegotiation). panio does not drive switches yet; until it does, disable the port from the switch's own web page or tool, or let panio do it with a link hook (next section). Never disable the port the host manages the switch through.
Guaranteed link drop with a managed switch¶
Supported switches¶
| Switch | Backend | Measured | Link drop / restore |
|---|---|---|---|
| TP-Link TL-SG108PE, hardware 3.0, firmware 1.0.0 Build 20200415 | easysmart (web UI, password) |
yes | carrier lost 0.8 s after off, back 1.7 s after on |
| TP-Link TL-SG205E, hardware 1.0, firmware 1.0.1 Build 20250609 | easysmart (web UI, password; the 2025 UI is detected at login) |
yes | carrier lost 1.1 s after off, back 2.7 s after on |
| D-Link DGS-1100-05V2, hardware A1, firmware 1.00.003 | snmp (v2c, read-write community) |
yes | carrier lost 0.6 s after off, back 1.7 s after on |
The TL-SG205E's 2025 firmware forces a password change at first login; do that once in a browser before the helper can log in.
The D-Link has no PoE, so its poe verbs do not apply. It ships with SNMP
disabled and a web UI that must enable it, so the setup is a procedure: the
bundled managed-switch skill (panio skill managed-switch, or
on GitHub)
takes a factory-default switch to a working link hook. The rationale is
here and the commands are there. Protocol facts: switchport/AGENTS.md.
The factory D-Link has SNMP communities private (read-write) and public
(read-only), and SNMP is cleartext. Enabling SNMP with the factory read-write
community lets anyone on that link reconfigure the switch, so use it on an
isolated bench link only; the skill points at the secret sources for a
changed community.
Link hooks¶
A link hook is a shell command stored on the target's netboot channel. It
runs on the channel's host the way a power hook does (sh -c, panio's helper
directory first on PATH, under the target's hook lock). panio itself knows
nothing about switches; the switchport helper does the port control.
panio netboot set -t target-machine \
--link-down-cmd 'switchport -d sw1 --mgmt-port 8 port 3 off' \
--link-up-cmd 'switchport -d sw1 --mgmt-port 8 port 3 on'
Here sw1 is the managed switch, --mgmt-port 8 is the port the control host
reaches the switch through, and 3 is the port of the target's adapter.
Other switchport options: --backend easysmart|snmp selects the switch
protocol; port <N> on|off|status is the verb; the password comes from the
SWITCHPORT_PASSWORD environment variable, --password-file, or
--password-command (never put it on the command line). switchport refuses
to disable the management port and verifies each change by reading the port
back. See switchport --help for the full list.
Give the switch a static management address. A TP-Link Easy Smart switch left on DHCP runs its DHCP client on every VLAN it is a member of, so once a netboot link passes through it, it can take a lease from panio's netboot server and move its management address onto the netboot subnet. The Easy Smart web interface is cleartext HTTP (the older UI binds a login to the client's address): keep the switch on an isolated bench network.
With the hooks set:
panio netif down-hardrunslink_down_cmdfirst, while the host side is still up (the switch may be managed through this same adapter), then does its host-side steps (stop netboot, release addresses, WoL off, admin-down). If the hook fails (or the addresses cannot be confirmed released), the host-side steps still run, the command exitshook_failed(a failing program, or exit 127 for a missing one isnot_configured) and the message says the carrier may still be up.panio netif mode link,netbootandffxadmin-up the interface and runlink_up_cmdfirst, then bring the host side up.ffxruns it too, since a link dropped bydown-hardhas to come back before ffx can work. The hook therefore runs on every such mode change and must be idempotent (switching a port on that is already on is).mode offruns no hook.panio netif statusprints alink hooksline:none,down,up, ordown+up.- Clear a hook with an empty value:
panio netboot set -t target-machine --link-down-cmd ''.
Prefer reaching the switch's management address through a different adapter
from the netboot link. The down hook runs before admin-down for the case where
they share one, but on macOS mode off and down-hard return the netboot
interface's service to DHCP. When that interface is the management adapter
itself (not a VLAN device on it), this can also remove a management alias you
added to it by hand, and the next link_up_cmd then cannot reach the switch.
Still confirm the drop from the target side; the host's carrier reads down
after admin-down whether or not the link really dropped.
Status and finding the device¶
panio netif status probes the mode, so it is correct after a reboot:
- netboot daemons running →
netboot - else the
fe80::1host link-local present →ffx - else the static
host_ippresent (no daemon, no LL) →link - else →
off
It also prints carrier (macOS ifconfig … status: active, Linux
/sys/class/net/<iface>/carrier), independent of the mode.
In ffx mode it reads the IPv6 neighbor table (ip -6 neigh, Linux) and prints
a ready-to-paste command for any peer:
mode ffx
carrier up
inet6 fe80::1/64
peer fe80::fc33:fca2:96e0:6dbe%enx001122334455 (try: ffx target add fe80::fc33:fca2:96e0:6dbe%enx001122334455)
If no peer is shown, power-cycle the target and wait for SLAAC (IPv6 autoconfiguration).
Typical ffx-over-network flow¶
panio netif mode ffx fortune # stop netboot + ready the host IPv6 side
panio power-cycle fortune # boots from SD
panio netif status fortune # grab the device's fe80::…%<iface>
cd ~/src/fuchsia && ./.jiri_root/bin/ffx target list # expect RCS:Y
To go back to TFTP bring-up: panio netif mode netboot fortune.
Gotchas¶
refusing netif <verb> on '<iface>': it carries the system default route …means the lab file'sinterfaceis the real NIC. Point it at the USB-Ethernet adapter (see Interface safety).mode offis the soft down. Usedown-hardwhen the target must see link loss, and set a--link-down-cmdswitch hook for a guaranteed drop.- macOS service order.
mode link/mode netbootset the host IP as the service's router (networksetup -setmanualrequires one). Keep the netboot adapter below your real NIC innetworksetup -listnetworkserviceorder, or the default route can move onto the link. mode ffxreports a failedifconfig … inet6add on macOS, e.g. a missing NOPASSWD sudo rule.
Runtime paths¶
netif keeps no state; the mode comes from netboot's daemon state and the interface's addresses. See Netboot for those paths.