Skip to main content

Netgate TNSR

v0.1.1

Observe, inspect, and manage Netgate TNSR edge routers and firewalls over their RESTCONF API: system and dataplane health, interfaces with error counters, bonds and LACP, VRRP, ARP/ND, static routes and FIB lookups, BGP, OSPF and BFD, IPsec and WireGuard tunnels, the VPF stateful firewall and NAT (rules with hit counters, prefix tables, live connections), DHCP leases, NTP, certificate expiry, dataplane drop counters, logs, packet traces, and configuration history with secret-free diffs. Gated changes cover VPF blocklists and filter rules, connection clearing, interface state, static routes, BGP resets, service restarts, configuration rollback timers and restore points, and reboot. Built against the TNSR 25.10, 26.02, and 26.10 YANG models.

41 allowed by default 14 need approval by default 2 denied by default
Pack ID
tnsr
Vendor
emisar
OS
linux
Actions
57
Required binaries. Install these binaries on the runner host before using the pack.
curl jq

Install

New to emisar? Follow the quickstart to connect your host and AI agent, then install this pack below. Agents can use its actions through the CLI or MCP.

emisar pack install downloads and checks the pack, then compares its content hash with the --hash below before copying it into the runner's packs directory. The hash identifies the exact pack shown on this page. If the download was changed, the command rejects it. It also reloads a running runner, so you do not need to restart it yourself.

on the runner host
sudo emisar pack install tnsr --hash sha256:8fc34f7b2b7df87af35dc47449db51a86e942a547733b7fec2effaa059077cf0

Setup

Every action calls the TNSR RESTCONF API at $TNSR_URL with curl from the runner host. Enable the RESTCONF server on the firewall ( restconf , enable true , server host <address> 443 true in the TNSR CLI; best kept in the host namespace on a management address) and give Emisar its own TNSR user. Log in with a password ( global authentication-type user ) or a client certificate ( global authentication-type client-certificate ), then grant that user the NACM rules below.

Environment

Set these on the runner host, then add each name to execution.inherit_env so the value reaches the action.

  • TNSR_URL required

    RESTCONF base URL, https://host[:port] with no path. Plain http is refused except to a loopback address, so a runner on the TNSR host itself may use http://127.0.0.1:<port> .

  • TNSR_USERNAME

    TNSR user for authentication-type user (PAM). Create it in the TNSR CLI with configure , auth user emisar , password <password> , exit , then grant it the NACM rules in the setup notes. Set either this pair or the client certificate pair.

  • TNSR_PASSWORD

    Password of TNSR_USERNAME , set with password under auth user in the TNSR CLI. Sent as an Authorization header through curl's stdin configuration, never in process arguments or the audit log.

  • TNSR_CLIENT_CERT

    PEM client certificate on the runner host for authentication-type client-certificate ; its common name is the NACM user. Issue it from the CA set as global server-ca-cert-path , for example after pki generate-restconf-certs : pki private-key emisar generate , pki signing-request set common-name emisar , pki signing-request emisar generate , pki signing-request emisar sign ca-name restconf-CA purpose client , then copy the output of pki certificate emisar get here.

  • TNSR_CLIENT_KEY

    PEM private key for TNSR_CLIENT_CERT , from pki private-key emisar get , readable only by the runner user.

  • TNSR_CA_CERT

    CA bundle that signed the RESTCONF server certificate, for example the restconf-CA from pki ca restconf-CA get . Without it the system trust store is used.

  • TNSR_INSECURE

    Set to true to skip RESTCONF server certificate verification. Prefer TNSR_CA_CERT .

Notes

  • Allowlist every TNSR_* variable you set in the runner's execution.inherit_env ; the action environment is otherwise scrubbed to PATH/LANG/LC_ALL/TERM and an unlisted variable never reaches the action.
  • Read-only NACM grant. TNSR's default NACM denies everything outside the admin group, and Netgate's read-only example ( access-operations read exec on module * ) also permits every RPC, including system-reboot . Grant only what the reads need: nacm group emisar with member emisar ; nacm rule-list emisar-read with group emisar ; a rule with module * , access-operations read , action permit ; and one rule per read RPC with rpc <name> , access-operations exec , action permit for license-get , packet-counters , route-lookup , bgp-show , ospf-show , ospf6-show , vpf-connection-statistics-get , vpf-connections-get , pki-cert-status-list , pki-ca-status-list , logging-get-messages , system-ping , system-traceroute , trace-packets-get , conf-history-get-versions , conf-history-get-log , conf-history-diff-versions , and conf-rollback-show-timer . Reading the nacm section of the running configuration also needs read access to ietf-netconf-acm .
  • Optional packet capture grant. Give a separate diagnostics group exec permission on netgate-trace RPC trace-packets-capture only when its operators may clear the existing dataplane trace buffer. The reader role can inspect status without this permission. If you used the earlier reader recipe, remove the rule permitting trace-packets-capture from emisar-read . Keep the read rules, including trace-packets-get .
  • Operations NACM grant, only where Emisar should manage the firewall: add access-operations create update delete on modules netgate-vpf , netgate-interface , and netgate-route-table , and exec on clear-interface-counters , vpf-connections-clear , bgp-clear , frr-control , ike-control , kea-control , unbound-control , ntp-control , snmp-control , ssh-server-control , dataplane-control , system-reboot , conf-rollback-start-timer , conf-rollback-restart-timer , conf-rollback-cancel , conf-rollback-trigger , conf-history-save-version , and conf-history-load-version . tnsr.service_status uses the same *-control RPCs as the restarts, and NACM cannot limit an RPC to its status operation, so it needs this grant too. Without it the gated actions fail with HTTP 403 and change nothing.
  • Writes are committed to the running configuration as each request succeeds. RFC 8040 and Clixon's default also copy them to startup; if a firewall's RESTCONF server is set not to, save with db copy running startup in the TNSR CLI before a reboot. tnsr.rollback_timer_start gives a remote change an automatic revert, and tnsr.config_save_version makes a restore point first.
  • Secret-bearing YANG nodes are never emitted: reads select named fields, so the WireGuard private key that TNSR includes in interface state, IPsec pre-shared and manual keys, BGP, OSPF, IS-IS, RIP, BFD, RADIUS and LDAP secrets, SNMP communities, user password hashes, and the license phrase stay on the firewall. tnsr.running_config and tnsr.config_diff delete those leaves by name, from the closed list in the TNSR YANG models, before output.
  • Not offered: the system-nft RPC (an arbitrary nftables command), PKI private-key, PKCS#12 and license-key retrieval, the config views of bgp-show and ospf-show (daemon configuration with passwords), and package installation or upgrades. Clearing every VPF connection at once is refused; give a selector.
  • Built from Netgate's published YANG models for TNSR 25.10, 26.02, and 26.10 (github.com/netgate/tnsr-yang-models). Releases before 25.10 still use dataplane NAT, which these actions do not read.

Verify it works

Runs tnsr.system_status, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify tnsr

Install and configure a pack walks through the whole sequence on a host.

Actions 57 total

View on GitHub
  • tnsr.acls script low Low: read-only or trivially reversible

    List classic dataplane ACLs

    List the stateless dataplane ACLs (netgate-acl): each ACL's rules with action (permit, deny, reflect), IP version, protocol, source and destination prefixes and ports, ICMP types and TCP flags, and the interfaces and directions each ACL is bound to. VPF rulesets are read with tnsr.vpf_filter_rules.

    Arguments
    Name Type Required
    name string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.bfd_sessions script low Low: read-only or trivially reversible

    Show BFD sessions

    Show BFD sessions with interface, local and peer address, state (up, down, init, admin-down), whether they authenticate, the configured key reference, timers and detect multiplier, plus the sessions that are not up. BFD keys are never returned.

    Link to this action View source on GitHub
  • tnsr.bgp_hard_reset script high High: can disrupt service

    Reset a BGP session

    Tear down and re-establish a BGP session (`clear bgp <peer>`) through netgate-bgp:bgp-clear. Every route learned from the peer is withdrawn until the session comes back, which can move or drop traffic. tnsr.bgp_soft_reset refreshes routes without dropping the session.

    Arguments
    Name Type Required
    peer string Yes
    vrf string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.bgp_neighbors script low Low: read-only or trivially reversible

    Show BGP neighbor detail and routes

    Show FRR BGP neighbor detail (`show route dynamic bgp neighbors`): state and uptime, timers, message statistics, capabilities and per-family prefix counts for every neighbor or one peer. With view, show that peer's advertised, received or accepted routes, prefix counts, flap statistics or graceful-restart state for one family; views need peer and family.

    Arguments
    Name Type Required
    peer string No
    view string No
    family string No
    vrf string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.bgp_prefix script low Low: read-only or trivially reversible

    Show the BGP paths for a prefix

    Show the FRR BGP table entry for one prefix (`show route dynamic bgp <family> network <prefix>`): every path with AS path, next hop, origin, local preference, communities and which path is best.

    Arguments
    Name Type Required
    prefix string Yes
    vrf string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.bgp_soft_reset script medium Medium: changes state, easily reversible

    Soft-reset a BGP session

    Ask a BGP peer to resend its routes and resend ours (`clear bgp <peer> soft`) through netgate-bgp:bgp-clear with soft set. The session stays up while changed route maps or prefix lists take effect; tnsr.bgp_neighbors shows the result.

    Arguments
    Name Type Required
    peer string Yes
    vrf string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.bgp_summary script low Low: read-only or trivially reversible

    Show BGP peer summary

    Show the FRR BGP summary for a VRF (`show route dynamic bgp summary`): router ID, local AS, and each neighbor's AS, message counts, up/down time, state or received prefix count. A neighbor showing Active, Idle or Connect instead of a prefix count is not established.

    Arguments
    Name Type Required
    vrf string No
    family string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.bonds script low Low: read-only or trivially reversible

    Show bond interfaces and LACP state

    Show bond (LAG) interfaces with mode, load balancing, active and total member counts and a degraded flag, plus each member's LACP rx/tx/mux state and actor and partner system, key and port. A member whose partner system is all zeros or whose mux state is not collecting-distributing is not passing traffic in the bundle.

    Link to this action View source on GitHub
  • tnsr.cancel_reboot script medium Medium: changes state, easily reversible

    Cancel a scheduled reboot

    Cancel a reboot scheduled with tnsr.reboot or `reboot <minutes>` (`reboot cancel`).

    Link to this action View source on GitHub
  • tnsr.certificates script low Low: read-only or trivially reversible

    List certificates and their expiry

    List the certificates and certificate authorities in the TNSR PKI store with their not-after date and days left, and those expiring within the given number of days (RESTCONF server, IPsec and other certificates). Only names and dates are returned, never certificate or key material.

    Arguments
    Name Type Required
    expiring_within_days integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.clear_interface_counters script medium Medium: changes state, easily reversible

    Clear interface counters

    Reset the dataplane counters of one interface, or of every interface when name is omitted, through netgate-interface:clear-interface-counters. Useful before measuring whether errors are still increasing. Monitoring that reads the counters (SNMP, Prometheus) sees a counter reset.

    Arguments
    Name Type Required
    name string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.config_diff script medium Medium: changes state, easily reversible

    Diff two configuration versions

    Show the unified diff between two saved configuration versions (`show db history version-diff`), the change a maintenance or an incident introduced. Every line that holds a TNSR secret element (keys, pre-shared keys, passwords, SNMP communities, the license phrase) is rewritten to [REDACTED] before output, from the closed list of secret leaves in the TNSR YANG models; other configuration text is returned as is.

    Arguments
    Name Type Required
    from_version string Yes
    to_version string Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.config_history script low Low: read-only or trivially reversible

    List configuration versions and change log

    List the TNSR configuration history (git-backed in /var/tnsr): whether history and autosave are on, the saved version names (manual and auto-<timestamp>), and the change log entries newest first. Compare two versions with tnsr.config_diff.

    Arguments
    Name Type Required
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.config_load_version script high High: can disrupt service

    Restore a saved configuration version

    Load a saved configuration version and commit it to the running configuration (`db history version load`), undoing every change made since it was saved. Settings for IPsec, DHCP or the dataplane may need a service restart to take full effect. tnsr.config_history lists versions and tnsr.config_diff compares them.

    Arguments
    Name Type Required
    name string Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.config_save_version script medium Medium: changes state, easily reversible

    Save a named configuration version

    Save the current configuration as a named version in TNSR's configuration history (`db history version save`), a restore point to take before a change. Names follow git reference rules and auto- is reserved. Restore it with tnsr.config_load_version.

    Arguments
    Name Type Required
    name string Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.dataplane_counters script low Low: read-only or trivially reversible

    Show dataplane drop and error counters

    Show the dataplane packet counters (`show packet-counters`) parsed into rows of count, graph node, reason and severity, largest first. These counters say why packets were dropped or punted: VPF block reasons, rx misses, TTL expiry, IPsec and VRRP errors. Filter by severity or node name.

    Arguments
    Name Type Required
    severity string No
    node_contains string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.dhcp_leases script low Low: read-only or trivially reversible

    List DHCP server leases

    List the Kea DHCPv4 server leases: address, MAC, client hostname, state, subnet, lifetime, last transaction time and expiry. Filter by address, MAC or hostname text.

    Arguments
    Name Type Required
    address string No
    mac string No
    hostname_contains string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.interface script low Low: read-only or trivially reversible

    Show one TNSR interface in detail

    Show one dataplane interface: state, every counter, ACL bindings, IPv4 MTU and MSS clamping, VRRP instances, and its configuration (enabled, MTU, rx-mode, addresses, DHCP client, bond, bridge, LLDP, VLAN tag rewrite). Names are TNSR interface names such as WAN or GigabitEthernet0/14/2; list them with tnsr.interfaces.

    Arguments
    Name Type Required
    name string Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.interface_set_enabled script high High: can disrupt service

    Enable or disable a TNSR interface

    Set an interface's administrative state with a RESTCONF PATCH of interfaces-config/interface enabled, then read back admin and link status. Disabling an interface stops all traffic on it, including VRRP, routing adjacencies and any management path through it. Reverse with the opposite enabled value.

    Arguments
    Name Type Required
    name string Yes
    enabled boolean Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.interfaces script low Low: read-only or trivially reversible

    List TNSR interfaces with link state and counters

    List dataplane interfaces with admin and link state, speed, MTU, MAC, VRF, IPv4/IPv6 addresses, VLAN and bond membership, traffic and error counters, and an issues list (link down while admin up, rx/tx errors, rx misses, no-buffer drops, dataplane drops). problems_only keeps only interfaces with issues. tnsr.interface shows one interface's full counters and configuration.

    Arguments
    Name Type Required
    name_contains string No
    problems_only boolean No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.ipsec_tunnels script low Low: read-only or trivially reversible

    Show IPsec tunnels and security associations

    Show each IPsec tunnel with its configuration (enabled, IKE version and role, identities, authentication method names, child SA traffic selectors) and live state (IKE SA state, peers, algorithms, rekey timers, and per-child-SA state, SPIs and byte/packet counters), plus an issue when an enabled tunnel has no established IKE SA or no installed child SA. Pre-shared keys and manual ESP keys are never returned.

    Arguments
    Name Type Required
    instance integer No
    problems_only boolean No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.license script low Low: read-only or trivially reversible

    Show the TNSR license

    Show who the TNSR license is issued to and its extensions (feature names, limits and validity dates) through the netgate-license:license-get RPC. The license phrase, the signed license certificate and the contact email are never returned.

    Link to this action View source on GitHub
  • tnsr.logs script medium Medium: changes state, easily reversible

    Read TNSR system logs

    Read recent system journal lines, newest first, through netgate-logging:logging-get-messages: from one TNSR service unit (ipsec, routing, ntp, dhcp, dns, dataplane, snmp, ssh, backend, snort) or the kernel, at or above a priority, within the last minutes. Returns raw log text that can contain addresses, usernames and other request data.

    Arguments
    Name Type Required
    source string No
    priority string No
    since_minutes integer No
    lines integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.neighbors script low Low: read-only or trivially reversible

    List ARP and IPv6 neighbor entries

    List the dataplane neighbor table (ARP and IPv6 ND): interface, IP address, MAC address, whether the entry is static, and its age. Filter by interface, address or MAC.

    Arguments
    Name Type Required
    interface string No
    address string No
    mac string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.ntp_status script low Low: read-only or trivially reversible

    Show NTP synchronization

    Show the NTP peers TNSR uses with reachability, selection state, authentication flags, and their source address, stratum, reach, offset, delay and jitter, plus whether a peer is selected (the clock is synchronized).

    Link to this action View source on GitHub
  • tnsr.ospf script low Low: read-only or trivially reversible

    Show OSPF state

    Show FRR OSPFv2 state (`show route dynamic ospf`): neighbors and their adjacency state, interfaces, the OSPF routing table, the link-state database (optionally one LSA type), border routers, or router information. Configuration output is not offered.

    Arguments
    Name Type Required
    view string No
    lsa_type string No
    vrf string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.ospf6 script low Low: read-only or trivially reversible

    Show OSPFv3 state

    Show FRR OSPFv3 (IPv6) state (`show route dynamic ospf6`): neighbors, interfaces, areas, the route table, the link-state database, link state, border routers, or SPF information. Configuration output is not offered.

    Arguments
    Name Type Required
    view string No
    vrf string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.packet_trace script medium Medium: changes state, easily reversible

    Trace packets through the dataplane

    Capture a dataplane packet trace: clear the trace buffer, trace up to packets packets arriving on an input graph node (dpdk-input for DPDK NICs), wait, then return each packet's path through the graph nodes, including the VPF rule that passed or blocked it and the node that dropped it. Traces carry packet headers (addresses, ports, MACs) of live traffic.

    Arguments
    Name Type Required
    node string No
    packets integer No
    wait_seconds integer No
    verbose boolean No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.ping script low Low: read-only or trivially reversible

    Ping from the TNSR firewall

    Send a few ICMP echo requests from the firewall itself through netgate-system:system-ping, from the dataplane namespace (TNSR interfaces) or the host namespace (management), optionally from a given interface or source address, and return the ping output with loss and round-trip times.

    Arguments
    Name Type Required
    destination string Yes
    count integer No
    timeout_seconds integer No
    interface string No
    source string No
    packet_size integer No
    namespace string No
    family string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.reboot script critical Critical: data loss or irreversible

    Reboot the TNSR firewall

    Schedule a reboot of the TNSR host (`reboot <minutes>`) through netgate-system:system-reboot, one minute from now by default so it can still be cancelled with tnsr.cancel_reboot. All forwarding stops until the system is back, and running configuration that was not saved to startup is lost.

    Arguments
    Name Type Required
    delay_minutes integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.restart_dataplane script critical Critical: data loss or irreversible

    Restart the TNSR dataplane

    Restart VPP, the TNSR dataplane, through netgate-dataplane:dataplane-control. All forwarding stops until VPP is back: every interface, VPF connection state, NAT mapping, IPsec SA and routing adjacency is lost and rebuilt.

    Link to this action View source on GitHub
  • tnsr.restart_service script high High: can disrupt service

    Restart a TNSR service

    Restart a TNSR control-plane service through its control RPC: routing (FRR, every routing adjacency drops and re-forms), ipsec (charon, every IPsec tunnel drops and renegotiates), dhcp (Kea stop then start; leases persist, and a start that fails after the stop is reported as DHCP being down), dns (Unbound, the resolver cache is lost), ntp, or snmp. tnsr.restart_dataplane restarts the dataplane.

    Arguments
    Name Type Required
    service string Yes
    namespace string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.rollback_now script high High: can disrupt service

    Roll back the configuration now

    Trigger the running rollback timer immediately (`db rollback trigger`): TNSR restores and commits the configuration snapshot taken when the timer started, undoing every change made since. Services such as IPsec or the dataplane may need a restart to apply every restored setting.

    Link to this action View source on GitHub
  • tnsr.rollback_timer_cancel script medium Medium: changes state, easily reversible

    Cancel the rollback timer and keep changes

    Cancel the running rollback timer (`db rollback cancel`) so the changes made since it started are kept and no automatic rollback happens.

    Link to this action View source on GitHub
  • tnsr.rollback_timer_extend script high High: can disrupt service

    Reset the configuration rollback timer

    Reset a running rollback timer to expire the given number of minutes from now (`db rollback timer restart`). The value replaces the remaining time rather than adding to it, so it can also bring the automatic restore closer.

    Arguments
    Name Type Required
    minutes integer Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.rollback_timer_start script high High: can disrupt service

    Start a configuration rollback timer

    Snapshot the running (or startup) configuration and start a timer of 1 to 120 minutes; when it expires TNSR restores and commits that snapshot (`db rollback timer start`). tnsr.rollback_timer_cancel keeps the changes made meanwhile and tnsr.rollback_now restores at once. The restore undoes every change made after the snapshot, including other administrators' changes, and a startup source puts the saved startup configuration over running. The timer does not survive a TNSR restart.

    Arguments
    Name Type Required
    minutes integer Yes
    source string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.rollback_timer_status script low Low: read-only or trivially reversible

    Show the configuration rollback timer

    Show whether a configuration rollback timer is running, how many seconds remain before TNSR restores the saved configuration, which configuration it restores (running or startup snapshot) and who started it.

    Link to this action View source on GitHub
  • tnsr.route_lookup script low Low: read-only or trivially reversible

    Look up the route a destination uses

    Look up which route and next hops the dataplane FIB uses for a destination address or prefix in a route table, through netgate-route-table:route-lookup. A bare address is looked up as a host prefix (longest match). exact matches only the given prefix. Returns the matched prefix and its paths (gateway, interface, weight, drop or local).

    Arguments
    Name Type Required
    destination string Yes
    table string No
    exact boolean No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.running_config script medium Medium: changes state, easily reversible

    Read one section of the running configuration

    Read one section of the running configuration as RESTCONF JSON (interfaces, VPF, static or dynamic routing, IPsec, DHCP, DNS, NTP, ACLs, host ACLs, BFD, dataplane, system, SNMP, logging, or NACM). Every TNSR secret leaf (keys, pre-shared keys, passwords and hashes, SNMP communities, license phrase) is deleted by name before output, from the closed list of secret leaves in the TNSR YANG models. Sections larger than 400 KB are refused in favor of the focused reads.

    Arguments
    Name Type Required
    section string Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.service_status script medium Medium: changes state, easily reversible

    Show a TNSR service status

    Show the status of a TNSR-managed service through its control RPC: whether the daemon is running (dataplane VPP, routing FRR, ipsec charon, dhcp Kea, dns Unbound, ntp, snmp, ssh) and the last few journal lines, which can contain addresses, usernames and other raw log text.

    Arguments
    Name Type Required
    service string Yes
    namespace string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.static_route_add script high High: can disrupt service

    Add a static route

    Add a static route to a TNSR route table (VRF) with a RESTCONF PUT of the route entry, then read it back from the applied state. Give a next_hop address, an interface, or both, or blackhole to drop matching traffic. An existing route for the same destination is never replaced; remove it with tnsr.static_route_delete first. A wrong route can blackhole or misdirect production traffic.

    Arguments
    Name Type Required
    destination string Yes
    next_hop string No
    interface string No
    blackhole boolean No
    table string No
    description string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.static_route_delete script high High: can disrupt service

    Delete a static route

    Delete the static route for a destination from a TNSR route table with a RESTCONF DELETE and confirm it left the applied state. Returns the removed route so it can be added back with tnsr.static_route_add. Traffic then follows the next-longest matching route, or is dropped when none exists.

    Arguments
    Name Type Required
    destination string Yes
    table string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.static_routes script low Low: read-only or trivially reversible

    List static routes by route table

    List the static routes TNSR applied in each route table (VRF): destination, description, priority, route class, and next hops (gateway, interface, weight, drop/local/null flags). Dynamic routes are not included: tnsr.route_lookup shows the route a destination actually takes, and the BGP and OSPF reads show learned routes.

    Arguments
    Name Type Required
    table string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.system_status script low Low: read-only or trivially reversible

    Show TNSR system and dataplane status

    Show the TNSR product version, model and serial, the host OS, uptime, memory and swap use, and the dataplane worker threads with their CPU placement and (on 26.10) whether the dataplane configuration is in sync. Reads netgate-system:system-state and netgate-dataplane:dataplane-state. Memory values are reported in TNSR's own units with a unit-free used_percent.

    Link to this action View source on GitHub
  • tnsr.traceroute script low Low: read-only or trivially reversible

    Trace the route from the TNSR firewall

    Trace the path from the firewall to a destination through netgate-system:system-traceroute, from the dataplane or host namespace, without reverse DNS by default, and return each hop with its round-trip times.

    Arguments
    Name Type Required
    destination string Yes
    max_hops integer No
    wait_seconds integer No
    no_dns boolean No
    interface string No
    source string No
    namespace string No
    family string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_connections script medium Medium: changes state, easily reversible

    List VPF connection states

    List VPF connection-table entries, the live flows through the firewall: who connects to whom (source and destination address and port), protocol and TCP state, pass or block, bound interface, NAT translation, idle time and expiry, and packet/byte counters. Returns per-flow traffic metadata of the firewall's users. Filter by address, port, protocol or type; at most limit entries.

    Arguments
    Name Type Required
    source string No
    destination string No
    translation string No
    source_port integer No
    destination_port integer No
    translation_port integer No
    protocol string No
    type string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_connections_clear script high High: can disrupt service

    Clear matching VPF connection states

    Remove VPF connection-table entries that match the given address, port or protocol selectors through netgate-vpf:vpf-connections-clear. At least one address or port selector is required and a /0 prefix is refused, so one call never clears the whole table or every flow of a protocol. Matching flows lose their state and NAT mapping: TCP sessions break and the next packet is re-evaluated against the current rules. VPF HA syncs the removal to its peers. tnsr.vpf_connections lists what the same selectors match.

    Arguments
    Name Type Required
    source string No
    destination string No
    translation string No
    source_port integer No
    destination_port integer No
    translation_port integer No
    protocol string No
    type string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_filter_rule_add script high High: can disrupt service

    Add a VPF firewall filter rule

    Add one rule to a VPF filter ruleset at an unused sequence number with a RESTCONF PUT, then read it back from the applied state with its match counters. Rules match first-wins by sequence, so the sequence decides whether the rule acts before existing rules (tnsr.vpf_filter_rules lists them). A rule covers one direction; both directions take two rules. A pass rule opens access; a block rule can cut production traffic. An existing sequence is never replaced, and more than one of prefix, table or interface on one side is refused. tnsr.vpf_filter_rule_delete removes it.

    Arguments
    Name Type Required
    ruleset string Yes
    sequence integer Yes
    action string Yes
    direction string Yes
    ip_version string No
    protocols string No
    stateful boolean No
    from_prefix string No
    from_table string No
    from_interface string No
    from_ports string No
    from_port_table string No
    to_prefix string No
    to_table string No
    to_interface string No
    to_ports string No
    to_port_table string No
    description string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_filter_rule_delete script high High: can disrupt service

    Delete a VPF firewall filter rule

    Delete one rule from a VPF filter ruleset by sequence with a RESTCONF DELETE, confirm it left the applied state, and return the removed rule so it can be recreated with tnsr.vpf_filter_rule_add. Removing a pass rule blocks its new traffic; removing a block rule lets later rules decide for new flows, while flows held by a stateful block stay dropped until their state expires or tnsr.vpf_connections_clear removes it. Absent is reported as unchanged.

    Arguments
    Name Type Required
    ruleset string Yes
    sequence integer Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_filter_rules script low Low: read-only or trivially reversible

    List VPF firewall filter rules

    List VPF filter rulesets and their rules in sequence order: action (pass, block, block with RST or ICMP), direction (in or out; TNSR applies a rule without one to out), IP version, protocols, source and destination (prefix, prefix table, interface addresses, ports, port table), stateful and tentative flags, and packet/byte match counters. Interfaces bind rulesets as shown by tnsr.vpf_status; rules match first-wins unless tentative.

    Arguments
    Name Type Required
    ruleset string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_nat_rules script low Low: read-only or trivially reversible

    List VPF NAT rules

    List VPF NAT rulesets and their rules: direction, algorithm, dynamic, endpoint-independent and port-translation flags, match criteria, translation (interface address, prefix or table, port, port range or mapping), and packet/byte match counters. Inbound rules with a translation port are port forwards; outbound dynamic rules are source NAT.

    Arguments
    Name Type Required
    ruleset string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_prefix_add script high High: can disrupt service

    Add a prefix to a VPF prefix table

    Add an address prefix to an inline VPF prefix table with a RESTCONF PUT, then confirm it is in the applied state. Every rule that references the table changes behavior at once: adding to a blocklist blocks the prefix, adding to an allowlist grants access. IPv4 prefixes must use their network address and may not overlap an existing entry. Already present is reported as unchanged. Reverse with tnsr.vpf_prefix_remove; tables loaded from files cannot be edited.

    Arguments
    Name Type Required
    table string Yes
    prefix string Yes
    description string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_prefix_remove script high High: can disrupt service

    Remove a prefix from a VPF prefix table

    Remove an address prefix from an inline VPF prefix table with a RESTCONF DELETE and confirm it left the applied state. Rules referencing the table stop matching the prefix at once: removing from a blocklist unblocks it, removing from an allowlist revokes access. Absent is reported as unchanged.

    Arguments
    Name Type Required
    table string Yes
    prefix string Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vpf_status script low Low: read-only or trivially reversible

    Show VPF firewall status and connection counts

    Show the VPF stateful firewall and NAT engine: whether it is enabled, which filter and NAT rulesets each interface uses, connection table limits, NAT port range, state timeouts, active connection counts per worker thread and in total (by filter and NAT type on 26.02 and later), and VPF HA state sync peers with how recently they were heard.

    Link to this action View source on GitHub
  • tnsr.vpf_tables script low Low: read-only or trivially reversible

    List VPF prefix and port tables

    List VPF prefix tables (blocklists, allowlists, GeoIP sets) and port tables with their entries. With address, also report which prefix tables contain that address: IPv4 addresses match any containing prefix, IPv6 addresses match exactly. Tables loaded from MMDB or CSV files list the entries VPF loaded.

    Arguments
    Name Type Required
    table string No
    address string No
    limit integer No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • tnsr.vrrp script low Low: read-only or trivially reversible

    Show VRRP high-availability state

    Show every VRRP virtual router on the dataplane interfaces: interface and link state, address family, VRID, state (master, backup, initialize, interface-down), priority, preemption, virtual addresses and MAC, and tracked interfaces with their priority decrements, plus a count of instances where this node is master.

    Link to this action View source on GitHub
  • tnsr.wireguard script low Low: read-only or trivially reversible

    Show WireGuard tunnels and peers

    Show each WireGuard interface (instance, interface, listen address and port, public key, link state and traffic counters) and its peers (endpoint, port, allowed prefixes, public key). The interface private key, which TNSR includes in this state tree, is never returned.

    Link to this action View source on GitHub