]> git.sur5r.net Git - ngadmin/blob - cli/man/ngcli.1
Add support for loop detection setting
[ngadmin] / cli / man / ngcli.1
1 .TH NGCLI "1" "September 2014" "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 \fBloop disable
158 Disable loop detection.
159 .
160 .TP
161 \fBloop enable
162 Enable loop detection.
163 .
164 .TP
165 \fBloop show
166 Show loop detection configuration.
167 .
168 .TP
169 \fBmirror disable
170 Disable port mirroring.
171 .
172 .TP
173 \fBmirror set\fI outport\fR clone\fI port\fR [...]
174 Enable port mirroring, copy data from one or several \fIport\fR and output
175 data on \fIoutport\fR. Obviously, \fIoutport\fR must not be in the source ports
176 list.
177 .
178 .TP
179 \fBmirror show
180 Show port mirroring configuration.
181 .
182 .TP
183 \fBname clear
184 Clear the switch name.
185 .
186 .TP
187 \fBname set\fI name
188 Set the switch name to \fIname\fR.
189 .
190 .TP
191 \fBname show
192 Show the switch name.
193 .
194 .TP
195 \fBnetconf show
196 Show the network configuration.
197 .
198 .TP
199 \fBnetconf set\fR [ dhcp yes|no ] [ ip \fIip\fR ] [ mask\fI mask\fR ] \
200 [ gw\fI gw\fR ]
201 Set various network related options. \fIip\fR, \fImask\fR and \fIgw\fR must be
202 IPv4 addresses in dotted quad form.
203 .br
204 dhcp : enable or disable DHCP client on the switch
205 .br
206 ip : set the switch IP to \fIip\fR
207 .br
208 mask : set the switch netmask to \fImask\fR
209 .br
210 gw : set the switch gateway to \fIgw\fR
211 .
212 .TP
213 \fBpassword change\fR [ \fIpassword\fR ]
214 Change the switch password to \fIpassword\fR. If not specified, it is asked
215 from user (with terminal echo disabled).
216 .
217 .TP
218 \fBpassword set\fR [ \fIpassword\fR ]
219 Set the password used to connect to \fIpassword\fR. If not specified, it is
220 asked from user (with terminal echo disabled).
221 .
222 .TP
223 \fBports state
224 Show the ports state and speed.
225 .
226 .TP
227 \fBports statistics reset
228 Reset the ports statistics.
229 .
230 .TP
231 \fBports statistics show
232 Show the ports statistics.
233 .
234 .TP
235 \fBqos mode\fR port|802.1p
236 Set QoS mode to either port based or 802.1p based.
237 .
238 .TP
239 \fBqos set\fR all\fI prio
240 In port based mode, set all ports priority to \fIprio\fR.
241 .br
242 Acceptable values for \fIprio\fR are high, medium, normal and low.
243 .
244 .TP
245 \fBqos set \fIport prio\fR [...]
246 In port based mode, set priority of several couples of \fIport\fR to \fIprio\fR.
247 \fIprio\fR is the same format as in the above command.
248 .
249 .TP
250 \fBqos show
251 Show QoS configuration.
252 .
253 .TP
254 \fBquit
255 Exit NgCli.
256 .
257 .TP
258 \fBrestart
259 Restart the switch.
260 .
261 .TP
262 \fBscan
263 Scan the network for switches.
264 .
265 .TP
266 \fBstormfilter enable
267 Enable storm filtering.
268 .
269 .TP
270 \fBstormfilter disable
271 Disable storm filtering.
272 .
273 .TP
274 \fBstormfilter set\fR all\fI speed
275 Set the storm filter bitrate of all ports to \fIspeed\fR. \fIspeed\fR is the
276 same format as in the \fBbitrate set\fR command.
277 .
278 .TP
279 \fBstormfilter set\fI port speed\fR [...]
280 Set the storm filter bitrate of several couples of \fIport\fR to \fIspeed\fR.
281 \fIspeed\fR is the same format as in the \fBbitrate set\fR command.
282 .
283 .TP
284 \fBstormfilter show
285 Show storm filtering configuration.
286 .
287 .TP
288 \fBtree
289 Display all the commands and their subcommands.
290 .
291 .TP
292 \fBvlan 802.1q del\fI vlan
293 Delete 802.1Q VLAN \fIvlan\fR.
294 .
295 .TP
296 \fBvlan 802.1q set\fI vlan\fR [ all unspec|no|untagged|tagged ] \
297 [ \fIport\fR unspec|no|untagged|tagged ] [...]
298 In 802.1Q based mode, set a particular VLAN membership of several \fIport\fR.
299 \fIvlan\fR is a VLAN number between 1 and 4093 inclusive.
300 Setting the port of the first couple to "all" assigns the same value to all the
301 ports.
302 .br
303 Also do not forget to set the PVID configuration as well with the
304 \fBvlan pvid set\fR command.
305 .br
306 When creating a new VLAN, no port must be in an unspecified state or the VLAN
307 creation will fail.
308 .br
309 Acceptable membership values are:
310 .br
311 unspec : unspecified (default), the configuration of this port is left unchanged
312 .br
313 no : the port is not member of this VLAN
314 .br
315 untagged : the port is member of this VLAN as untagged
316 .br
317 tagged : the port is member of this VLAN as tagged
318 .
319 .TP
320 \fBvlan 802.1q show
321 Show 8021Q based VLAN configuration.
322 .
323 .TP
324 \fBvlan mode set\fI mode
325 Set VLAN mode to \fImode\fR, acceptable values are:
326 .br
327 0 - disabled
328 .br
329 1 - basic port based
330 .br
331 2 - advanced port based
332 .br
333 3 - basic 802.1Q
334 .br
335 4 - advanced 802.1Q
336 .
337 .TP
338 \fBvlan mode show
339 Show VLAN mode.
340 .
341 .TP
342 \fBvlan port set\fR [ all\fI vlan\fR ] [ \fIport vlan\fR ] [...]
343 In port based mode, set the VLAN membership of several couples of \fIport\fR to
344 \fIvlan\fR. Setting the port of the first couple to "all" assigns the same VLAN
345 to all the ports.
346 .br
347 \fIvlan\fR is a VLAN number between 1 and 9 inclusive.
348 .
349 .TP
350 \fBvlan port show
351 Show port based VLAN configuration.
352 .
353 .TP
354 \fBvlan pvid set\fI port vlan
355 Set \fIport\fR PVID to \fIvlan\fR.
356 .
357 .TP
358 \fBvlan pvid show
359 Show VLAN PVID configuration.
360 .
361 .SH BUGS
362 .
363 .PP
364 Firmware upgrade is not implemented, because it would require some work in the
365 library and a TFTP client.
366 .br
367 And overvall, it could be dangerous, as it is not sure that the switch checks
368 whatever you send to it, which could lead to a bricked device.
369 .
370 .PP
371 Cabletest is not totally reversed, only raw values are shown.
372 .br
373 Also, you must manually increase timeout to be able to receive results.
374 .
375 .PP
376 Saving and loading whole configuration into/from a file is not implemented.
377 .
378 .SH AUTHOR
379 Written by HervĂ© Boisse (admin@darkcoven.tk).