summaryrefslogtreecommitdiff
path: root/docs/configuration-overview.rst
diff options
context:
space:
mode:
authorrunborg <runar@13xl.com>2019-06-25 20:37:47 +0200
committerKim <kim.sidney@gmail.com>2019-06-25 20:37:47 +0200
commit4c63a9d11d05b8ca6998de971d97182bc81f5ff0 (patch)
treedaeac0f9df514bef16e98d83fe502decc9e4119e /docs/configuration-overview.rst
parent43f4e6af2256d8de5589e89292707ba0c17a48c3 (diff)
downloadvyos-documentation-4c63a9d11d05b8ca6998de971d97182bc81f5ff0.tar.gz
vyos-documentation-4c63a9d11d05b8ca6998de971d97182bc81f5ff0.zip
T145: Migrate vyos history, migrate vyatta, ipsec-gre and restructure of configuration overview (#69)
* T1457: restructure configuration overview for the beginner user * T1457: install: restructure note about deprecated install system * T1457: migrate vyos history from the wiki * T1457: Migrate from vyatta: Migrated from the wiki * T1457: VPN: Migrate gre-ipsec from the wiki
Diffstat (limited to 'docs/configuration-overview.rst')
-rw-r--r--docs/configuration-overview.rst146
1 files changed, 129 insertions, 17 deletions
diff --git a/docs/configuration-overview.rst b/docs/configuration-overview.rst
index 3024c277..f7a3b078 100644
--- a/docs/configuration-overview.rst
+++ b/docs/configuration-overview.rst
@@ -63,9 +63,12 @@ The current configuration can be viewed using the show configuration command.
}
vyos@vyos:~$
-Because configuration changes are made using `set` and `delete` commands, the
-commands to generate the active configuration can also be displayed using the
-`show configuration commands` command.
+By default the configuration is display'ed in a hierarchy like the example above,
+this is only one of the possible ways to display the configuration.
+
+When the configuration is generated and the device is configured, these changes are added
+with a corresponding set of `set` and `delete` commands, as for this you could also display
+the current configuration using these `set` commands using the `show configuration commands` command.
.. code-block:: sh
@@ -85,28 +88,39 @@ commands to generate the active configuration can also be displayed using the
set system syslog global facility protocols level 'debug'
vyos@vyos:~$
-Configuration changes made do not take effect until committed using the commit
-command in configuration mode.
+Both these commands are for beeing executed when in operational mode, these commands does not work within the configuration mode.
+
+Navigating in Configuration Mode
+---------------------------------
+When entering the configuration mode you are navigating inside the tree structure exported in the overview above,
+to enter configuration mode enter the command `configure` when in operational mode
.. code-block:: sh
- vyos@vyos# commit
+ vyos@vyos$ configure
[edit]
- vyos@vyos# exit
- Warning: configuration changes have not been saved.
- vyos@vyos:~$
+ cyos@vyos#
-In order to preserve configuration changes upon reboot, the configuration must
-also be saved once applied. This is done using the save command in
-configuration mode.
+.. note:: Prompt changes from `$` to `#`. To exit configuration mode, type `exit`.
-.. code-block:: sh
+All commands executed here is relative to the configuration level you have entered, everything is possible to do from the top level
+but commands will be quite lengthy when manually typing them.
- vyos@vyos# save
- Saving configuration to '/config/config.boot'...
- Done
+To change the current hierarchy level use the command: `edit`
+
+.. code-block:: sh
+
[edit]
- vyos@vyos#
+ vyos@vyos# edit interfaces ethernet eth0
+
+ [edit interfaces ethernet eth0]
+ vyos@vyos#
+
+You are now in a sublevel relative to `interfaces ethernet eth0`,
+all commands executed from this point on are relative to this sublevel.
+to exit back to the top of the hierarchy use the `top` command or the `exit` command.
+This brings you back to the top of the hierarchy.
+
The show command within configuration mode will show the current configuration
indicating line changes with a + for additions and a - for deletions.
@@ -136,6 +150,87 @@ indicating line changes with a + for additions and a - for deletions.
[edit]
vyos@vyos#
+it is also possible to display all `set` commands within configuration mode using `show | commands`
+
+.. code-block:: sh
+
+ vyos@vyos# show interfaces iethernet eth0 | commands
+ set address dhcp
+ set hw-id 00:0c:29:44:3b:0f
+
+these command is also relative to the level you are inside and only relevant configuration blocks will be displayed when entering a sub-level
+
+.. code-block:: sh
+
+ [edit interfaces ethernet eth0]
+ vyos@vyos# show
+ address dhcp
+ hw-id 00:0c:29:44:3b:0f
+
+exiting from the configuration mode is done via the `exit` command from the top level, executing `exit` from within a sub-level takes you back to the top level.
+
+.. code-block:: sh
+
+ [edit interfaces ethernet eth0]
+ vyos@vyos# exit
+ [edit]
+ vyos@vyos# exit
+ Warning: configuration changes have not been saved.
+ vyos@vyos:~$
+
+
+
+
+Managing the configuration
+--------------------------
+
+The configuration is managed by the use of `set` and `delete` commands from within configuration mode
+Configuration commands are flattend from the tree into 'one-liner' commands shown in `show configuration commands` from operation mode
+
+these commands are also relative to the level where they are executed and all redundant information from the current level is removed from the command entered
+
+.. code-block:: sh
+
+ [edit]
+ vyos@vyos# set interface ethernet eth0 address 1.2.3.4/24
+
+ [edit interfaces ethernet eth0]
+ vyos@vyos# set address 1.2.3.4/24
+
+These two commands are essential the same, just executed from different levels in the hierarchy
+
+To delete a configuration entry use the `delete` command, this also deletes all sub-levels under the current level you've specified in the `delete` command.
+Deleting a entry could also mean to reset it back to its default value if the element is mandatory, in each case it will be removed from the configuration file
+
+.. code-block:: sh
+
+ [edit interfaces ethernet eth0]
+ vyos@vyos# delete address 1.2.3.4/24
+
+Configuration changes made do not take effect until committed using the commit
+command in configuration mode.
+
+.. code-block:: sh
+
+ vyos@vyos# commit
+ [edit]
+ vyos@vyos# exit
+ Warning: configuration changes have not been saved.
+ vyos@vyos:~$
+
+In order to preserve configuration changes upon reboot, the configuration must
+also be saved once applied. This is done using the save command in
+configuration mode.
+
+.. code-block:: sh
+
+ vyos@vyos# save
+ Saving configuration to '/config/config.boot'...
+ Done
+ [edit]
+ vyos@vyos#
+
+
Configuration mode can not be exited while uncommitted changes exist. To exit
configuration mode without applying changes, the exit discard command can be
used.
@@ -209,3 +304,20 @@ or TFTP.
Saving configuration to 'tftp://192.168.0.100/vyos-test.config.boot'...
######################################################################## 100.0%
Done
+
+Operational info from config mode
+---------------------------------
+
+When inside configuration mode you are not directly able to execute operational commands,
+access to these commands are possible trough the use of the `run [command]` command.
+from this command you will have access to everything accessable from operational mode,
+Command completeion and syntax help with `?` and `[tab]` wil also work.
+
+.. code-block:: sh
+
+ [edit]
+ vyos@vyos# run show interfaces
+ Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
+ Interface IP Address S/L Description
+ --------- ---------- --- -----------
+ eth0 0.0.0.0/0 u/u