Configuring Local Area Bonjour in Multicast DNS Mode for LAN

How to configure Multicast DNS Mode for LAN and Wired Networks

This section provides information about how to configure Local Area Bonjour in multicast DNS mode.

Enabling mDNS Gateway on the Device

To configure mDNS on the device, follow these steps:

SUMMARY STEPS

  1. configure terminal
  2. mdns-sd gateway
  3. exit

DETAILED STEPS

  Command or Action Purpose

Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

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

  • ingress-client : Configures Ingress Client Packet Tuners

  • service announcement-count : Configures maximum service advertisement count for controller

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

  • service query-count : Configures maximum query count for controller

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

Note

 

For ingress-client , service-announcement-count , service-announcement-timer , service-query-count , and service-query-timer 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 3

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, a 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.

SUMMARY STEPS

  1. configure terminal
  2. mdns-sd service-definition service-definition-name
  3. service-type string
  4. Repeat step 4 to configure more than one service type in the custom service definition.
  5. exit

DETAILED STEPS

  Command or Action Purpose

Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

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 3

service-type string

Example:

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

Configures mDNS service type.

Step 4

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

Step 5

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:

SUMMARY STEPS

  1. configure terminal
  2. mdns-sd service-list service-list-name {in | out}
  3. match {ser-def-name | all} message-type {any | announcement | query}
  4. exit

DETAILED STEPS

  Command or Action Purpose

Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

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

Example:

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

Configures mDNS service list.

Step 3

match {ser-def-name | all} message-type {any | announcement | query}

Example:

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

Matches the service and 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 {ser-def-name | all} message-type {any | announcement | query} .

If the mDNS service list is set to OUT, the applicable command syntax is: match {ser-def-name | all} [source-interface valns] .

Step 4

exit

Example:

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

Exits mDNS service list configuration mode.

Creating Service Policy

A Service Policy that is applied to a VLAN 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:

SUMMARY STEPS

  1. configure terminal
  2. mdns-sd service-policy service-policy-name
  3. service-list service-list-name {in | out}
  4. exit

DETAILED STEPS

  Command or Action Purpose

Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

mdns-sd service-policy service-policy-name

Example:

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

Configures mDNS service policy.

Step 3

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 4

exit

Example:

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

Exits mDNS service policy configuration mode.

Associating Service Policy to a VLAN

To configure mDNS on the device, follow these steps:

SUMMARY STEPS

  1. configure terminal
  2. vlan configuration vlan-id
  3. mdns-sd gateway
  4. exit

DETAILED STEPS

  Command or Action Purpose

Step 1

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 2

vlan configuration vlan-id

Example:

(config-vlan-config)# vlan configuration 601

Enters VLAN configuration mode and enables VLAN configuration.

Step 3

mdns-sd gateway

Example:

(config-vlan-mdns-sd)# mdns-sd gateway

Configures mDNS gateway on the VLAN.

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 3600 seconds.

    Note

     

    The default active-query timer is for 1800 seconds and it will run for all VLANs where mdns-sd gateway is enabled. There is no way to disable it.

  • 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 not mandatory. If the user has not specified the service policy for a VLAN, then a default service policy default-mdns-service-policy will be used.

    Note

     

    Service policies can only be attached at VLAN level.

Step 4

exit

Example:

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

Exits mDNS gateway configuration mode.

Verifying Local Area Bonjour in Multicast DNS Mode for LAN

This section shows how to verify Local Area Bonjour in Multicast DNS mode for LAN.

Verifying SDG-Agent Status

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

Global mDNS Gateway
=============================================
mDNS Gateway                 : Enabled
Rate Limit                   : 200 PPS
Cache Memory Max             : 10 Percentage
AirPrint Helper              : Disabled

Ing-qry supp                 : Enabled
Ing-qry supp Packet Gap      : 15 PPS
Ing-qry reply service count  : 100
Service Announcement Count   : 100
Service Query Count          : 100
Announcement Timer           : 5 Seconds
Query Timer                  : 15 Seconds

The following is a sample output of the show mdns-sd service-policy [name ser-pol-name ] command.


Service Policy Name     Service List IN Name             Service List Out Name
==================================================================================================
sp-one                              cus-sl-in                        cus-sl-out
default-mdns-service-policy         default-mdns-in-service-list     default-mdns-out-service-list
Device#

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


Name                               Type      Service                    Msg-Type       Source
===============================================================================================
macbook-list-out                   OUT       macbook_custom             none           all
appletv-list-out                   OUT       appletv_custom             none           all
default-mdns-in-service-list       IN        apple-airprint             any            none
                                             apple-remote-login         any            none
                                             apple-screen-share         any            none
                                             apple-tv                   any            none
                                             apple-windows-fileshare    any            none
                                             google-chromecast          any            none
                                             google-expeditions         any            none
                                             homesharing                any            none
                                             multifunction-printer      any            none
                                             printer-ipps               any            none
l3vni-list-in                      IN        l3vni_custom               any            none
default-mdns-out-service-list      OUT       apple-airprint             none           all
                                             apple-remote-login         none           all
                                             apple-screen-share         none           all
                                             apple-tv                   none           all
                                             apple-windows-fileshare    none           all
                                             google-chromecast          none           all
                                             google-expeditions         none           all
                                             homesharing                none           all
                                             multifunction-printer      none           all
                                             printer-ipps               none           all
l3vni-list-out                     OUT       l3vni_custom               none           all
macbook-list-in                    IN        macbook_custom             any            none
appletv-list-in                    IN        appletv_custom             any            none
list1                              IN        custom1                    any            none
list2                              OUT       custom1                    none           all
List2                              OUT       custom1                    none           all

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


Service                      Type                      PTR
===================================================================================
airplay                      built-in                 _airplay._tcp.local

apple-screen-share           built-in                 _rfb._tcp.local

spotify                      built-in                 _spotify-connect._tcp.local

apple-remote-login           built-in                 _sftp-ssh._tcp.local
                                                      _ssh._tcp.local

apple-itunes-music           built-in                 _daap._tcp.local

apple-tv                     built-in                 _raop._tcp.local
                                                      _airplay._tcp.local

apple-homekit                built-in                 _hap._tcp.local
                                                      _homekit._tcp.local

appletv_custom               custom                   _airplay._tcp.local
                                                      _companion-link._tcp.local
                                                      _homekit._tcp.local
                                                      _mediaremotetv._tcp.local
                                                      _raop._tcp.local
                                                      _sleep-proxy._udp.local

apple-itunes-library         built-in                 _atc._tcp.local
Switch(config)#

Verifying Local Area Bonjour Configuration for LAN

The following is a sample output of the show running-config mdns [all] command.


!Command: show running-config mdns
!No configuration change since last restart
!Time: Fri Apr 15 06:58:29 2022

version 10.2(3) Bios:version 07.69
feature mdns

mdns-sd gateway
  air-print helper
  ingress-client query-suppression
vlan configuration 10
mdns-sd gateway
  active-query timer 60
vlan configuration 2000
mdns-sd gateway
  active-query timer 60
mdns-sd controller bhag
  address 100.100.100.1
  source-interface Lo0
mdns-sd service-list cus-sl-in IN
  match all message-type any
mdns-sd service-list cus-sl-out OUT
  match all
mdns-sd service-policy sp-one
  service-list cus-sl-in IN
  service-list cus-sl-out OUT