summaryrefslogtreecommitdiffstats
path: root/docs/testing/user/userguide/08-CLI_Commands_Reference.rst
blob: ece0986de52e239c461cd5cf4fb05d087df859fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
.. This work is licensed under a creative commons attribution 4.0 international
.. license.
.. http://creativecommons.org/licenses/by/4.0
.. (c) opnfv, national center of scientific research "demokritos" and others.

=====================
CLI Command Reference
=====================

Introduction
============
This chapter provides a commonly used sampleVNFs CLI commmands description.
The more detailed information and details will be available from the CLI
prompt of the VNF.

Generic commands
================

routeadd
--------
The routeadd command provides a mechanism to add the routing entries for the
VNF.

The destination device me be directly(host) attached or attached to net. The
parameter net or host should be used accordngly along with other information.

IPv4 interaface:

::

 Syntax:

 routeadd <net/host> <port #> <ipv4 nhip address in decimal> <Mask/NotApplicable>

 Example:

 routeadd net 0 202.16.100.20 0xffff0000
 routeadd net 1 172.16.40.20 0xffff0000
 routeadd host 0 202.16.100.20
 routeadd host 1 172.16.40.20


IPv6 interaface:

::

 Syntax:

 routeadd <net/host> <port #> <ipv6 nhip address in hex> <Depth/NotApplicable>

 Example:

 routeadd net 0 fec0::6a05:caff:fe30:21b0 64
 routeadd net 1 2012::6a05:caff:fe30:2081 64
 routeadd host 0 fec0::6a05:caff:fe30:21b0
 routeadd host 1 2012::6a05:caff:fe30:2081


The route can also be added to the VNF as a config parameters. This method is
deprecated and not recommended to use but is supported for backward
compatiblity.

IPv4 interaface:

::

 Syntax:

 ARP route table entries (ip, mask, if_port, nh) hex values with no 0x

 Example:

 arp_route_tbl = (c0106414,FFFF0000,0,c0106414)
 arp_route_tbl = (ac102814,FFFF0000,1,ac102814)


IPv6 interaface:

::

 Syntax:

 ARP route table entries (ip, mask, if_port, nh) hex values with no 0x

 Example:

 nd_route_tbl = (0064:ff9b:0:0:0:0:9810:6414,120,0,0064:ff9b:0:0:0:0:9810:6414)
 nd_route_tbl = (0064:ff9b:0:0:0:0:9810:2814,120,1,0064:ff9b:0:0:0:0:9810:2814)


arpadd
------
The arpadd command is provided to add the static arp entries to the VNF.

IPv4 interface:

::

 Syntax:

 p <arpicmp_pipe_id> arpadd <interface_id> <ip_address in deciaml> <mac addr in hex>

 Example:

 p 1 arpadd 0 202.16.100.20 00:ca:10:64:14:00
 p 1 arpadd 1 172.16.40.20 00:ac:10:28:14:00


IPv6 interface:

::

 Syntax:

 p <arpicmp_pipe_id> arpadd <interface_id> <ip_address in deciaml> <mac addr in hex>

 Example:

 p 1 arpadd 0 0064:ff9b:0:0:0:0:9810:6414 00:00:00:00:00:01
 p 1 arpadd 1 0064:ff9b:0:0:0:0:9810:2814 00:00:00:00:00:02


lbentry
-------
Loadbalancer CLI commands for debug

::

 LB Commands
 -------------------------------------------------------------
 Commands                       Description
 -------------------------------------------------------------
 p <pipe_id> lbentry dbg 0 0   To show received packets count
 p <pipe_id> lbentry dbg 1 0   To reset received packets count
 p <pipe_id> lbentry dbg 2 0   To set debug level
 p <pipe_id> lbentry dbg 3 0   To display debug level
 p <pipe_id> lbentry dbg 4 0   To display port statistics


arpls
-----

The arpls command is used to list the arp and route entries.

::

 Syntax:

 P <pipe_id> arpls <0: IPv4, 1: IPv6>

 Example:

 p 1 arpls 0
 p 1 arpls 1


vFW Specific commands
=====================
The following list of commands are specific to VFW pipeline.

action add
----------
Refer to "action add" CLI command line help to get more details.
Many options are available for this command for accept, fwd, count, conntrack
etc.

applyruleset
------------
This command must be executed to apply the ACL rules configured.

::

 Syntax/Example:

 p vfw applyruleset


add
---
This command is used to add teh ACL rules to vFW

Adding ACL rules for IPv4:

::

 Syntax:

 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>
 ;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

 Example:

 p vfw add 2 202.16.100.20 8 172.16.40.20 8 0 65535 0 65535 0 0 1
 p vfw add 2 172.16.40.20 8 202.16.100.20 8 0 65535 0 65535 0 0 0


Adding ACL rules for IPv6:

::

 Syntax:

 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>

 Example:

 p vfw add 2 fec0::6a05:caff:fe30:21b0 64 2012::6a05:caff:fe30:2081 64 0 65535 0 65535 0 0 1
 p vfw add 2 2012::6a05:caff:fe30:2081 64 fec0::6a05:caff:fe30:21b0 64 0 65535 0 65535 0 0 0


stats
-----
Display vFW stats.

::

 Syntax/Example:

 p vfw stats

clearstats
-----------
Clear vFW stats

::

 Syntax/Example:

 p vfw clearstats

counterdump
-----------
Enable or disable the counterdump using the following commands

::

 Syntax/Example:

 p vfw counterdump start
 p vfw counterdump stop

debug
-----
Enable or Disable the dynamic debug logs

::

 Syntax/Example:

 Disable dbg logs
 p vfw dbg 0

 Enable dbg logs
 p vfw dbg 1

firewall
--------
Enable or disable the firewall basic filtering using following commands.

::

 Syntax/Example:

 To disable
 p <pipe_id> vfw firewall 0

 To enable
 p <pipe_id> vfw firewall 1

synproxy
--------
Enable or disable the synproxy using following commands.

::

 Syntax/Example:

 To disable
 p <pipe_id> vfw synproxy 0

 To enable
 p <pipe_id> vfw synproxy 1

conntrack
---------
Enable or disable the connection tracking per VFW pipeline

::

 Syntax/Example:

 To enable connection tracking
 p action add <pipe_id> conntrack

 To disable connection tracking
 p action del <pipe_id> conntrack


loadrules
---------

A new file containing ACL rules and actions. The existing ACL rules and actions are
cleared.

::

 Syntax:
 p vfw loadrules <rule file>

 Example:
 p vfw loadrules ./config/acl_script_rules.tc

list
----
List the ACL rules in vFW

::

 Syntax/Example:

 List Active ACL rules
 p vfw ls 0

 List Standby ACL rules
 p vfw ls 1


vACL Specific commands
======================
Following are the typical commands used in vACL. Refer to CLI command line
prompt for more details.


action add
----------
Using pipeline CLI, an action can be added using the following command:

::

 Syntax:
 p action add <action-id> <action> <optional option>

 Example:

 Accept:
 p action add 1 accept

 Drop:
 p action add 2 drop

 Count:
 p action add 1 count

 fwd:
 p action add 1 fwd 1
 Where a port # must be specified

 NAT:
 p action add 3 nat 2
 Where a port # must be specified

 List Action:
 p action ls <pipleine-id>
 e.g. p action ls 2

add rules
---------
Using pipeline CLI, an ACL rule can be added using the following command:

::

 Syntax:
 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>

 Example:
 p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 1

 UDP only with source and destination IP addresses:
 p acl add 1 172.16.100.00 24 172.16.40.00 24 0 65535 0 65535 17 255 1
 p acl add 1 172.16.40.00 24 172.16.100.00 24 0 65535 0 65535 17 255 1

 UDP Only:
 p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 17 255 1

 Allow all packets:
 -----------------
 p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 1


list ACL rules
--------------
Using pipeline CLI, the list of current ACL rules can be viewed using:

::

 Syntax:
 p acl ls <pipe_id>

 Example:
 p acl ls 2


del an ACL rule
---------------
Using pipeline CLI, an ACL rule can be deleted using the following command:

::

 Syntax:
 p acl del <src-ip> <mask> <dst-ip> <mask> <src-port-from> <src-port-to> <dst-port-from> <dst-port-to> <protocol> <protocol-mask>

 Example:
 p acl del 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0


stats
-----
Display ACL stats.

::

 Syntax/Example:

 p acl stats

clearstats
-----------
Clear ACL stats

::

 Syntax/Example:

 p acl clearstats


loadrules
---------

A new file containing ACL rules and actions. The existing ACL rules and actions are
cleared.

::

 Syntax:
 p acl loadrules <rule file>

 Example:
 p acl loadrules ./config/acl_script_rules.tc


debug
-----
Debug logs can be turn on or turn off using the following commands

::

 Syntax/Example:

 Turn on Debug:
 p 2 acl dbg 1

 Turn off Debug:
 p 2 acl dbg 0


vCGNAT Specific commands
========================

The following are the details of the CLI commands supported by vCGNAT.
Refer to vCGNAPT application CLI command prompt help more details.

::

 To add bulk vCGNAPT entries
 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>

 To add single vCGNAPT entry
 p <pipe_id> entry add <prv_ip/prv_ipv6> <prv_port> <pub_ip> <pub_port> <phy_port> <ttl>

 To delete single vCGNAPT entry
 p <pipe_id> entry del <prv_ip/prv_ipv6> <prv_port> <phy_port>

 Displays all vCGNAPT static entries
 p <pipe_id> entry ls

 To display debug level , bulk entries added count
 p <pipe_id> entry dbg 3 0 0

 To show counters info
 p <pipe_id> entry dbg 3 3 0

 To show physical port statistics
 p <pipe_id> entry dbg 6 0 0

 To show SWQ number stats
 p <pipe_id> entry dbg 6 1 <SWQ number>

 For code instrumentation
 p <pipe_id> entry dbg 7 0 0

 Displays CGNAPT version
 p <pipe_id> entry ver 1 0

 To enable ipv6 traffic.
 p <pipe_id> entry dbg 11 1 0

 To disable ipv6 traffic.
 p <pipe_id> entry dbg 11 0 0

 To add Network Specific Preifx and depth in prefix table
 p <pipe_id> nsp add <nsp_prefix/depth>

 To delete Network Specific Preifx and depth in prefix table
 p <pipe_id> nsp del <nsp_prefix/depth>

 To show nsp prefix/depth configured/added in prefix table.
 p <pipe_id> entry dbg 13 0 0

 To show number of clients per public IP address
 p <pipe_id> entry dbg 14 0 0

 To show list of public IP addresses
 p <pipe_id> entry dbg 15 0 0

 To show number of clients per public IP address
 p <pipe_id> numipcli

 Enable dual stack.
 p <pipe_id> entry dbg 11 1 0