Skip to content

Configure Device Prompts in rConfig V8 Core

Device prompts tell rConfig V8 Core when a device has finished returning command output and is ready for the next command. After reading this page, you can configure accurate main and enable prompts, write regex patterns for variable or multi-mode prompts, and troubleshoot the backup timeouts and incomplete captures that prompt mismatches cause.

Use this page when you are adding a device or vendor template and need to set its prompt pattern, or when backups are timing out, returning truncated configs, or failing CIC checks. Prompt configuration is the most common cause of these symptoms, so it is the first thing to check when a device captures slowly or incompletely.

  • A configured device or vendor in rConfig (see Add and manage devices and Vendors)
  • The actual prompt the device displays, captured from a live SSH or Telnet session
  • For regex patterns: basic familiarity with regular expressions, or access to regex101.com for testing

Device prompts are the text strings a network device displays to signal it is ready for the next command. rConfig matches these patterns to know when command output has finished, then proceeds to the next command in the backup sequence.

Common prompts by vendor:

  • Cisco IOS / IOS-XE: Router# or Router(config)#
  • Juniper JUNOS: user@router> or user@router#
  • Arista EOS: switch# or switch(config)#
  • Palo Alto Networks: admin@PA-firewall> or admin@PA-firewall#

When the configured pattern does not match what the device actually displays, rConfig waits for the command timeout before continuing. That produces slow backups, truncated output, and failed integrity (CIC) checks.

rConfig uses two prompt fields to handle different CLI modes.

FieldWhen it is usedTypical value
Main promptAfter every standard command during a backuphostname#, user@hostname>, .*#
Enable promptAfter the enable / privilege escalation command, before privileged commands runhostname# (often the same as main)

Not every device needs a separate enable prompt. If the device shows the same prompt before and after privilege escalation, set the enable prompt to match the main prompt. Set them differently only when the device shows a distinct privileged-mode indicator, for example main user@device> and enable user@device#.

For devices with a consistent prompt, a static value is reliable. If a device always displays Router-NYC#:

Main Prompt: Router-NYC#
Enable Prompt: Router-NYC#

Configuration sub-mode prompts like Switch-LAB(config)# do not need separate configuration as long as they end with #, which the standard pattern already matches.

For multiple devices that share a naming convention, use a wildcard. Router-.*# matches Router-Site1#, Router-NYC#, and Router-Production-East#. The broadest pattern, .*#, matches virtually any prompt ending in #.

rConfig V8 Core supports regular expressions in the prompt fields, which handles dynamic hostnames, multiple CLI modes, and multi-vendor environments.

Metacharacters used in prompt patterns:

TokenMeaning
.Any single character
.*Any sequence of characters (zero or more)
.+Any sequence of characters (one or more)
?Makes the preceding element optional
|OR operator (match this or that)
^Start of line anchor
$End of line anchor
\dAny digit
\wAny word character (letter, digit, underscore)
\sAny whitespace

Characters that must be escaped with a backslash to match literally: ( ) [ ] { } . * + ? | ^ $. For example, write \(config\) to match the literal parentheses in hostname(config)#.

Variable hostname with a fixed suffix (myrouter-NYC#, myrouter-LAB#):

myrouter-.*#

All configuration mode prompts (hostname(config)#, hostname(config-if)#, hostname(config-vlan)#):

hostname\(config.*\)#$

Here \( and \) match the literal parentheses, config.* matches config plus any sub-mode, and #$ anchors the # to the end of the line.

Match either # or > for a multi-vendor environment:

.*[#>]$

Prompts with a trailing privilege level (router#15, router#1, router#):

router#\d*$

\d* matches zero or more digits after #, so it covers prompts with and without a level number.

Use anchors for precise matching. ^hostname.*#$ ensures hostname is at the start of the line and # is at the end, preventing a match against some-prefix-hostname#.

Use alternation to match multiple device families: (Router|Switch|Firewall)-.*#.

Use optional groups to make whole sections optional. hostname(-\w+)?\(config\)# matches both hostname(config)# and hostname-site01(config)#.

Use character classes for exact formats. Router-[A-Z]{3}\d{2}# matches Router-NYC01# and Router-LAB02# (three uppercase letters then two digits).

Test every pattern against real device output before deploying it.

  1. Capture the actual prompt from a live SSH or Telnet session to the device.
  2. Open regex101.com and select PHP as the flavor.
  3. Enter your pattern in the regular expression field, with no delimiters.
  4. Paste the captured prompts (and any prompts that should NOT match) into the test string field.
  5. Confirm every expected prompt matches and unwanted prompts do not.
  6. Read the explanation panel to confirm each token does what you intend.

For a Cisco device that may sit in several config modes, test all of these strings against a pattern such as .*\(config.*\)?#$:

Router-NYC#
Router-NYC(config)#
Router-NYC(config-if)#
Router-NYC(config-router)#
Switch-LAB#
Switch-LAB(config-vlan)#

After you have a tested pattern:

  1. Enter the pattern in the Main Prompt and Enable Prompt fields on the device or vendor template, without delimiters.
  2. Run a backup of a single device to confirm prompt detection (php artisan rconfig:device-backup --device-id=123, adjusting the ID for your environment).
  3. Review the log for prompt or timeout warnings:
Terminal window
grep -i "prompt\|timeout" /var/www/html/rconfig/storage/logs/laravel.log
  1. Open the captured configuration and confirm it is complete and passes its CIC check.
  2. Check the backup duration: no timeout delay confirms the prompt matched on every command.
VendorTypical promptRecommended pattern
Cisco IOS / IOS-XERouter# or Router(config)#.*\(config.*\)?#$
Juniper JUNOSuser@router> or user@router#.*@.*[>#]$
Arista EOSSwitch# or Switch(config)#.*\(config.*\)?#$
Palo Alto Networksadmin@firewall> or admin@firewall#.*@.*[>#]$
HP ProCurve / ArubaSwitch# or Switch(config)#.*\(config.*\)?#$
Fortinet FortiGateFortiGate # or FortiGate (config) #.* (\(.*\) )?#$

The configured pattern does not match the actual prompt, so rConfig waits for each command timeout before continuing. Connect to the device manually, compare its real prompt with your pattern, and check the log for timeout warnings:

Terminal window
tail -n 200 /var/www/html/rconfig/storage/logs/laravel.log | grep -i "timeout\|prompt"

Update the pattern to match the live prompt and re-test at regex101.com. Each mismatch can add the full command timeout (often 10 to 30 seconds) per command, which across a 20-command backup and hundreds of devices significantly extends the backup window.

rConfig stopped capturing early because the pattern matched text inside the command output. A bare # pattern, for example, matches description Link to Core Switch #1 mid-config. Anchor the pattern to the full prompt line instead:

.*#$

The leading .* and trailing $ ensure the pattern matches a complete prompt line rather than any stray # in the output.

The enable prompt does not match the privileged-mode prompt, so rConfig does not recognise successful escalation. Run enable manually on the device, note the resulting prompt, and set the enable prompt to match it. Where user and privileged prompts are identical, set both fields to the same pattern.

A generic pattern is matching prompts from unintended devices or command output. Narrow it toward your actual device naming, for example from .*# to Router-.*# to Router-Production-\d{2}#.

When debugging a complex pattern, build it up one token at a time (hostname, then hostname\(config, then hostname\(config.*\)?#$) to find which part fails, and test against the exact prompt copied from a live device.

Special characters that need escaping in a prompt pattern: (\(, )\), [\[, ]\], {\{, }\}.

Configuration checklist: