# Some unwanted packets are created automatically after running p4 in the mininet

**URL:** <https://forum.p4.org/t/some-unwanted-packets-are-created-automatically-after-running-p4-in-the-mininet/557>\
**Category:** Uncategorized\
**Created:** [November 29, 2022, 5:21pm UTC](https://forum.p4.org/t/some-unwanted-packets-are-created-automatically-after-running-p4-in-the-mininet/557 "2022-11-29T17:21:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lululouisa](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Lululouisa](https://forum.p4.org/u/Lululouisa)\
**Post date:** [November 29, 2022, 5:21pm UTC](https://forum.p4.org/t/some-unwanted-packets-are-created-automatically-after-running-p4-in-the-mininet/557/1 "2022-11-29T17:21:17Z")

</div>

Hello,

when i p4run to start the mininet with p4 switch and tcpreplay to evaluate my p4 function, there are a;ways some unwanted packets from unknown source like below picture in s1-eth2-out and s1-eth1-out.

 ![f522c85bb4c6b4d29ce7aaaa6df5f55](https://us1.discourse-cdn.com/flex019/uploads/p4/original/1X/a118cccbf2cc99d112a7ba7a733bc5591e283eff.png)

There is simple topology with one switch and 2 hosts. And if i tcpdump to monitor the interface s1-eth1 and s1-eth2, there are no unwanted packets in the pcap.file.  
I have no idea why there are they. The IPv6 is already disable.  
Have you any idea about this? Thank you!

---

<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:** [November 29, 2022, 8:07pm UTC](https://forum.p4.org/t/some-unwanted-packets-are-created-automatically-after-running-p4-in-the-mininet/557/2 "2022-11-29T20:07:59Z")

</div>

I see commands like these in some of the p4lang/tutorials files, but I have not verified whether they are actually run when you run the tutorials, or not. In a mininet environment, there is a separate Linux network namespace created for each emulated switch, and I have not verified whether these commands need to be run in each namespace, and if so, whether they actually are.

```auto
$ grep -r disable_ipv6
Binary file .git/index matches
utils/p4_mininet.py: self.cmd("sysctl -w net.ipv6.conf.all.disable_ipv6=1")
utils/p4_mininet.py: self.cmd("sysctl -w net.ipv6.conf.default.disable_ipv6=1")
utils/p4_mininet.py: self.cmd("sysctl -w net.ipv6.conf.lo.disable_ipv6=1")
utils/mininet/p4_mininet.py: self.cmd("sysctl -w net.ipv6.conf.all.disable_ipv6=1")
utils/mininet/p4_mininet.py: self.cmd("sysctl -w net.ipv6.conf.default.disable_ipv6=1")
utils/mininet/p4_mininet.py: self.cmd("sysctl -w net.ipv6.conf.lo.disable_ipv6=1")
exercises/multicast/disable_ipv6.sh:sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
exercises/multicast/disable_ipv6.sh:sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

```

---

<div class="post-metadata">

**Author:** ![Lululouisa](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Lululouisa](https://forum.p4.org/u/Lululouisa)\
**Post date:** [November 29, 2022, 10:47pm UTC](https://forum.p4.org/t/some-unwanted-packets-are-created-automatically-after-running-p4-in-the-mininet/557/3 "2022-11-29T22:47:56Z")

</div>

Hi Andy,

thank you for response. Yes, these commands do need to be run in each namespace.  
Yes, when i check these commands, all of them are correctly in the py.files under untils folder. Also, i issued the command:` sudo vim /etc/sysctl.conf` to add the correspongding command line as the last two line of your post. However, there are still three inet6 when i checked. I dont know where are they from and what could i do for these three network namespace.

 ![1669761767252](https://us1.discourse-cdn.com/flex019/uploads/p4/original/1X/1c4c8c434db8e8a1e7a2c8767858dda0775f0c38.png)  
Thank you~

---

<div class="post-metadata">

**Author:** ![ederollora2](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@ederollora2](https://forum.p4.org/u/ederollora2)\
**Post date:** [September 14, 2025, 9:26pm UTC](https://forum.p4.org/t/some-unwanted-packets-are-created-automatically-after-running-p4-in-the-mininet/557/4 "2025-09-14T21:26:50Z")

</div>

Hi all,

I think I found the solution. I am not sure @Lululouisa could make it work, I have no idea. But in my case it work.

Open, form the Ubuntu files (not the namespace):

```auto
nano /etc/sysctl.conf

```

At the end of the file, add:

```auto
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

```

Then activate it with (probably you did not it? @Lululouisa) :

```auto
sysctl -p

```

In principle, ICMPv6 traffic should no longer appear. DNS might also disappear, since it was apparently based on ICMPv6—but I don’t fully remember if that was the case. Let me know if it works for you.

When I tried with the `utils` approach that was suggested by @andyfingerhut , it unfortunately didn’t work for me.

Cheers,
