core icon indicating copy to clipboard operation
core copied to clipboard

Clearing IP Do-Not-Fragment in Firewall Normalizations causes issues

Open tomatotoast opened this issue 2 years ago • 4 comments

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

  • [X] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [X] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Describe the bug

Clearing the DF-Bit using normalisation causes service disruptions. Sites like Reddit or Github wont work any longer when "no-df" is set.

Tip: to validate your setup was working with the previous version, use opnsense-revert (https://docs.opnsense.org/manual/opnsense_tools.html#opnsense-revert)

To Reproduce

Steps to reproduce the behavior:

  1. Go to: "Firewall: Settings: Normalization"
  2. Click on "IP Do-Not-Fragment"
  3. Browse to https://github.com/opnsense/core/ or try to read a reddit post.
  4. Sites dont function as expected

Expected behavior

Clear DF-bit if set and reassemble packets if needed.

Describe alternatives you considered

As described in https://docstore.mik.ua/manuals/openbsd/faq/pf/scrub.html there are other scrubbing options that are missing in the config options. Like: "fragment reassemble".

I expect that "no-df" can be configured together with "fragment reassemble". So that no matter what MTU size the packets have or whether the df-bit is set or not the packets are reassembled and everything works.

Also add missing config options: "fragment crop", "fragment drop-ovl", "reassemble tcp"

Environment

OPNsense 23.7.12-amd64 FreeBSD 13.2-RELEASE-p7 OpenSSL 1.1.1w

tomatotoast avatar Jan 21 '24 12:01 tomatotoast

relevant man page (containing available options) https://man.freebsd.org/cgi/man.cgi?pf.conf(5)

and section explaining why "fragment reassemble" is not available:

fragment	reassemble
	     Using scrub rules,	fragments can be reassembled by	normalization.
	     In	this case, fragments are buffered until	they form  a  complete
	     packet, and only the completed packet is passed on	to the filter.
	     The  advantage  is	 that filter rules have	to deal	only with com-
	     plete packets, and	can ignore fragments.  The drawback of caching
	     fragments is the additional memory	cost.  

             This is the default behaviour unless no fragment reassemble is specified.

AdSchellevis avatar Jan 24 '24 13:01 AdSchellevis

Then I don't understand why deactivating "IP Do-Not-Fragment" solves the problem and the websites work again.

tomatotoast avatar Jan 24 '24 18:01 tomatotoast

debugging your setup goes beyond my community support time, I'm merely pointing you into the right direction here.

AdSchellevis avatar Jan 24 '24 18:01 AdSchellevis

Then I don't understand why deactivating "IP Do-Not-Fragment" solves the problem and the websites work again.

By disabling "IP Do-Not-Fragment," you are most likely breaking Path MTU Discovery.

Somewhere between you and the website, an MTU is smaller than your local network. Some packets are too large to traverse the link and get dropped.

cullumsmith avatar Nov 05 '24 11:11 cullumsmith