# Question about clone packet

**URL:** <https://forum.p4.org/t/question-about-clone-packet/1135>\
**Category:** Uncategorized\
**Created:** [March 18, 2024, 7:55am UTC](https://forum.p4.org/t/question-about-clone-packet/1135 "2024-03-18T07:55:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dell](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@dell](https://forum.p4.org/u/dell)\
**Post date:** [March 18, 2024, 7:55am UTC](https://forum.p4.org/t/question-about-clone-packet/1135/1 "2024-03-18T07:55:51Z")

</div>

Hello. I’m currently using the bmv2 model, I want to clone every packet in the switch and send it to port 1.but I tried clone\_preserving\_field\_list but want to send to port 1 needs to use mirroring\_add command, so I want to add cli\_ input to the topology.json file to use command.txt but it doesn’t work, how can I fix this?

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [March 18, 2024, 4:47pm UTC](https://forum.p4.org/t/question-about-clone-packet/1135/2 "2024-03-18T16:47:20Z")

</div>

I have not used the key `cli_input` in the [GitHub - p4lang/tutorials: P4 language tutorials](https://github.com/p4lang/tutorials) switch configuration JSON files before, so cannot comment yet on whether that works, or what it takes to make it work.

I am replying to let you know that if you want a temporary workaround, you should be able to run the `simple_switch_CLI` command to create an interactive session where you can configure a switch with commands like `mirroring_add`, and dump table entries as well. Run `simple_switch_CLI -h` or maybe it is `simple_switch_CLI --help` to see what the command line options are. If you have multiple BMv2 switches running, each will have a different TCP port it is listening on for Thrift TCP connections, which you can see with a command like `ps axguwww | grep simple_switch_grpc`.
