@@ -7,60 +7,66 @@ The CLI configure context is generated from the loaded [YANG][1] models
77and their corresponding [ sysrepo] [ 2 ] plugins. The following is brief
88example of how to set the IP address of an interface.
99
10- > The ` < TAB> ` shown here means press the Tab key to show possible
10+ > The < kbd > TAB</ kbd > shown here means press the Tab key to show possible
1111> command completions.
1212 {: .prompt-tip }
1313
14- ``` console
15- admin@infix-12-34-56:/ > configure
16- admin@infix-12-34-56:/config/ > edit interface eth0
17- admin@infix-12-34-56:/config/interface/eth0/ > set ipv4 < TAB>
18- address autoconf bind-ni-name enabled
19- forwarding mtu neighbor
20- admin@infix-12-34-56:/config/interface/eth0/ > set ipv4 address 192.168.2.200 prefix-length 24
21- admin@infix-12-34-56:/config/interface/eth0/ > show
14+ <div class =" language-console " >
15+ <div class =" code-header " >
16+ <span data-label-text =" CLI " ><i class =" fas fa-code fa-fw small " ></i ></span >
17+ <button aria-label =" copy " data-title-succeed =" Copied! " ><i class =" fas fa-terminal " ></i ></button ></div >
18+ <pre class =" highlight " ><code class =" language-console " >admin@infix-12-34-56:/> <b >configure</b >
19+ admin@infix-12-34-56:/config/> <b >edit interface eth0</b >
20+ admin@infix-12-34-56:/config/interface/eth0/> <b >set ipv4 <kbd >TAB</kbd ></b >
21+ address autoconf bind-ni-name dhcp
22+ enabled forwarding mtu neighbor
23+ admin@infix-12-34-56:/config/interface/eth0/> <b >set ipv4 address 192.168.2.200 prefix-length 24</b >
24+ admin@infix-12-34-56:/config/interface/eth0/> <b >show</b >
2225type ethernet;
2326ipv4 {
2427 address 192.168.2.200 {
2528 prefix-length 24
2629 }
2730}
28- ipv6
29- ```
31+ ipv6</code ></pre ></div >
3032
3133Whenever you've made a change in configure context, you can see inspect
3234the modifications with the ` diff ` command:
3335
3436
35- ``` diff
36- admin@infix-12-34-56:/config/interface/eth0/> diff
37+ <div class =" language-console " >
38+ <div class =" code-header " >
39+ <span data-label-text =" diff " ><i class =" fas fa-code fa-fw small " ></i ></span >
40+ <button aria-label =" copy " data-title-succeed =" Copied! " ><i class =" fas fa-terminal " ></i ></button ></div >
41+ <pre class =" highlight " ><code class =" language-diff " >admin@infix-12-34-56:/config/interface/eth0/> <b >diff</b >
3742interfaces {
3843 interface eth0 {
39- + ipv4 {
44+ < span class = " gi " > + ipv4 {
4045+ address 192.168.2.200 {
4146+ prefix-length 24
4247+ }
43- + }
48+ + }</ span >
4449 }
45- }
46- ```
50+ }</code ></pre ></div >
4751
4852To activate the changes you can issue the ` leave ` command anywhere.
4953(Use the ` abort ` command to cancel all changes.) Inspect the changes
5054made, and remember to save your changes to ` startup-config ` .
5155
52- ``` console
53- admin@infix-12-34-56:/config/interface/eth0/ > leave
54- admin@infix-12-34-56:/ > show interfaces
56+ <div class =" language-console " >
57+ <div class =" code-header " >
58+ <span data-label-text =" CLI " ><i class =" fas fa-code fa-fw small " ></i ></span >
59+ <button aria-label =" copy " data-title-succeed =" Copied! " ><i class =" fas fa-terminal " ></i ></button ></div >
60+ <pre class =" highlight " ><code class =" language-console " >admin@infix-12-34-56:/config/interface/eth0/> <b >leave</b >
61+ admin@infix-12-34-56:/> <b >show interfaces</b >
5562INTERFACE PROTOCOL STATE DATA
5663lo ethernet UP 00:00:00:00:00:00
5764 ipv4 127.0.0.1/8 (static)
5865 ipv6 ::1/128 (static)
5966eth0 ethernet UP 52:54:00:12:34:56
6067 ipv4 192.168.2.200/24 (static)
6168 ipv6 fe80::5054:ff:fe12:3456/64 (link-layer)
62- admin@infix-12-34-56:/ > copy running-config startup-config
63- ```
69+ admin@infix-12-34-56:/> <b >copy running-config startup-config</b ></code ></pre ></div >
6470
6571> In the CLI all changes are made to the ` running-config ` , providing you
6672> with a basic "undo" mechanism -- in case you make a change that locks
@@ -77,5 +83,5 @@ Curious? Continue reading:
7783
7884[ 1 ] : https://datatracker.ietf.org/doc/html/rfc7950
7985[ 2 ] : https://www.sysrepo.org/
80- [ 3 ] : https://github.com/kernelkit/ infix/tree/main/doc/cli
81- [ 6 ] : https://github.com/kernelkit/ infix/blob/main/doc/ networking.md
86+ [ 3 ] : / infix/latest/cli/introduction/
87+ [ 6 ] : / infix/latest/ networking/
0 commit comments