@@ -3,52 +3,79 @@ icon: fas fa-terminal
3
3
order : 2
4
4
---
5
5
6
- The CLI configure context is automatically generated from the loaded
7
- YANG models and their corresponding [ sysrepo] [ 2 ] plugins. The following
8
- is brief example of how to set the IP address of an interface:
6
+ The CLI configure context is generated from the loaded [ YANG ] [ 1 ] models
7
+ and their corresponding [ sysrepo] [ 2 ] plugins. The following is brief
8
+ example of how to set the IP address of an interface.
9
9
10
- ```
10
+ > The ` <TAB> ` shown here means press the Tab key to show possible
11
+ > command completions.
12
+ {: .prompt-tip }
13
+
14
+ ``` console
11
15
admin@infix-12-34-56:/ > configure
12
16
admin@infix-12-34-56:/config/ > edit interface eth0
13
17
admin@infix-12-34-56:/config/interface/eth0/ > set ipv4 < TAB>
14
18
address autoconf bind-ni-name enabled
15
- forwarding mtu neighbor
19
+ forwarding mtu neighbor
16
20
admin@infix-12-34-56:/config/interface/eth0/ > set ipv4 address 192.168.2.200 prefix-length 24
17
21
admin@infix-12-34-56:/config/interface/eth0/ > show
18
22
type ethernet;
19
23
ipv4 {
20
24
address 192.168.2.200 {
21
- prefix-length 24;
25
+ prefix-length 24
22
26
}
23
27
}
24
28
ipv6
29
+ ```
30
+
31
+ Whenever you've made a change in configure context, you can see inspect
32
+ the modifications with the ` diff ` command:
33
+
34
+
35
+ ``` diff
25
36
admin@infix-12-34-56:/config/interface/eth0/> diff
26
37
interfaces {
27
38
interface eth0 {
28
39
+ ipv4 {
29
40
+ address 192.168.2.200 {
30
- + prefix-length 24;
41
+ + prefix-length 24
31
42
+ }
32
43
+ }
33
44
}
34
45
}
46
+ ```
47
+
48
+ To activate the changes you can issue the ` leave ` command anywhere.
49
+ (Use the ` abort ` command to cancel all changes.) Inspect the changes
50
+ made, and remember to save your changes to ` startup-config ` .
51
+
52
+ ``` console
35
53
admin@infix-12-34-56:/config/interface/eth0/ > leave
36
54
admin@infix-12-34-56:/ > show interfaces
37
55
INTERFACE PROTOCOL STATE DATA
38
- eth0 ethernet UP 52:54:00:12:34:56
39
- ipv4 192.168.2.200/24 (static)
40
- ipv6 fe80::5054:ff:fe12:3456/64 (link-layer)
41
56
lo ethernet UP 00:00:00:00:00:00
42
57
ipv4 127.0.0.1/8 (static)
43
58
ipv6 ::1/128 (static)
59
+ eth0 ethernet UP 52:54:00:12:34:56
60
+ ipv4 192.168.2.200/24 (static)
61
+ ipv6 fe80::5054:ff:fe12:3456/64 (link-layer)
44
62
admin@infix-12-34-56:/ > copy running-config startup-config
45
63
```
46
64
65
+ > In the CLI all changes are made to the ` running-config ` , providing you
66
+ > with a basic "undo" mechanism -- in case you make a change that locks
67
+ > you out, e.g., changing IP address on the same interface used to log
68
+ > in to the device -- you can simply reboot the device to get back to
69
+ > the previous state.
70
+ {: .prompt-tip }
71
+
72
+
47
73
Curious? Continue reading:
48
74
- [ CLI Introduction] [ 3 ]
49
75
- [ Networking Lego®] [ 6 ]
50
76
51
77
78
+ [ 1 ] : https://datatracker.ietf.org/doc/html/rfc7950
52
79
[ 2 ] : https://www.sysrepo.org/
53
80
[ 3 ] : https://github.com/kernelkit/infix/tree/main/doc/cli
54
81
[ 6 ] : https://github.com/kernelkit/infix/blob/main/doc/networking.md
0 commit comments