CLI

This guide explains how to use the SSH command-line interface (CLI) of the MetaDefender Industrial Firewall (MDIF). It is written to be read top-to-bottom the first time, then used as a reference. The same CLI runs on every MDIF model — only the port labels differ.

1. Key concepts

Five things make everything else click. Read this section once and the rest of the guide will make sense.

1.1 Connecting

Open an SSH session with any client (PuTTY, OpenSSH, …). The CLI starts automatically when you log in:

ssh <username>@<device-ip> Password: ******** OPSWAT Shell OPSWAT15>

The text before the > is your device's hostname. OPSWAT15> is used throughout this guide as an example prompt.

1.2 The prompt tells you where you are

The CLI is a tree. You start at the root prompt, where you can view everything but change nothing. To make changes you step into a configuration context with a configure … command — the prompt changes to show where you are. top jumps back to the root from anywhere; exit leaves the current context (or logs you out from the root).

OPSWAT15> root prompt — run "show ..." to view configuration OPSWAT15> configure firewall step into the firewall context OPSWAT15(firewall)> the (firewall) tag means changes land here OPSWAT15(firewall)> top jump straight back to the root prompt OPSWAT15> exit log out of the CLI

Each configure … command and the area it controls:

Enter with

What you configure there

configure firewall

Firewall rules, IP objects, DPI profiles, flow learning, routing/transparent settings

configure network

Per-interface IP settings and port mode (routing / transparent pair)

configure time

System clock, timezone, NTP servers

configure management-access

Firewall rules for the device's own management plane

configure arp-protection

IP-MAC bindings and ARP validation

configure dos

DoS / DDoS protection thresholds

configure system

Hostname, login banner, session timeout

1.3 The most useful key: ?

You never have to memorize the command tree. At any prompt, type ? to list every command available right where you are, each with a short description. Press Tab to auto-complete a partly-typed command. Because the available commands change with your context — and with your role — ? always shows exactly what you can do here and now.

OPSWAT15> ? configure enter a configuration context show view current configuration ping / traceroute network diagnostics export / import back up or restore configuration via USB reboot restart the device ... OPSWAT15> configure firewall OPSWAT15(firewall)> ? rule add / delete / enable / disable firewall rules dpi-profile manage DPI profiles object-management manage reusable IP objects set routing / transparent settings & flow learning ...

(The exact commands and wording depend on your device model and your role — non-administrators see only show and diagnostic commands.)

1.4 Routing vs. Transparent — the one distinction to know

Every data port runs in one of two modes, and many commands come in a routing and a transparent flavor:

  • Routing — the port has its own IP address and the firewall routes traffic between subnets (like a traditional router/firewall).

  • Transparent — two ports are bridged into a transparent pair; the firewall inspects traffic passing through the bridge without having an IP on those ports (a "bump in the wire").

Run show firewall ports at any time to see which mode each port is in. If a command or setting says "routing" or "transparent", it applies only to ports in that mode.

1.5 How to read the command syntax in this guide

Notation

Meaning

<value>

You must supply this value (e.g. <ip>).

[value]

Optional — include it only if you need it.

Port-1

Port labels with a space are typed with a dash. The tokenizer splits on spaces, so type Port-1, not Port 1. Matching is space/dash/case-insensitive, so Port-1, port1, and the bare number 1 all mean the same port.

1.6 Who can run what

  • Administrators (privilege level 15) get the full CLI — all show, configure, and maintenance commands.

  • Non-administrators get a read-only CLI: only show and diagnostic commands. Every write command and configuration context is hidden from ?/Tab and rejected if typed. CLI access is granted per-user under Settings → User Management in the web UI.

2. Your first session

This short walkthrough shows the rhythm of almost every change: look → enter a context → change → preview → save → verify. It adds one firewall rule and confirms it. Commands you type are after the >; everything else is the device's response. Tip: at any point, press ? to see what you can type next (see §1.3).

Step 1 — See your ports. Start by learning the port names on your device:

OPSWAT15> show firewall ports Label Mode PCI LAN Transparent 0000:01:00.0 DEVICE Transparent 0000:02:00.0 SFP Routing 0000:03:00.0 Management Routing 0000:04:00.0

Step 2 — Look at the current rules (so you have a "before" picture):

OPSWAT15> show firewall routing-rules

Step 3 — Enter the firewall context and add a rule. This one allows HTTPS (TCP/443) from one host to a subnet, routed from the LAN port to the SFP port:

OPSWAT15> configure firewall OPSWAT15(firewall)> rule add routing LAN SFP TCP 192.168.10.50 192.168.20.0/24 443 * Routing rule created (ID 42).

Step 4 — Verify, then return to the root. List the rules again and confirm your new one is there:

OPSWAT15(firewall)> top OPSWAT15> show firewall routing-rules

That's the whole loop. Some areas (interfaces, NTP, DPI profiles) build a change field-by-field and ask you to type show to preview and save to commit — you will see that pattern in the next section. Nothing is applied until you save (or, for one-line commands, until the command returns a * success line).

On an 8-port device the labels are Port 1Port 6 and SFP 1/SFP 2 — type them with a dash (Port-1). The 4-port labels (LAN/DEVICE/SFP/Management) are used in the examples below.

3. Common tasks

Copy-paste recipes for the things people do most. Each links to the full command reference for every option.

3.1 Add or remove a firewall rule

OPSWAT15> configure firewall # Allow Modbus from anywhere to a PLC, read-only OPSWAT15(firewall)> rule add routing LAN SFP Modbus any 192.168.30.10 502 Read-Only # Remove a rule by its No. from "show firewall routing-rules" OPSWAT15(firewall)> rule delete routing 42

Full options, the interactive form, and transparent/Ethernet rules: see Reference §4.2–4.4.

3.2 Give a routing interface an IP address

OPSWAT15> configure network OPSWAT15(network)> interface SFP # edit a routing port OPSWAT15(network-if*)> ip 192.168.20.1/24 OPSWAT15(network-if*)> gateway 192.168.20.254 OPSWAT15(network-if*)> show # preview your pending changes OPSWAT15(network-if*)> save # apply

Details and port-mode changes: see Reference §4.10.

3.3 Add an NTP server

OPSWAT15> configure time OPSWAT15(time)> ntp add 203.0.113.9 interface SFP min 4 max 10 description Plant-NTP

min and max (poll-interval exponents, 3–17) are required. See Reference §4.11.

3.4 Create a reusable IP object

OPSWAT15> configure firewall OPSWAT15(firewall)> object-management add subnet HQ-Network network 192.168.10.0/24

You can then use HQ-Network wherever a rule expects a source/destination. See Reference §4.6.

3.5 Add a DPI profile (allowed function codes)

OPSWAT15> configure firewall # See the valid codes first, then create a profile that allows only those OPSWAT15(firewall)> show firewall dpi-codes modbus OPSWAT15(firewall)> dpi-profile modbus add PlantRead 10 codes 1,3,5

All protocols and their add syntax: see Reference §4.5.

3.6 Tune a DoS protection

OPSWAT15> configure dos OPSWAT15(dos)> tcp syn-fin enable limit 100 burst 50

Every protection and its limits: see Reference §4.14.

3.7 Back up the configuration to USB

# First: insert a USB drive and make sure the USB port is enabled OPSWAT15> usb status # if it says disabled, run "usb enable" OPSWAT15> show backups configuration # see what is stored OPSWAT15> export backup configuration # write a backup to the USB drive

Import, firewall-rule transfer, and encryption notes: see Reference §4.16.

4. Command reference

Every command, grouped by area. Concepts (prompts, the ? help key, routing vs transparent, syntax notation) are explained in §1.

4.1 Viewing configuration (the show family)

show commands display current state, can be run from any prompt, and are available to every user.

# Firewall show firewall Counts of routing and transparent rules show firewall ports Port labels and their current mode show firewall routing-rules [<N>] Routing-mode rules (or one rule's detail) show firewall transparent-rules [<N>] Transparent-mode IP rules (or one rule's detail) show firewall transparent-rules ethernet [<N>] Transparent-mode Ethernet (MAC) rules show firewall object-management [<N>] Reusable IP address objects show firewall activities [<protocol>] Supported DPI protocols and activity levels show firewall dpi-codes <protocol> Function-code catalog for an OT protocol show firewall dpi-profile <protocol> [<name>] DPI profiles for a protocol # Flow learning & protected assets show firewall routing-settings Forward policy + log-limit + bandwidth-limit show firewall routing-learning Learn-all-traffic toggle + learning ports show firewall routing-protected-assets Protected-asset table (No. | IP | Name) show firewall transparent-settings Monitor-Log / Block-L2 / Log-ARP / Block-ARP show firewall transparent-learning Learn-all-traffic + ports + IP-spoofing show firewall transparent-protected-assets Protected-asset table (No. | IP | Name) # Network / time show network [<port>] Per-interface IP table (or one interface) show time Current date / time / timezone show time ntp Configured NTP servers # Security services show management-access [<N>] Management-access (system) rules show arp-protection ARP settings summary + binding count show arp-protection settings Enabled / Log values show arp-protection bindings [<N>] IP-MAC bindings (or one binding's detail) show dos [tcp|udp|icmp] DoS protections (all, or one family) # System / backups show system settings Hostname / login banner / session timeout show backups <type> Stored backups of a type (configuration | system) show usb-files Files on the USB drive available to import

Example — show firewall ports on an 8-port device (4-port output is shown in §2):

OPSWAT15> show firewall ports Label Mode PCI Port 1 Transparent 0000:07:00.0 Port 2 Transparent 0000:08:00.0 Port 3 Routing 0000:09:00.0 Port 4 Routing 0000:0a:00.0 Port 5 Routing 0000:0d:00.0 Port 6 Routing 0000:0e:00.0 SFP 1 Routing 0000:0f:00.0 SFP 2 Routing 0000:10:00.0

4.2 Firewall rules

All rule operations are under configure firewall. Routing rules apply between two routing-mode ports; transparent rules apply on transparent-bridge ports (IP rules here; MAC rules in §4.4).

Single-line form:

rule add routing <in-iface> <out-iface> <protocol> <src> <dst> <dst-port> [activity] rule add transparent <iface> <protocol> <src> <dst> <dst-port> [activity]

Source / destination accept the literal any, an IPv4 address (192.168.1.10), a CIDR subnet (192.168.10.0/24), a range (192.168.10.5-192.168.10.50), or the name of an IP object (§4.6).

Activity (OT protocols): for protocols like Modbus, OPC-UA, EtherNet/IP, DNP3, BACnet, GOOSE, SV, PROFINET, S7Comm, OPC-Classic and BN3500, the optional [activity] restricts what operations are allowed. Run show firewall activities <protocol> for the valid levels; if omitted, the most permissive level is used.

Interactive form — omit the trailing arguments to build a rule field-by-field, previewing with show and committing with save:

OPSWAT15(firewall)> rule add routing Recommended order: incoming_iface, outgoing_iface, protocol, source_ip, source_port, dest_ip, dest_port, activity, rule_type, enable_log Type 'show' to preview, 'save' to commit, 'top' to abandon. OPSWAT15(routing*)> incoming_iface LAN OPSWAT15(routing*)> outgoing_iface SFP OPSWAT15(routing*)> protocol Modbus OPSWAT15(routing*)> activity Read-Only OPSWAT15(routing*)> source_ip HQ-Network OPSWAT15(routing*)> dest_ip 192.168.30.10 OPSWAT15(routing*)> dest_port 502 OPSWAT15(routing*)> save * Routing rule created (ID 42).

4.3 Delete, enable, or disable a rule

Rules are addressed by the No. column from show firewall routing-rules / transparent-rules. Numbers renumber after a delete, so re-run show before the next delete.

rule delete routing <N> rule delete transparent <N> rule enable <N> rule disable <N>

4.4 Transparent-mode Ethernet (MAC) rules

Layer-2 rules that match on source/destination MAC, between two transparent ports. Under configure firewall:

rule add transparent-ethernet <in-iface> <out-iface> <src-mac> <dst-mac> <action> [activity] rule delete transparent-ethernet <N> rule delete-all transparent-ethernet # remove all Ethernet rules rule delete-all transparent-ip # remove all transparent IP rules

<action> is allow or block. MACs may be colon-, dash-, or no-separator form (normalized to lowercase colon form); use any to match all. Example: rule add transparent-ethernet LAN DEVICE aa:bb:cc:dd:ee:ff any allow.

4.5 DPI profiles

A DPI profile lists the protocol function codes / methods that are permitted. Manage under configure firewall; inspect with show firewall dpi-codes <protocol> and show firewall dpi-profile <protocol>.

Protocol keyword

Add syntax

modbus

dpi-profile modbus add <name> <index> codes <list>

pnptcp

dpi-profile pnptcp add <name> <index> codes <list>

mqtt

dpi-profile mqtt add <name> <index> codes <list>

dnp3

dpi-profile dnp3 add <name> <index> codes <list>

ethernetip

dpi-profile ethernetip add <name> <index> entries <entries>

opc_classic

dpi-profile opc_classic add <name> <index> methods <list>

bn3500

dpi-profile bn3500 add <name> <index> sdi <list> [tdi <list>]

  • codes / <list> = comma-separated integers, e.g. 1,3,5,15.

  • methods = comma-separated method names, e.g. Read,Browse,Write.

  • entries = comma-separated EtherNet/IP entries, each fc:svc:inst[:pccc+pccc+...].

  • sdi/tdi = BN3500 channel IDs.

dpi-profile modbus delete <name> # delete one profile dpi-profile modbus delete-all # delete all Modbus profiles # (delete / delete-all work for every protocol keyword above)

4.6 IP address objects

Named, reusable address groups. A rule that references an object always uses the object's current value — change the object and every rule using it updates. Under configure firewall:

object-management add single <name> ip <ip> object-management add range <name> start <ip> end <ip> object-management add subnet <name> network <cidr> object-management delete <N> object-management delete-all

Names are alphanumeric / underscore / hyphen, case-insensitive when referenced, and must be unique. Deleting an object that a rule uses prints a warning listing the affected rules.

4.7 Flow learning & protected assets

Flow Learning Mode (FLM) lets the device learn OT traffic and protected assets. Routing and transparent modes have independent settings, under configure firewall.

# Routing set routing-learn-all-traffic <enable|disable> set routing-learning-ports <iface1>[,<iface2>,...] | all | none routing-protected-asset add <ip> [name <friendly>] routing-protected-asset delete <No.> routing-protected-asset delete-all # Transparent set transparent-learn-all-traffic <enable|disable> set transparent-learning-ports <iface1>[,...] | all | none set transparent-ip-spoofing <enable|disable> transparent-protected-asset add <ip> [name <friendly>] transparent-protected-asset delete <No.> transparent-protected-asset delete-all

4.8 Routing-mode firewall settings

Global routing controls, under configure firewall (view with show firewall routing-settings):

set routing-settings forward-policy <accept|drop> set routing-settings log-limit <enable|disable> [rate <n>] [burst <n>] set routing-settings bandwidth-limit <enable|disable> [rate <n> <unit>] [burst <n> <unit>]
  • forward-policy — default action for unmatched traffic.

  • log-limit — rate-limit firewall log entries (per-second).

  • bandwidth-limit — throttle forwarded traffic; <unit> e.g. mbit.

4.9 Transparent-mode firewall settings

Global transparent toggles, under configure firewall (view with show firewall transparent-settings):

set transparent-settings monitor-log <enable|disable> set transparent-settings block-l2 <enable|disable> set transparent-settings log-arp-violation <enable|disable> set transparent-settings block-arp <enable|disable>

Block L2 drops all Layer-2 traffic including ARP, which stops ICMP/IP forwarding too. Enable it only when you intend to block all non-allowlisted L2 traffic on the bridge.

4.10 Network settings

Per-interface IP configuration for routing interfaces, and port-mode changes, under configure network. (Transparent ports show N/A for IP columns; the management interface IP is changed with configure management — see §4.17.)

OPSWAT15> configure network OPSWAT15(network)> interface SFP # routing port only OPSWAT15(network-if*)> ip 192.168.20.1/24 OPSWAT15(network-if*)> dhcp 0 # 0/1 or disable/enable OPSWAT15(network-if*)> gateway 192.168.20.254 OPSWAT15(network-if*)> arp-proxy 0 OPSWAT15(network-if*)> show # preview OPSWAT15(network-if*)> save # commit # Port mode port <portA> transparent <portB> # pair two ports into a transparent bridge port <portA> routing # break the pair — both ports return to Routing

The default gateway is a single device-wide route. If another interface already owns it, setting a gateway on a second routing port is rejected.

4.11 Time settings

Under configure time (view with show time / show time ntp):

datetime <YYYY/MM/DD_HH:MM:SS> # set the clock (underscore between date and time) timezone <Olson/Name> # e.g. America/New_York ntp add <ip> interface <port> min <3-17> max <3-17> [description <dash-text>] ntp delete <No.>

The NTP source interface must be a routing or management interface (transparent ports have no IP). min and max are the poll-interval exponents (3–17) and are required — the web UI marks both fields required, so the CLI rejects an ntp add that omits either.

4.12 Management Access rules

Rules that govern access to the device's own management plane, under configure management-access (view with show management-access):

rule add <name> <direction> <target> <protocol> <src_ip> <dst_ip> <dst_port> # category = USER rule add # interactive form rule delete <No.> rule enable <No.> rule disable <No.>

Example: rule add http-server2 inbound Allow tcp any 192.168.100.0/24 8002

Predefined system-rule categories (Management, OSPF, …) cannot be deleted, edited, enabled, or disabled. Only the USER rules you create can be changed.

4.13 ARP Protection

IP-MAC bindings and ARP validation, under configure arp-protection (view with show arp-protection):

enabled <enable|disable|0|1> # toggle ARP validation log <enable|disable|0|1> # toggle ARP logging binding add <ip> <mac> <iface> binding delete <No.> binding delete-all

Bindings exclude the management interface.

4.14 DoS / DDoS Protection

Per-protection thresholds, under configure dos (view with show dos or show dos tcp|udp|icmp). limit is packets-per-second; burst (where supported) is the burst allowance. DoS protection applies in both routing and transparent modes.

tcp syn-fin <enable|disable|1|0> [limit <n>] [burst <n>] tcp xmas <enable|disable|1|0> [limit <n>] [burst <n>] tcp null-scan <enable|disable|1|0> [limit <n>] [burst <n>] tcp offset <enable|disable|1|0> [limit <n>] [burst <n>] tcp min-header <enable|disable|1|0> [limit <n>] [burst <n>] tcp src-session <enable|disable|1|0> [limit <n>] tcp dst-session <enable|disable|1|0> [limit <n>] udp flood <enable|disable|1|0> [limit <n>] [burst <n>] udp src-session <enable|disable|1|0> [limit <n>] udp dst-session <enable|disable|1|0> [limit <n>] icmp flood <enable|disable|1|0> [limit <n>] [burst <n>] icmp sweep <enable|disable|1|0> [limit <n>] icmp src-session <enable|disable|1|0> [limit <n>] icmp dst-session <enable|disable|1|0> [limit <n>]

4.15 System settings

Under configure system (view with show system settings):

hostname <name> # 1–30 chars; alphanumeric and hyphen login-message <dash-text> # up to 255 chars; hyphens become spaces session-timeout <1-1440> # minutes; applies to CLI and web UI

4.16 Backup, restore & configuration transfer

Export configuration backups and firewall-rule sets to a removable USB drive, and import them back. These run from any prompt and only ever touch a removable USB partition — never an internal disk. Encryption is prompted interactively (the password is never on the command line).

Before you start: the USB port must be enabled and exactly one USB drive inserted. If the port is off, these commands report * USB port is disabled. Enable it with \ usb enable and try again.— run usb status to check and usb enable to turn it on (see §4.17).

# Inspect show backups <type> List stored backups of a type show usb-files List files on the USB drive available to import # Export to USB export backup <type> [<index>] Export a stored backup (no index = snapshot the running config) export backup Interactive wizard (TTY): pick a type, then an index export firewall-rule <mode> Export routing/transparent firewall rules # Import from USB (files picked by index into "show usb-files") import backup <type> <index> Import a config backup (then offers to apply it) import firewall-rule <mode> <index> Import a routing/transparent firewall-rule set

Argument

Accepted values

<type>

configuration (structured JSON; encryption optional) · system (full-config tar; encryption mandatory)

<mode>

routing or transparent

<index>

The number beside the file in show usb-files / show backups <type> (filenames can contain characters the CLI rejects, so files are chosen by index)

Import/Export supports the following file types for configuration backups, firewall rules, and system backups:

  • Configuration backup: plaintext .json or encrypted .json.bin

  • System backup: encrypted .bin only. System backups are always encrypted on export.

  • Firewall rules: plaintext .json or encrypted .json.enc

4.17 Other commands

Also available; some are destructive — consult your administrator first.

Command

Purpose

software list / software apply <N> / software delete <N>

Inspect and apply firmware packages

usb enable / usb disable / usb status

Control the USB port (admin only)

bypass <state> <action>

Hardware-bypass relay control — will disrupt the management/web path and your session

configure management

Change management mode or management IP — will drop your current SSH session

ping / traceroute / show arp / date / taillog

Network diagnostics and device info

reset / reboot / factory_reset

Restart or factory-reset the device

Destructive operationsfactory_reset, software apply, configure management, erase, and bypass can disconnect or erase device state. The CLI records the operator and command in the audit log before the operation begins, so it is traceable even if your session drops.

5. Audit trail

Every command you type is recorded for compliance and forensics:

Log

Contents

Where to view

System Log (web UI)

Every command, including read-only show ..., with the operator's username and exact command line. Failed dispatches are flagged.

Logs → System Log

Device syslog

Successful configuration changes, with semantic detail. Suitable for SIEM forwarding.

/var/log/syslog; forwarding under Settings → Logging

6. Error messages

Message

Meaning & fix

! syntax error at <word>

The token isn't recognized here. Press ? for valid commands. Type space-containing labels with a dash (Port-1). Non-admins: write/configure commands are hidden and report this.

! incomplete command

You pressed Enter before all required arguments were supplied. Press ? after the partial command.

! ambiguous command at <word>

The token matches more than one command. Type more characters.

* Error: 'X' is not a valid IP/CIDR/range and no object named 'X' exists.

The source/destination is neither a valid address nor a known object. Run show firewall object-management.

* Object name 'X' already exists.

Pick a different name or delete the existing object first.

* Unknown port label 'X'. Available: ...

The port name matches no interface. Run show firewall ports / show network (dash form for spaced labels).

* Interface 'X' not found or not a transparent port.

An Ethernet/transparent rule needs both interfaces in transparent mode. Check show firewall ports.

* '...' is a Transparent port — it has no IP and cannot be used as an NTP source.

Choose a routing or management interface for the NTP source.

* min refresh is required. / * max refresh is required.

ntp add requires both min and max (3–17), e.g. ... min 4 max 10.

* session-timeout must be 1-1440 minutes.

Pick a value between 1 and 1440 minutes.

! Access denied. CLI privileges required.

Your account lacks CLI privileges. Ask an admin (Settings → User Management).


The CLI is hardware-agnostic — the same commands work on the 4-port and 8-port models; only the port labels differ.