]> git.sur5r.net Git - ngadmin/blob - cli/man/ngcli.1
66101c24683e999c082218c2c806a91db39959ba
[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\fR [ \fIpassword\fR ]
202 Change the switch password to \fIpassword\fR. If not specified, it is asked
203 from user (with terminal echo disabled).
204 .
205 .TP
206 \fBpassword set\fR [ \fIpassword\fR ]
207 Set the password used to connect to \fIpassword\fR. If not specified, it is
208 asked from user (with terminal echo disabled).
209 .
210 .TP
211 \fBports state
212 Show the ports state and speed.
213 .
214 .TP
215 \fBports statistics reset
216 Reset the ports statistics.
217 .
218 .TP
219 \fBports statistics show
220 Show the ports statistics.
221 .
222 .TP
223 \fBqos mode\fR port|802.1p
224 Set QoS mode to either port based or 802.1p based.
225 .
226 .TP
227 \fBqos set\fR all\fI prio
228 In port based mode, set all ports priority to \fIprio\fR.
229 .br
230 Acceptable values for \fIprio\fR are high, medium, normal and low.
231 .
232 .TP
233 \fBqos set \fIport prio\fR [...]
234 In port based mode, set priority of several couples of \fIport\fR to \fIprio\fR.
235 \fIprio\fR is the same format as in the above command.
236 .
237 .TP
238 \fBqos show
239 Show QoS configuration.
240 .
241 .TP
242 \fBquit
243 Exit NgCli.
244 .
245 .TP
246 \fBrestart
247 Restart the switch.
248 .
249 .TP
250 \fBscan
251 Scan the network for switches.
252 .
253 .TP
254 \fBstormfilter enable
255 Enable storm filtering.
256 .
257 .TP
258 \fBstormfilter disable
259 Disable storm filtering.
260 .
261 .TP
262 \fBstormfilter set\fR all\fI speed
263 Set the storm filter bitrate of all ports to \fIspeed\fR. \fIspeed\fR is the
264 same format as in the \fBbitrate set\fR command.
265 .
266 .TP
267 \fBstormfilter set\fI port speed\fR [...]
268 Set the storm filter bitrate of several couples of \fIport\fR to \fIspeed\fR.
269 \fIspeed\fR is the same format as in the \fBbitrate set\fR command.
270 .
271 .TP
272 \fBstormfilter show
273 Show storm filtering configuration.
274 .
275 .TP
276 \fBtree
277 Display all the commands and their subcommands.
278 .
279 .TP
280 \fBvlan 802.1q del\fI vlan
281 Delete 802.1Q VLAN \fIvlan\fR.
282 .
283 .TP
284 \fBvlan 802.1q set\fI vlan\fR [ all unspec|no|untagged|tagged ] \
285 [ \fIport\fR unspec|no|untagged|tagged ] [...]
286 In 802.1Q based mode, set a particular VLAN membership of several \fIport\fR.
287 \fIvlan\fR is a VLAN number between 1 and 4093 inclusive.
288 Setting the port of the first couple to "all" assigns the same value to all the
289 ports.
290 .br
291 Also do not forget to set the PVID configuration as well with the
292 \fBvlan pvid set\fR command.
293 .br
294 When creating a new VLAN, no port must be in an unspecified state or the VLAN
295 creation will fail.
296 .br
297 Acceptable membership values are:
298 .br
299 unspec : unspecified (default), the configuration of this port is left unchanged
300 .br
301 no : the port is not member of this VLAN
302 .br
303 untagged : the port is member of this VLAN as untagged
304 .br
305 tagged : the port is member of this VLAN as tagged
306 .
307 .TP
308 \fBvlan 802.1q show
309 Show 8021Q based VLAN configuration.
310 .
311 .TP
312 \fBvlan mode set\fI mode
313 Set VLAN mode to \fImode\fR, acceptable values are:
314 .br
315 0 - disabled
316 .br
317 1 - basic port based
318 .br
319 2 - advanced port based
320 .br
321 3 - basic 802.1Q
322 .br
323 4 - advanced 802.1Q
324 .
325 .TP
326 \fBvlan mode show
327 Show VLAN mode.
328 .
329 .TP
330 \fBvlan port set\fR [ all\fI vlan\fR ] [ \fIport vlan\fR ] [...]
331 In port based mode, set the VLAN membership of several couples of \fIport\fR to
332 \fIvlan\fR. Setting the port of the first couple to "all" assigns the same VLAN
333 to all the ports.
334 .br
335 \fIvlan\fR is a VLAN number between 1 and 9 inclusive.
336 .
337 .TP
338 \fBvlan port show
339 Show port based VLAN configuration.
340 .
341 .TP
342 \fBvlan pvid set\fI port vlan
343 Set \fIport\fR PVID to \fIvlan\fR.
344 .
345 .TP
346 \fBvlan pvid show
347 Show VLAN PVID configuration.
348 .
349 .SH BUGS
350 .
351 .PP
352 Firmware upgrade is not implemented, because it would require some work in the
353 library and a TFTP client.
354 .br
355 And overvall, it could be dangerous, as it is not sure that the switch checks
356 whatever you send to it, which could lead to a bricked device.
357 .
358 .PP
359 Cabletest is not totally reversed, only raw values are shown.
360 .br
361 Also, you must manually increase timeout to be able to receive results.
362 .
363 .PP
364 Saving and loading whole configuration into/from a file is not implemented.
365 .
366 .SH AUTHOR
367 Written by HervĂ© Boisse (admin@darkcoven.tk).