diff options
author | currite <53279076+currite@users.noreply.github.com> | 2020-01-09 21:18:10 +0100 |
---|---|---|
committer | Robert Göhler <github@ghlr.de> | 2020-01-09 21:18:10 +0100 |
commit | 865ff07ba7cd0d7c40751253d61ed26bb14f4ba3 (patch) | |
tree | ba5cbb2851c210de3b008155a435098fcb4f2e64 /docs | |
parent | a90516e53cf583f3b8af8f0403a77f35f5ed9194 (diff) | |
download | vyos-documentation-865ff07ba7cd0d7c40751253d61ed26bb14f4ba3.tar.gz vyos-documentation-865ff07ba7cd0d7c40751253d61ed26bb14f4ba3.zip |
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
Diffstat (limited to 'docs')
-rw-r--r-- | docs/appendix/commandtree/configmode.rst | 37 |
1 files changed, 33 insertions, 4 deletions
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 ^^^^ |