EdgeRouter - Configuration and Operational Mode


Overview


In this article, readers will learn about the different modes that are used in the EdgeOS Command Line Interface (CLI).

NOTES & REQUIREMENTS: Applicable to the latest EdgeOS firmware on all EdgeRouter models. Knowledge of the Command Line Interface (CLI) and basic networking knowledge is required. Please see the Related Articles below for more information.
 
Devices used in this article:

Table of Contents


  1. Introduction
  2. Configuration and Operational Mode Basics
  3. Making Configuration Changes
  4. Related Articles

Introduction


Back to Top

There are two modes in the EdgeOS command line, this article describes what each does, how to switch from one to another in the Command Line Interface and finally how to make configuration changes via CLI. The Operational Mode, represented by a dollar sign $ is used to display the status of the device. The Configuration Mode, represented by a hashtag # is used to make configuration changes to the device.


Configuration and Operational Mode Basics


Back to Top

When you log in to the EdgeRouter via SSH/Telnet or by using the CLI button in the GUI, the default mode is operational mode. To switch to configuration mode, use the configure command:

ubnt@edgerouter:~$ configure
[edit] ubnt@edgerouter#
NOTE: Operational Mode is indicated by a dollar sign $, whereas Configuration Mode uses the hashtag #.  

To go back to operational mode, use the exit command:

[edit]                                                                          
ubnt@edgerouter# exit
exit

ubnt@edgerouter:~$

Each mode has its own unique commands. You can use the question mark ? key to display all the available commands in both modes. Press the ? key twice to also display the command descriptions:

ubnt@edgerouter:~$ ?

Possible completions:
  configure     Enter configure mode
  ping          Send Internet Control Message Protocol (ICMP) echo request
  reboot        Reboot the system
  show          Show system information
  shutdown      Shutdown the system
  traceroute    Track network path to <hostname|IPv4 address>
  traceroute6   Track network path to <hostname|IPv6 address>
  <...output shortened...>

ubnt@edgerouter:~$ configure

[edit]
ubnt@edgerouter# ?

Possible completions:
  commit        Commit the current set of changes
  compare       Compare configuration revisions
  delete        Delete a configuration element
  edit          Edit a sub-element
  exit          Exit from this configuration level
  run           Run an operational-mode command
  save          Save configuration to a file
  set           Set the value of a parameter or create a new element
  show          Show the configuration (default values may be suppressed)
  <...output shortened...>
NOTE: The second question mark ? does not display onscreen.

If you wish to run an operational mode command from while on configuration mode, use the run command.

[edit]
ubnt@edgerouter# run show ?

Possible completions:
  interfaces    Show network interface information
  ip            Show IPv4 routing information
  ipv6          Show IPv6 routing information
  <...output shortened...>

Making Configuration Changes


Back to Top

The EdgeRouter uses three configuration sets:

  • Boot/Startup Config: When the EdgeRouter reboots, it loads the boot/startup configuration (config.boot)
  • Active Config: Currently active configuration with changes that have not been saved to the boot/startup configuration yet.
  • Working Config: Non-active configuration with changes that have not been applied (committed) yet.

Use the following commands to make changes to the configuration:

  • set Adds a configuration statement from the device
  • delete Removes a configuration statement from the device
  • commit Applies any changes that were added with the set or delete commands
  • save Saves the active configuration to the boot/startup configuration

Let's say that we want to enable the Telnet service, we would issue the following:

[edit]
ubnt@edgerouter# set service telnet port 23

ubnt@edgerouter# compare
[edit service]
+telnet {
+ port 23
+}

[edit]
ubnt@edgerouter# commit

[ service telnet ]
Starting the telnet service. Check /var/log/messages.
NOTE: The compare command will show you the difference between the working and the active configurations.

Save the configuration changes to the boot/startup configuration by using the save command:

[edit]
ubnt@edgerouter# save
Saving configuration to '/config/config.boot'...

Instead of applying changes with the commit command, you can also use commit-confirm. The latter command reboots the device in 10 minutes (you can customize this value) unless the commit is confirmed with the confirm command. This is helpful when you are making changes to a remote device and you do not want to risk losing access to it. If you accidentally lock yourself out of the device, the EdgeRouter will reboot after 10 minutes and the boot/startup configuration is re-loaded.

[edit]
ubnt@edgerouter# delete service telnet

[edit]
ubnt@edgerouter# commit-confirm 5

commit-confirm will automatically reboot in 5 minutes unless confirmed
Proceed? [yes][y]
Type 'confirm' to stop reboot

[edit]
ubnt@edgerouter# confirm

Related Articles


Back to Top

Intro to Networking - How to Establish a Connection Using SSH

EdgeRouter - How to Configure an Interface

EdgeRouter - User Accounts

EdgeRouter - How to Create a WAN Firewall Rule

EdgeRouter - Archiving and Managing the Configuration Files


We're sorry to hear that!