Documentation for Jerma release
[samplevnf.git] / docs / testing / user / userguide / 08-CLI_Commands_Reference.rst
1 .. This work is licensed under a creative commons attribution 4.0 international
2 .. license.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) opnfv, national center of scientific research "demokritos" and others.
5
6 =====================
7 CLI Command Reference
8 =====================
9
10 Introduction
11 ============
12 This chapter provides a commonly used sampleVNFs CLI commmands description.
13 The more detailed information and details will be available from the CLI
14 prompt of the VNF.
15
16 Generic commands
17 ================
18
19 routeadd
20 --------
21 The routeadd command provides a mechanism to add the routing entries for the
22 VNF.
23
24 The destination device me be directly(host) attached or attached to net. The
25 parameter net or host should be used accordngly along with other information.
26
27 IPv4 interaface:
28
29 ::
30
31  Syntax:
32
33  routeadd <net/host> <port #> <ipv4 nhip address in decimal> <Mask/NotApplicable>
34
35  Example:
36
37  routeadd net 0 202.16.100.20 0xffff0000
38  routeadd net 1 172.16.40.20 0xffff0000
39  routeadd host 0 202.16.100.20
40  routeadd host 1 172.16.40.20
41
42
43 IPv6 interaface:
44
45 ::
46
47  Syntax:
48
49  routeadd <net/host> <port #> <ipv6 nhip address in hex> <Depth/NotApplicable>
50
51  Example:
52
53  routeadd net 0 fec0::6a05:caff:fe30:21b0 64
54  routeadd net 1 2012::6a05:caff:fe30:2081 64
55  routeadd host 0 fec0::6a05:caff:fe30:21b0
56  routeadd host 1 2012::6a05:caff:fe30:2081
57
58
59 The route can also be added to the VNF as a config parameters. This method is
60 deprecated and not recommended to use but is supported for backward
61 compatiblity.
62
63 IPv4 interaface:
64
65 ::
66
67  Syntax:
68
69  ARP route table entries (ip, mask, if_port, nh) hex values with no 0x
70
71  Example:
72
73  arp_route_tbl = (c0106414,FFFF0000,0,c0106414)
74  arp_route_tbl = (ac102814,FFFF0000,1,ac102814)
75
76
77 IPv6 interaface:
78
79 ::
80
81  Syntax:
82
83  ARP route table entries (ip, mask, if_port, nh) hex values with no 0x
84
85  Example:
86
87  nd_route_tbl = (0064:ff9b:0:0:0:0:9810:6414,120,0,0064:ff9b:0:0:0:0:9810:6414)
88  nd_route_tbl = (0064:ff9b:0:0:0:0:9810:2814,120,1,0064:ff9b:0:0:0:0:9810:2814)
89
90
91 arpadd
92 ------
93 The arpadd command is provided to add the static arp entries to the VNF.
94
95 IPv4 interface:
96
97 ::
98
99  Syntax:
100
101  p <arpicmp_pipe_id> arpadd <interface_id> <ip_address in deciaml> <mac addr in hex>
102
103  Example:
104
105  p 1 arpadd 0 202.16.100.20 00:ca:10:64:14:00
106  p 1 arpadd 1 172.16.40.20 00:ac:10:28:14:00
107
108
109 IPv6 interface:
110
111 ::
112
113  Syntax:
114
115  p <arpicmp_pipe_id> arpadd <interface_id> <ip_address in deciaml> <mac addr in hex>
116
117  Example:
118
119  p 1 arpadd 0 0064:ff9b:0:0:0:0:9810:6414 00:00:00:00:00:01
120  p 1 arpadd 1 0064:ff9b:0:0:0:0:9810:2814 00:00:00:00:00:02
121
122
123 lbentry
124 -------
125 Loadbalancer CLI commands for debug
126
127 ::
128
129  LB Commands
130  -------------------------------------------------------------
131  Commands                       Description
132  -------------------------------------------------------------
133  p <pipe_id> lbentry dbg 0 0   To show received packets count
134  p <pipe_id> lbentry dbg 1 0   To reset received packets count
135  p <pipe_id> lbentry dbg 2 0   To set debug level
136  p <pipe_id> lbentry dbg 3 0   To display debug level
137  p <pipe_id> lbentry dbg 4 0   To display port statistics
138
139
140 arpls
141 -----
142
143 The arpls command is used to list the arp and route entries.
144
145 ::
146
147  Syntax:
148
149  P <pipe_id> arpls <0: IPv4, 1: IPv6>
150
151  Example:
152
153  p 1 arpls 0
154  p 1 arpls 1
155
156
157 vFW Specific commands
158 =====================
159 The following list of commands are specific to VFW pipeline.
160
161 action add
162 ----------
163 Refer to "action add" CLI command line help to get more details.
164 Many options are available for this command for accept, fwd, count, conntrack
165 etc.
166
167 applyruleset
168 ------------
169 This command must be executed to apply the ACL rules configured.
170
171 ::
172
173  Syntax/Example:
174
175  p vfw applyruleset
176
177
178 add
179 ---
180 This command is used to add teh ACL rules to vFW
181
182 Adding ACL rules for IPv4:
183
184 ::
185
186  Syntax:
187
188  p vfw add <priority> <src_ip> <mask> <dst_ip> <mask> <src_port_start> <src_port_end> <dst_port_start> <dst_port_end> <protocol_mask> <action_id>
189  ;Log info: Prio = 1 (SA = 202.0.0.0/8, DA = 192.0.0.0/8, SP = 0-65535, DP = 0-65535, Proto = 0 / 0x0) => Action ID = 1
190
191  Example:
192
193  p vfw add 2 202.16.100.20 8 172.16.40.20 8 0 65535 0 65535 0 0 1
194  p vfw add 2 172.16.40.20 8 202.16.100.20 8 0 65535 0 65535 0 0 0
195
196
197 Adding ACL rules for IPv6:
198
199 ::
200
201  Syntax:
202
203  p vfw add <priority> <src_ip> <mask> <dst_ip> <mask> <src_port_start> <src_port_end> <dst_port_start> <dst_port_end> <protocol_mask> <action_id>
204
205  Example:
206
207  p vfw add 2 fec0::6a05:caff:fe30:21b0 64 2012::6a05:caff:fe30:2081 64 0 65535 0 65535 0 0 1
208  p vfw add 2 2012::6a05:caff:fe30:2081 64 fec0::6a05:caff:fe30:21b0 64 0 65535 0 65535 0 0 0
209
210
211 stats
212 -----
213 Display vFW stats.
214
215 ::
216
217  Syntax/Example:
218
219  p vfw stats
220
221 clearstats
222 -----------
223 Clear vFW stats
224
225 ::
226
227  Syntax/Example:
228
229  p vfw clearstats
230
231 counterdump
232 -----------
233 Enable or disable the counterdump using the following commands
234
235 ::
236
237  Syntax/Example:
238
239  p vfw counterdump start
240  p vfw counterdump stop
241
242 debug
243 -----
244 Enable or Disable the dynamic debug logs
245
246 ::
247
248  Syntax/Example:
249
250  Disable dbg logs
251  p vfw dbg 0
252
253  Enable dbg logs
254  p vfw dbg 1
255
256 firewall
257 --------
258 Enable or disable the firewall basic filtering using following commands.
259
260 ::
261
262  Syntax/Example:
263
264  To disable
265  p <pipe_id> vfw firewall 0
266
267  To enable
268  p <pipe_id> vfw firewall 1
269
270 synproxy
271 --------
272 Enable or disable the synproxy using following commands.
273
274 ::
275
276  Syntax/Example:
277
278  To disable
279  p <pipe_id> vfw synproxy 0
280
281  To enable
282  p <pipe_id> vfw synproxy 1
283
284 conntrack
285 ---------
286 Enable or disable the connection tracking per VFW pipeline
287
288 ::
289
290  Syntax/Example:
291
292  To enable connection tracking
293  p action add <pipe_id> conntrack
294
295  To disable connection tracking
296  p action del <pipe_id> conntrack
297
298
299 loadrules
300 ---------
301
302 A new file containing ACL rules and actions. The existing ACL rules and actions are
303 cleared.
304
305 ::
306
307  Syntax:
308  p vfw loadrules <rule file>
309
310  Example:
311  p vfw loadrules ./config/acl_script_rules.tc
312
313 list
314 ----
315 List the ACL rules in vFW
316
317 ::
318
319  Syntax/Example:
320
321  List Active ACL rules
322  p vfw ls 0
323
324  List Standby ACL rules
325  p vfw ls 1
326
327
328 vACL Specific commands
329 ======================
330 Following are the typical commands used in vACL. Refer to CLI command line
331 prompt for more details.
332
333
334 action add
335 ----------
336 Using pipeline CLI, an action can be added using the following command:
337
338 ::
339
340  Syntax:
341  p action add <action-id> <action> <optional option>
342
343  Example:
344
345  Accept:
346  p action add 1 accept
347
348  Drop:
349  p action add 2 drop
350
351  Count:
352  p action add 1 count
353
354  fwd:
355  p action add 1 fwd 1
356  Where a port # must be specified
357
358  NAT:
359  p action add 3 nat 2
360  Where a port # must be specified
361
362  List Action:
363  p action ls <pipleine-id>
364  e.g. p action ls 2
365
366 add rules
367 ---------
368 Using pipeline CLI, an ACL rule can be added using the following command:
369
370 ::
371
372  Syntax:
373  p acl add <priority> <src-ip> <mask> <dst-ip> <mask> <src-port-from> <src-port-to> <dst-port-from> <dst-port-to> <protocol> <protocol-mask> <action-id>
374
375  Example:
376  p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 1
377
378  UDP only with source and destination IP addresses:
379  p acl add 1 172.16.100.00 24 172.16.40.00 24 0 65535 0 65535 17 255 1
380  p acl add 1 172.16.40.00 24 172.16.100.00 24 0 65535 0 65535 17 255 1
381
382  UDP Only:
383  p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 17 255 1
384
385  Allow all packets:
386  -----------------
387  p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 1
388
389
390 list ACL rules
391 --------------
392 Using pipeline CLI, the list of current ACL rules can be viewed using:
393
394 ::
395
396  Syntax:
397  p acl ls <pipe_id>
398
399  Example:
400  p acl ls 2
401
402
403 del an ACL rule
404 ---------------
405 Using pipeline CLI, an ACL rule can be deleted using the following command:
406
407 ::
408
409  Syntax:
410  p acl del <src-ip> <mask> <dst-ip> <mask> <src-port-from> <src-port-to> <dst-port-from> <dst-port-to> <protocol> <protocol-mask>
411
412  Example:
413  p acl del 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0
414
415
416 stats
417 -----
418 Display ACL stats.
419
420 ::
421
422  Syntax/Example:
423
424  p acl stats
425
426 clearstats
427 -----------
428 Clear ACL stats
429
430 ::
431
432  Syntax/Example:
433
434  p acl clearstats
435
436
437 loadrules
438 ---------
439
440 A new file containing ACL rules and actions. The existing ACL rules and actions are
441 cleared.
442
443 ::
444
445  Syntax:
446  p acl loadrules <rule file>
447
448  Example:
449  p acl loadrules ./config/acl_script_rules.tc
450
451
452 debug
453 -----
454 Debug logs can be turn on or turn off using the following commands
455
456 ::
457
458  Syntax/Example:
459
460  Turn on Debug:
461  p 2 acl dbg 1
462
463  Turn off Debug:
464  p 2 acl dbg 0
465
466
467 vCGNAT Specific commands
468 ========================
469
470 The following are the details of the CLI commands supported by vCGNAT.
471 Refer to vCGNAPT application CLI command prompt help more details.
472
473 ::
474
475  To add bulk vCGNAPT entries
476  p <pipe_id> entry addm <prv_ip/prv_ipv6> <prv_port> <pub_ip> <pub_port> <phy_port> <ttl> <no_of_entries> <end_prv_port> <end_pub_port>
477
478  To add single vCGNAPT entry
479  p <pipe_id> entry add <prv_ip/prv_ipv6> <prv_port> <pub_ip> <pub_port> <phy_port> <ttl>
480
481  To delete single vCGNAPT entry
482  p <pipe_id> entry del <prv_ip/prv_ipv6> <prv_port> <phy_port>
483
484  Displays all vCGNAPT static entries
485  p <pipe_id> entry ls
486
487  To display debug level , bulk entries added count
488  p <pipe_id> entry dbg 3 0 0
489
490  To show counters info
491  p <pipe_id> entry dbg 3 3 0
492
493  To show physical port statistics
494  p <pipe_id> entry dbg 6 0 0
495
496  To show SWQ number stats
497  p <pipe_id> entry dbg 6 1 <SWQ number>
498
499  For code instrumentation
500  p <pipe_id> entry dbg 7 0 0
501
502  Displays CGNAPT version
503  p <pipe_id> entry ver 1 0
504
505  To enable ipv6 traffic.
506  p <pipe_id> entry dbg 11 1 0
507
508  To disable ipv6 traffic.
509  p <pipe_id> entry dbg 11 0 0
510
511  To add Network Specific Preifx and depth in prefix table
512  p <pipe_id> nsp add <nsp_prefix/depth>
513
514  To delete Network Specific Preifx and depth in prefix table
515  p <pipe_id> nsp del <nsp_prefix/depth>
516
517  To show nsp prefix/depth configured/added in prefix table.
518  p <pipe_id> entry dbg 13 0 0
519
520  To show number of clients per public IP address
521  p <pipe_id> entry dbg 14 0 0
522
523  To show list of public IP addresses
524  p <pipe_id> entry dbg 15 0 0
525
526  To show number of clients per public IP address
527  p <pipe_id> numipcli
528
529  Enable dual stack.
530  p <pipe_id> entry dbg 11 1 0
531