Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Junos] Firewall filter behavior on IP fragments

0

0

Article ID: KB31437 KB Last Updated: 21 Feb 2017Version: 1.0
Summary:

This article describes a scenario where IP fragments are dropped by a carelessly defined firewall filter.

Symptoms:

As IP fragments beside the first one does not contain the UDP/TCP header, they are likely to be dropped by a carelessly defined firewall filter.

Example:

The following firewall term matches "protocol udp" and “port 0”, and will drop the matching traffic. This firewall term works for "not fragmented" or "the 1st fragment" packets, as they all contain the correct udp header.

term block-0-infra {
     from {
          destination-prefix-list {
               infra-prefixes;
          }
     protocol udp;
     port 0;
          }
     then {
          count count-infra-port-0;
          discard;
     }
}

However, for other IP fragments beside the 1st one do not contain the UDP header. The data part is next to the IP header. If the first 4 byte of the “data part” is “00 00 xx xx” or “xx xx 00 00” (port position in the UDP header equals 0), the IP fragment will match the term and be dropped.
Cause:

The firewall in the above example does not know if the coming packet contains the correct UDP header or not, but it will always compare the port position even if there is no UDP header in the rest of the IP fragments.

Solution:

To fix the issue, add a matching condition "fragment-offset 0" in order to compare "not fragmented" or "the 1st fragment" packets only.

term block-0-infra {
     from {
          destination-prefix-list {
               infra-prefixes;
          }
          fragment-offset 0; <<<<<
          protocol udp;
          port 0;
     }
     then {
          count count-infra-port-0;
          discard;
     }
}


Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search