]> git.sur5r.net Git - ngadmin/blob - cli/man/ngcli.1
Cli: add command to show network configuration details
[ngadmin] / cli / man / ngcli.1
1 .TH NGCLI "1" "October 2013" "NgAdmin 0.1" "User Commands"
2 .SH NAME
3 ngcli \- command line interface tool for GS10[58]E administration
4 .
5 .SH SYNOPSIS
6 ngcli [\fIOPTIONS\fR]
7 .
8 .SH DESCRIPTION
9 .
10 .PP
11 This is a cli tool intended for administration of Netgear switches that use
12 NSDP. Currently, only the GS105E and GS108E are concerned.
13 .br
14 It uses the readline library (if enabled at compilation) to read command lines
15 and supports command auto-completion with the TAB key.
16 .
17 .SH OPTIONS
18 .
19 .TP
20 .B "\-a, \-\-batch"
21 By default, NgCli uses readline to provide an interactive command line
22 interface. You can disable this and use basic text input, which can be useful
23 for scripting purposes. You can also see \fB\-m\fR, \fB\-p\fR and \fB\-r\fR
24 options.
25 .br
26 If readline is disabled at compilation time, it is the default and only choice.
27 .
28 .TP
29 .B "\-b, \-\-keep\-broadcasting"
30 Keep broadcasting even when talking with a particular switch.
31 By default, once you login on a switch, NgAdmin talks with it using unicast.
32 This prevents the password from being sent to all your network. The switch
33 still replies using broadcast, but the password is not included in the replies.
34 .br
35 This option allows you to disable this feature and do like the official Windows
36 application that always use broadcast packets. This also allows to configure a
37 switch which is not on your network range without forcing the interface.
38 .br
39 When you enable this option, you must be aware that on every modification
40 you make, your password is broadcasted to all your network.
41 .
42 .TP
43 .B "\-f, \-\-force\-interface"
44 Force traffic to go through the specified interface. This can be useful when
45 you have multiple interfaces or the switch is not on your network range.
46 .br
47 Requires root privileges.
48 .
49 .TP
50 .B "\-h, \-\-help"
51 Show basic help instructions.
52 .
53 .TP
54 \fB\-i, \-\-interface\fI iface
55 Set the interface to use to \fIiface\fR. Defaults to eth0 when not specified.
56 However, this does not force the traffic to go through this interface.
57 If you have multiple interfaces, you can use \fB\-l\fR or \fB\-f\fR options.
58 .
59 .TP
60 .B "\-l, \-\-local\-broadcast"
61 By default, NgCli uses the global broadcast address (255.255.255.255) to send
62 data to all the network. With this option, the interface broadcast address will
63 be used instead (for example 192.168.1.255). This can be useful to force
64 traffic to go through the specified interface without forcing the interface.
65 .br
66 However, some switches seem to ignore packets sent to this type of addresses.
67 .
68 .TP
69 \fB\-m, \-\-mac\fI mac
70 Enable automatic login. NgCli will automatically scan the network and try to
71 login on the switch with the MAC address \fImac\fR. \fImac\fR must be specified
72 as six hexadecimal bytes separated by a colon.
73 .
74 .TP
75 \fB\-p, \-\-password\fI password
76 Set the password to use with automatic login to \fIpassword\fR. Be aware that
77 the password will be part of the command line, which means everybody on the
78 machine can do a "ps" to see it.
79 .
80 .TP
81 \fB\-r, \-\-retries\fI count
82 Set the maximum scan and login attempts in automatic login mode to \fIcount\fR.
83 Defaults to 3 when not specified and 0 means unlimited attempts.
84 .
85 .TP
86 \fB\-t, \-\-timeout\fI value
87 Define the maximum to wait for switch replies in \fIvalue\fR milliseconds.
88 Defaults to 4 seconds when not specified.
89 .
90 .
91 .SH COMMANDS
92 .
93 .TP
94 \fBbitrate set\fR [ all [ inout \fIspeed\fR ] [ in \fIspeed\fR ] \
95 [ out \fIspeed\fR ] ] [ \fIport\fR [ inout \fIspeed\fR ] [ in \fIspeed\fR ] \
96 [ out \fIspeed\fR ]  ] [...]
97 Set the bitrate limit on several several \fIport\fR. Setting the first port to
98 "all" assigns the same value to all the ports.
99 .br
100 Acceptable \fIspeed\fR values are:
101 nl (no limit), 512K, 1M, 2M, 4M, 8M, 16M, 32M, 64M, 128M, 256M, 512M
102 .
103 .TP
104 \fBbitrate show
105 Show bitrate limitation configuration.
106 .
107 .TP
108 \fBcabletest\fI port\fR [...]
109 Perform a cable test on one or several \fIport\fR.
110 .
111 .TP
112 \fBdefaults
113 Reset the switch to the defaults parameters. Automatically delogs from the
114 current switch.
115 .
116 .TP
117 \fBfirmware show
118 Show the current firmware version.
119 .
120 .TP
121 \fBfirmware upgrade\fI file
122 Upgrade the firmware contained in the \fIfile\fR.
123 .
124 .TP
125 \fBhelp
126 Display all the commands.
127 .
128 .TP
129 \fBigmp set \fIenable vlan validate block
130 Set IGMP filtering related options. \fIenable\fR, \fIvalidate\fR and
131 \fIblock\fR must set either to 0 to disable or 1 to enable. \fIvlan\fR must be
132 a VLAN number.
133 .br
134 \fIenable\fR : enable or disable IGMP filtering
135 .br
136 \fIvlan\fR : VLAN number on which the filtering is performed
137 .br
138 \fIvalidate\fR : enable or disable IGMPv3 header validation
139 .br
140 \fIblock\fR : enable or disable blocking of unknown addresses
141 .
142 .TP
143 \fBigmp show
144 Show IGMP filtering configuration.
145 .
146 .TP
147 \fBlist
148 List the detected switches on the network.
149 .
150 .TP
151 \fBlogin \fIid
152 Login on switch with ID \fIid\fR. The \fBlist\fR command shows IDs of detected
153 switches. This command delogs from the current switch, whether the login
154 attempt is successful or not.
155 .
156 .TP
157 \fBmirror disable
158 Disable port mirroring.
159 .
160 .TP
161 \fBmirror set\fI outport\fR clone\fI port\fR [...]
162 Enable port mirroring, copy data from one or several \fIport\fR and output
163 data on \fIoutport\fR. Obviously, \fIoutport\fR must not be in the source ports
164 list.
165 .
166 .TP
167 \fBmirror show
168 Show port mirroring configuration.
169 .
170 .TP
171 \fBname clear
172 Clear the switch name.
173 .
174 .TP
175 \fBname set\fI name
176 Set the switch name to \fIname\fR.
177 .
178 .TP
179 \fBname show
180 Show the switch name.
181 .
182 .TP
183 \fBnetconf show
184 Show the network configuration.
185 .
186 .TP
187 \fBnetconf set\fR [ dhcp yes|no ] [ ip \fIip\fR ] [ mask\fI mask\fR ] \
188 [ gw\fI gw\fR ]
189 Set various network related options. \fIip\fR, \fImask\fR and \fIgw\fR must be
190 IPv4 addresses in dotted quad form.
191 .br
192 dhcp : enable or disable DHCP client on the switch
193 .br
194 ip : set the switch IP to \fIip\fR
195 .br
196 mask : set the switch netmask to \fImask\fR
197 .br
198 gw : set the switch gateway to \fIgw\fR
199 .
200 .TP
201 \fBpassword change\fI password
202 Change the switch password to \fIpassword\fR.
203 .
204 .TP
205 \fBpassword set\fR [ \fIpassword\fR ]
206 Set the password used to connect to \fIpassword\fR. If not specified, it is
207 asked from user (with terminal echo disabled).
208 .
209 .TP
210 \fBports state
211 Show the ports state and speed.
212 .
213 .TP
214 \fBports statistics reset
215 Reset the ports statistics.
216 .
217 .TP
218 \fBports statistics show
219 Show the ports statistics.
220 .
221 .TP
222 \fBqos mode\fR port|802.1p
223 Set QoS mode to either port based or 802.1p based.
224 .
225 .TP
226 \fBqos set\fR all\fI prio
227 In port based mode, set all ports priority to \fIprio\fR.
228 .br
229 Acceptable values for \fIprio\fR are high, medium, normal and low.
230 .
231 .TP
232 \fBqos set \fIport prio\fR [...]
233 In port based mode, set priority of several couples of \fIport\fR to \fIprio\fR.
234 \fIprio\fR is the same format as in the above command.
235 .
236 .TP
237 \fBqos show
238 Show QoS configuration.
239 .
240 .TP
241 \fBquit
242 Exit NgCli.
243 .
244 .TP
245 \fBrestart
246 Restart the switch.
247 .
248 .TP
249 \fBscan
250 Scan the network for switches.
251 .
252 .TP
253 \fBstormfilter enable
254 Enable storm filtering.
255 .
256 .TP
257 \fBstormfilter disable
258 Disable storm filtering.
259 .
260 .TP
261 \fBstormfilter set\fR all\fI speed
262 Set the storm filter bitrate of all ports to \fIspeed\fR. \fIspeed\fR is the
263 same format as in the \fBbitrate set\fR command.
264 .
265 .TP
266 \fBstormfilter set\fI port speed\fR [...]
267 Set the storm filter bitrate of several couples of \fIport\fR to \fIspeed\fR.
268 \fIspeed\fR is the same format as in the \fBbitrate set\fR command.
269 .
270 .TP
271 \fBstormfilter show
272 Show storm filtering configuration.
273 .
274 .TP
275 \fBtree
276 Display all the commands and their subcommands.
277 .
278 .TP
279 \fBvlan 802.1q del\fI vlan
280 Delete 802.1Q VLAN \fIvlan\fR.
281 .
282 .TP
283 \fBvlan 802.1q set\fI vlan\fR [ all unspec|no|untagged|tagged ] \
284 [ \fIport\fR unspec|no|untagged|tagged ] [...]
285 In 802.1Q based mode, set a particular VLAN membership of several \fIport\fR.
286 \fIvlan\fR is a VLAN number between 1 and 4093 inclusive.
287 Setting the port of the first couple to "all" assigns the same value to all the
288 ports.
289 .br
290 Also do not forget to set the PVID configuration as well with the
291 \fBvlan pvid set\fR command.
292 .br
293 When creating a new VLAN, no port must be in an unspecified state or the VLAN
294 creation will fail.
295 .br
296 Acceptable membership values are:
297 .br
298 unspec : unspecified (default), the configuration of this port is left unchanged
299 .br
300 no : the port is not member of this VLAN
301 .br
302 untagged : the port is member of this VLAN as untagged
303 .br
304 tagged : the port is member of this VLAN as tagged
305 .
306 .TP
307 \fBvlan 802.1q show
308 Show 8021Q based VLAN configuration.
309 .
310 .TP
311 \fBvlan mode set\fI mode
312 Set VLAN mode to \fImode\fR, acceptable values are:
313 .br
314 0 - disabled
315 .br
316 1 - basic port based
317 .br
318 2 - advanced port based
319 .br
320 3 - basic 802.1Q
321 .br
322 4 - advanced 802.1Q
323 .
324 .TP
325 \fBvlan mode show
326 Show VLAN mode.
327 .
328 .TP
329 \fBvlan port set\fR [ all\fI vlan\fR ] [ \fIport vlan\fR ] [...]
330 In port based mode, set the VLAN membership of several couples of \fIport\fR to
331 \fIvlan\fR. Setting the port of the first couple to "all" assigns the same VLAN
332 to all the ports.
333 .br
334 \fIvlan\fR is a VLAN number between 1 and 9 inclusive.
335 .
336 .TP
337 \fBvlan port show
338 Show port based VLAN configuration.
339 .
340 .TP
341 \fBvlan pvid set\fI port vlan
342 Set \fIport\fR PVID to \fIvlan\fR.
343 .
344 .TP
345 \fBvlan pvid show
346 Show VLAN PVID configuration.
347 .
348 .SH BUGS
349 .
350 .PP
351 Firmware upgrade is not implemented, because it would require some work in the
352 library and a TFTP client.
353 .br
354 And overvall, it could be dangerous, as it is not sure that the switch checks
355 whatever you send to it, which could lead to a bricked device.
356 .
357 .PP
358 Cabletest is not totally reversed, only raw values are shown.
359 .br
360 Also, you must manually increase timeout to be able to receive results.
361 .
362 .PP
363 Saving and loading whole configuration into/from a file is not implemented.
364 .
365 .SH AUTHOR
366 Written by HervĂ© Boisse (admin@darkcoven.tk).