Configuring Local Area Bonjour in Multicast DNS Mode for LAN and Wireless Networks

Configuring Local Area Bonjour Domain for Wired Networks

Enabling mDNS Gateway on the Device

To configure mDNS on the device, follow these steps:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd gateway

Example:

Device(config)# mdns-sd gateway

Enables mDNS on the device and enters mDNS gateway configuration mode.

Enter the following commands in mDNS gateway configuration mode to enable the respective functionalities:

  • air-print-helper : Enables IOS devices like iPADs to discover and use older printers that support Bonjour

  • cache-memory-max : Configures the percentage memory for cache

  • ingress-client : Configures Ingress Client Packet Tuners

  • rate-limit : Enables rate limiting of incoming mDNS packets

  • service-announcement-count : Configures maximum advertisements

  • service-announcement-timer : Configures advertisements announce timer periodicity

  • service-query-count : Configures maximum queries

  • service-query-timer : Configures query forward timer periodicity

  • service-type-enumeration : Configures service enumeration

Note 

For cache-memory-max , ingress-client , rate-limit , service-announcement-count , service-announcement-timer , service-query-count , service-query-timer , and service-type-enumeration commands, you can retain the default value of the respective parameter for general deployments. Configure a different value, if required, for a specific deployment.

Step 4

exit

Example:

Device(config-mdns-sd)# exit

Exits mDNS gateway configuration mode.

Creating Custom Service Definition

Service definition is a construct that provides an admin friendly name to one or more mDNS service types or PTR Resource Record Name. By default, few built-in service definitions are already predefined and available for admin to use. In addition to built-in service definitions, admin can also define custom service definitions.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd service-definition service-definition-name

Example:

Device(config)# mdns-sd service-definition CUSTOM1

Configures mDNS service definition.

Note 

All the created custom service definitions are added to the primary service list. Primary service list comprises of a list of custom and built-in service definitions.

Step 4

service-type string

Example:

Device(config-mdns-ser-def)# service-type _custom1._tcp.local

Configures mDNS service type.

Step 5

Repeat step 4 to configure more than one service type in the custom service definition.

Step 6

exit

Example:

Device(config-mdns-ser-def)# exit

Exit mDNS service definition configuration mode.

Creating Service List

mDNS service list is a collection of service definitions. To create a service list, follow these steps:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd service-list service-list-name {in | out}

Example:

Device(config)# mdns-sd service-list VLAN100-list in

Configures mDNS service list.

Step 4

match service-definition-name [message-type {any | announcement | query}]

Example:

Device(config-mdns-sl-in)# match PRINTER message-type announcement

Matches the service to the message type. Here, service-definition-name refers to the names of services, such as, airplay, airserver, airtunes, and so on.

Note 

To add a service, the service name must be part of the primary service list.

If the mDNS service list is set to IN, the applicable command syntax is: match service-definition-name [message-type {any | announcement | query}] .

If the mDNS service list is set to OFF, the applicable command syntax is: match service-definition-name .

Step 5

exit

Example:

Device(config-mdns-sl-in)# exit

Exits mDNS service list configuration mode.

Creating Service Policy

A Service Policy that is applied to an interface specifies the allowed Bonjour service announcements or the queries of specific service types that should be processed, in ingress direction or egress direction or both. For this, the service policy specifies two service-lists, one each for ingress and egress directions. In the Local Area Bonjour domain, the same service policy can be attached to one or more Bonjour client VLANs; however, different VLANs may have different service policies.

To configure service policy with service lists, follow these steps:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd service-policy service-policy-name

Example:

Device(config)# mdns-sd service-policy mdns-policy1

Configures mDNS service policy.

Step 4

service-list service-list-name {in | out}

Example:

Device(config-mdns-ser-pol)# service-list VLAN100-list in
Device(config-mdns-ser-pol)# service-list VLAN300-list out

Configures service lists for IN and OUT directions.

Step 5

exit

Example:

Device(config-mdns-ser-pol)# exit

Exits mDNS service policy configuration mode.

Associating Service Policy to an Interface

To configure mDNS on the device, follow these steps:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

interface interface-name

Example:

Device(config)# interface Vlan 601

Enters interface mDNS configuration mode and enables interface configuration.

Step 4

mdns-sd gateway

Example:

Device(config-if)# mdns-sd gateway

Configures mDNS gateway on the interface.

Enter the following commands in the interface mDNS gateway configuration mode to enable the respective functionalities:

  • active-query : Sets the time interval for SDG agent to refresh the active status of connected Bonjour client services. The timer value ranges from 60 to 120 seconds.

    Note 

    This configuration is mandatory only on VLANs whose Bonjour policy is configured to accept Bonjour service announcements from connected Bonjour clients. If the VLAN is configured to only accept Bonjour queries but not Bonjour service announcements, this configuration is optional.

  • service-instance-suffix (Optional) : Appends the service instance suffix to any announced service name that is forwarded to the controller.

  • service-mdns-query [ ptr | all] : Configures mDNS query request message processing for the specified query types.

    If the service-mdns-query command is used without any keyword, then all Bonjour query types (PTR, SRV, and TXT) are processed by default. It is recommended to use the service-mdns-query ptr command.

  • service-policy policy-name : Attaches the specified service policy to the VLAN. Bonjour announcements, and queries received by and sent from the VLAN are governed by the policies configured in the service policy. This configuration is mandatory for all VLANs.

    Note 

    Service policies can only be attached at interface level.

  • transport [ all | ipv4 | ipv6] (Optional): Configures BCP parameter.

    It is recommended to use transport ipv4 command, except in those networks where the Bonjour clients send only IPv6 announcements and queries.

Step 5

exit

Example:

Device(config-if-mdns-sd)# exit

Exits mDNS gateway configuration mode.

Configuring Local Area Bonjour Domain for Wireless Networks

The configuration of local area Bonjour on a switch that acts as the SDG Agent in a wireless network involves the same set of procedures that are used to configure local area Bonjour on a switch that acts as the SDG Agent in a wired network.

The Bonjour protocol operates on service announcements and queries. Each query or advertisement is sent to the Bonjour multicast address ipv4 224.0.0.251 (ipv6 FF02::FB). This protocol uses mDNS on UDP port 5353.

The address used by the Bonjour protocol is link-local multicast address and therefore is only forwarded to the local L2 network. As, multicast DNS is limited to an L2 domain for a client to discover a service it has to be part of the same L2 domain, This is not always possible in any large scale deployment or enterprise.

In order to address this issue, the Cisco Catalyst 9800 Series Wireless Controller acts as a Bonjour Gateway. The controller then listens for Bonjour services, caches these Bonjour advertisements (AirPlay, AirPrint, and so on) from the source or host. For example, Apple TV responds back to Bonjour clients when asked or requested for a service. This way you can have sources and clients in different subnets.

By default, the mDNS gateway is disabled on the controller. To enable mDNS gateway functionality, you must explicitly configure mDNS gateway using CLI or Web UI.

Figure below illustrates a prerequisite configuration for Wireless network to enable seamless communication between SDG-Agent switches and Wireless endpoints.

The Cisco WLC and Access Points by default prevents forwarding Layer 2 or Layer 3 Multicast frames between Wireless and Wired network infrastructure. The forwarding is supported with stateful capabilities enabled using AP Multicast. The network administrator must globally enable Multicast and configure unique Multicast Group to advertise in network. This multicast group is only required for Cisco Access-Points to enable Multicast over Multicast (MCMC) capabilities across the LAN network. The Bonjour solution does not require any Multicast requirements on Wireless Client VLAN; thus, it is optional and applicable only for other Layer 3 Multicast applications.

The core network must be configured with appropriate Multicast routing allowing AP’s to join WLC Multicast Group. The Multicast configuration must be enabled on Cisco WLC management VLAN and on Cisco Access Point of their own respective distribution layer switch.

Enabling mDNS Gateway on the Device

To configure mDNS on the device, follow these steps:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd gateway

Example:

Device(config)# mdns-sd gateway

Enables mDNS on the device and enters mDNS gateway configuration mode.

Enter the following commands in mDNS gateway configuration mode to enable the respective functionalities:

  • air-print-helper : Enables IOS devices like iPADs to discover and use older printers that support Bonjour

  • cache-memory-max : Configures the percentage memory for cache

  • ingress-client : Configures Ingress Client Packet Tuners

  • rate-limit : Enables rate limiting of incoming mDNS packets

  • service-announcement-count : Configures maximum advertisements

  • service-announcement-timer : Configures advertisements announce timer periodicity

  • service-query-count : Configures maximum queries

  • service-query-timer : Configures query forward timer periodicity

  • service-type-enumeration : Configures service enumeration

Note 

For cache-memory-max , ingress-client , rate-limit , service-announcement-count , service-announcement-timer , service-query-count , service-query-timer , and service-type-enumeration commands, you can retain the default value of the respective parameter for general deployments. Configure a different value, if required, for a specific deployment.

Step 4

exit

Example:

Device(config-mdns-sd)# exit

Exits mDNS gateway configuration mode.

Creating Custom Service Definition

Service definition is a construct that provides an admin friendly name to one or more mDNS service types or PTR Resource Record Name. By default, few built-in service definitions are already predefined and available for admin to use. In addition to built-in service definitions, admin can also define custom service definitions.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd service-definition service-definition-name

Example:

Device(config)# mdns-sd service-definition CUSTOM1

Configures mDNS service definition.

Note 

All the created custom service definitions are added to the primary service list. Primary service list comprises of a list of custom and built-in service definitions.

Step 4

service-type string

Example:

Device(config-mdns-ser-def)# service-type _custom1._tcp.local

Configures mDNS service type.

Step 5

Repeat step 4 to configure more than one service type in the custom service definition.

Step 6

exit

Example:

Device(config-mdns-ser-def)# exit

Exit mDNS service definition configuration mode.

Creating Service List

mDNS service list is a collection of service definitions. To create a service list, follow these steps:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd service-list service-list-name {in | out}

Example:

Device(config)# mdns-sd service-list VLAN100-list in

Configures mDNS service list.

Step 4

match service-definition-name [message-type {any | announcement | query}]

Example:

Device(config-mdns-sl-in)# match PRINTER message-type announcement

Matches the service to the message type. Here, service-definition-name refers to the names of services, such as, airplay, airserver, airtunes, and so on.

Note 

To add a service, the service name must be part of the primary service list.

If the mDNS service list is set to IN, the applicable command syntax is: match service-definition-name [message-type {any | announcement | query}] .

If the mDNS service list is set to OFF, the applicable command syntax is: match service-definition-name .

Step 5

exit

Example:

Device(config-mdns-sl-in)# exit

Exits mDNS service list configuration mode.

Creating Service Policy

A Service Policy that is applied to an interface specifies the allowed Bonjour service announcements or the queries of specific service types that should be processed, in ingress direction or egress direction or both. For this, the service policy specifies two service-lists, one each for ingress and egress directions. In the Local Area Bonjour domain, the same service policy can be attached to one or more Bonjour client VLANs; however, different VLANs may have different service policies.

To configure service policy with service lists, follow these steps:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

Enter your password, if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

mdns-sd service-policy service-policy-name

Example:

Device(config)# mdns-sd service-policy mdns-policy1

Configures mDNS service policy.

Step 4

service-list service-list-name {in | out}

Example:

Device(config-mdns-ser-pol)# service-list VLAN100-list in
Device(config-mdns-ser-pol)# service-list VLAN300-list out

Configures service lists for IN and OUT directions.

Step 5

exit

Example:

Device(config-mdns-ser-pol)# exit

Exits mDNS service policy configuration mode.

Verifying Local and Wide Area Bonjour Domains

Verifying Service Discovery Gateway

The following is a sample output of the show mdns-sd service-list service-list-name {in | out} command.


Name		 Direction 	Service		Message-Type	   Source
==================================================================================
VLAN100-list        In 	      Printer 	    Announcement	      -
		       In 	      Airplay		Query		     -	
		       In 	      CUSTOM1	       Any			-
VLAN300-list	 Out		Printer	     Announcement	    Vl200

The following is a sample output of the show mdns-sd service-definitionservice-definition-name service-type {custom | built-in} command.


Service				PTR			    Type
================================================================================
apple-tv		      _airplay._tcp.local		Built-In
                           _raop._tcp.local
apple-file-share	    _afpovertcp._tcp.local          Built-In
CUSTOM1		       _custom1._tcp.local	      Custom
CUSTOM2		       _customA._tcp.local             Custom
                           _customA._tcp.local		

The following is a sample output of the show mdns-sd service-policy-name interface interface-name command.


Name			Service-List-In			Service-List-Out	
==================================================
mdns-policy-1		VLAN100-list			VLAN300-list		
mdns-policy-2		VLAN400-list			VLAN400-list	

The following is a sample output of the show mdns-sd summary [interface interface-name] command.


Global mDNS Gateway
==========================================
mDNS Gateway           : Enabled
Rate Limit                     : 60 PPS (default)
AirPrint Helper            : Disabled

Interface  :  Vlan601
==========================================
mDNS Gateway             : Enabled
mDNS Service Policy      : policy1
Active Query                   : Enabled
                                          : Periodicity 60 Seconds
Transport Type               : Both IPv4 & IPv6
Service Instance Suffix  : ghalwasi
mDNS Query Type          : ALL

Interface  :  Vlan602
==========================================
mDNS Gateway             : Enabled
mDNS Service Policy      : int602
Active Query                   : Enabled
                                          : Periodicity 100 Seconds
Transport Type               : Both IPv4 & IPv6
Service Instance Suffix  : 602
mDNS Query Type          : ALL

Verifying Controller

The following is a sample output of the show mdns controller summary command.

Device# show mdns controller summary

Controller Summary
=====================================
 Controller Name  :   DNAC-BONJOUR-CONTROLLER
 Controller IP    :   10.104.52.241
 State            :   UP
 Port             :   9991
 Interface        :   Loopback0
 Filter List      :   policy1
 Dead Time        :   00:01:00 

The following is a sample output of the show mdns controller export-summary command.

Device# show mdns controller export-summary

Controller Export Summary
=========================
 Controller IP    :   10.104.52.241
 State            :   UP
 Filter List      :   policy1
 Count            :   100
 Delay Timer      :   30 seconds
 Export           :   300
 Drop             :   0
 Next Export      :   00:00:01 

The following is a sample output of the show mdns controller statistics command.

Device# show mdns controller statistics

Total BCP message sent           : 47589
  Total BCP message received       : 3
  Interface WITHDRAW messages sent : 0
  Clear cache messages sent        : 0
  Total RESYNC state count         : 0
  Last successful RESYNC           : Not-Applicable

  Service Advertisements:
   IPv6 advertised                 : 0
   IPv4 advertised                 : 300
   Withdraws sent                  : 0
   Advertisements Filtered         : 0
   Total service resynced          : 0

  Service Queries:
   IPv6 queries sent               : 0
   IPv6 query responses received   : 0
   IPv4 queries sent               : 0
   IPv4 query responses received   : 0

The following is a sample output of the show mdns controller detail command.

Device# show mdns controller detail

Controller : DNAC-BONJOUR-CONTROLLER
 IP : 10.104.52.241, Dest Port : 9991, Src Port : 0, State : UP
 Source Interface : Loopback0, MD5 Disabled
 Hello Timer 0 sec, Dead Timer 0 sec, Next Hello 00:00:00
 Uptime 00:00:00
Service Announcement :
 Filter : policy1
 Count 100, Delay Timer 30 sec, Pending Announcement 0, Pending Withdraw 0
 Total Export Count 300, Next Export in 00:00:16
Service Query :
 Query Suppression Disabled
 Query Count 50, Query Delay Timer 15 sec, Pending 0
 Total Query Count 0, Next Query in 00:00:01

Verifying Local Area Bonjour for Wired and Wireless Networks

The following is a sample output of the show run command.


mdns-sd gateway                        
 rate-limit 100                        
 service-query-count 100               
 service-announcement-count 100 
 
      
mdns-sd service-definition custom1     
 service-type _airplay._tcp.local      
 service-type _raop._tcp.local         
 service-type _ipp._tcp.local          
 service-type _afpovertcp._tcp.local   
 service-type _nfs._tcp.local          
 service-type _ssh._tcp.local          
 service-type _dpap._tcp.local         
 service-type _daap._tcp.local         
 service-type _ichat._tcp.local        
 service-type _presence._tcp.local     
 service-type _http._tcp.local         
 service-type _ipps._tcp.local         
 service-type _printer._tcp.local      
 service-type _smb._tcp.local          
 service-type _ftp._tcp.local 
 
        
mdns-sd service-list list1 IN           
 match custom1
mdns-sd service-list list2 OUT
match custom1
 
 
mdns-sd service-policy policy1
service-list list1 IN
service-list list2 OUT
 
 
service-export mdns-sd controller APIC-EM
controller-address 99.99.99.10
controller-port 9991
controller-service-policy policy1 OUT
controller-source-interface Loopback0