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