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
This commit is contained in:
currite 2020-01-09 21:18:10 +01:00 committed by Robert Göhler
parent a90516e53c
commit 865ff07ba7

View File

@ -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
^^^^