Skip to main content
Hasnatriad
Staff
Staff
Sep 27, 2024 9:41 AM UTC

Technical Tip: How to block mDNS traffic with Firewall Policies for specific subnet/user group

Description

 

This article describes how to block mDNS traffic with firewall policies for a specific subnet or SSID user profile. This is useful when users still want to allow mDNS at a global level but only want to block mDNS for some specific subnet/user profile when it generates lots of traffic. 

 

Scope

 

FortiGate.

 

Solution

 

Many devices and services use multicast IPs; hence, FortiGate has default multicast addresses configured. mDNS uses multicast IP 224.0.0.251, which is configured in the FortiGate as a multicast address. To allow mDNS traffic globally and yet block for specific user groups or subnets, follow the method below.

 

multicast_address_range.png

 

Create a Firewall policy using the multicast IP address as the destination and define the source subnet and user group. Select service as port 5353.

  • Add a rule to deny any service with Destination IP 224.0.0.251 for IPv4 mDNS.
  • Add another rule to deny any service with Destination IP ff02::fb for IPv6 mDNS.

Creating a custom service in the CLI console.

 

config firewall service custom
    edit "mDNS"
        set tcp-portrange 5353
    next
end

 

GUI output:

 

mDNS service.png

 

Firewall Policy in CLI console:

 

config firewall policy
    edit 1
        set name "mDNS_block"
        set srcintf "port2"
        set dstintf "port1"
        set srcaddr "AP_User_Range"
        set dstaddr "mDNS_multicast_address"
        set schedule "always"
        set service "mDNS"
        set logtraffic all
        set groups "Wifi_guest"
    next
end

 

 

 

Firewall policy in GUI:

 

policy to block.png

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT