From 865ff07ba7cd0d7c40751253d61ed26bb14f4ba3 Mon Sep 17 00:00:00 2001 From: currite <53279076+currite@users.noreply.github.com> Date: Thu, 9 Jan 2020 21:18:10 +0100 Subject: command tree configmode: expand explanation and example of edit command recycling https://blog.vyos.io/copying/renaming-node-comments-and-other-little-known-features-of-the-vyos-cli --- docs/appendix/commandtree/configmode.rst | 37 ++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'docs/appendix/commandtree/configmode.rst') diff --git a/docs/appendix/commandtree/configmode.rst b/docs/appendix/commandtree/configmode.rst index f70fbb23..049863b6 100644 --- a/docs/appendix/commandtree/configmode.rst +++ b/docs/appendix/commandtree/configmode.rst @@ -232,16 +232,45 @@ Edit ^^^^ The ``edit`` command allows you to navigate down into the configuration tree. + +To avoid writing or pasting long paths, +you can set the edit level to any node with the "edit" command, +such as "edit firewall name Foo". +Once you are at some level, you can use relative node paths, +such as "set rule 10 action accept" in this case. + To get back to an upper level, use the ``up`` command or use the ``top`` command to get back to the upper most level. The ``[edit]`` text displays where the user is located in the configuration tree. .. code-block:: none + vyos@vyos# edit firewall name Foo + + [edit firewall name Foo] + + vyos@vyos# set rule 10 protocol tcp + + [edit firewall name Foo] + + vyos@vyos# edit rule 10 + + [edit firewall name Foo rule 10] + + vyos@vyos# set destination port 22 + + [edit firewall name Foo rule 10] + + vyos@vyos# up + + [edit firewall name Foo] + + vyos@vyos# set rule 10 description "Allow SSH" + + [edit firewall name Foo] + + vyos@vyos# top + [edit] - vyos@vyos# edit interfaces - [edit interfaces] - vyos@vyos# edit ethernet eth0 - [edit interfaces ethernet eth0] Exit ^^^^ -- cgit v1.2.3