Broken IPv6 on FreeBSD or mtr: Unexpected mtr-packet error with IPv6 on FreeBSD 13, or Other BSD Systems

This error could be caused by a number of things, but in my case it was a simple error in my ipfw rules. My FreeBSD 13 box would work perfectly for IPv4, but fail with this error for IPv6. IPv6 was broken completely for this FreeBSD 13 machine.

It turns out that I had forgotten to allow ICMP for IPv6 in the ipfw firewall.

Although IPv4 uses ARP to find out which MAC address belongs to a certain IP address. IPv6 instead uses IPv6 Neighbor Discovery. This works via IPv6 ICMP. Also, mtr likes the IPv6 ICMP available as well…

So in order to fix this you have to be sure to pass IPv6 ICMP with ipfw (or pf for that matter, but I don’t have that syntax handy– but now you know what the problem is you should be able to find it on DuckDuckGo, or that EVIL search engine).

So edit your ipfw rules, wherever they, are and include a line to pass the IPv6 ICMP:

$IPF 95 allow icmp6 from any to any

In my case $IPF is a variable set to IPF=”ipfw -q add” at the top of the ipfw script. Look at your script and see how your rules are configured and replace $IPF with whatever your script is using to call ipfw add. If this doesn’t make any sense to you then just copy one of the rule you have and modify only the latter part to match the above. I have faith you can figure out how to make it work!

The constant number 95 in my example is the rule number in my file– You will want to set this for your setup.

So this is at least one way of how to fix the broken IPv6 on FreeBSD, or how to fix mtr: Unexpected mtr-packet error with IPv6 on FreeBSD 13. Note I have also seen the mtr packet error on systems before they are fully booted. So if I mtr to a host that is in the boot up process I will occasionally get this error as well.

This entry was posted in Uncategorized and tagged , , , , , , . Bookmark the permalink.

Leave a Reply