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).
Table of Contents
Configuration and Operational Mode Basics
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.
The default mode when logging into the command line is Operational Mode. To switch to Configuration Mode, use the configure
command:
ubnt@edgerouter:~$ configure
[edit] ubnt@edgerouter#
$
, 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...>
?
does not display onscreen.If you wish to run an Operational Mode command from while in 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
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 theset
ordelete
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.
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
EdgeRouter - How to Configure an Interface
EdgeRouter - How to Create a WAN Firewall Rule
EdgeRouter - Archiving and Managing the Configuration Files
Intro to Networking - How to Establish a Connection Using SSH