How to Configure mDNS Gateway?
Traditional networks use DNS and DHCP protocols which require servers and complex configurations to operate. Multicast DNS or mDNS is a set of protocols and technologies which provide automatic services of discovery, name resolution without manual configuration. It is a zero-configuration service used by local networks.
In today’s topic we will learn about mDNS gateway and understand how to configure it.
What is mDNS Gateway?
Traditional networking is based on TCP/IP, network devices must know the IP address of each other before they could talk or communicate. Remembering numbers could be cumbersome compared to names so a network administrator can configure a DNS service which maps IP addresses to host names. A device must be configured with a DNS server for IP address resolution to the named host.
In order to reduce manual configuration efforts, zero configuration networks terminology came into existence. Zero configuration networks are used widely in residential wireless networks and small office setups. This allows devices to automatically obtain IP addresses, resolution of domain names, and discover services in local networks.
Apple Inc. Bonjour is mDNS and DNS-SD based Layer 2 service. Most Apple products such as iTunes, iPod, iPhone, Apple TV use Bonjour. Bonjour implements only Intra-VLAN service. To implement service discovery across VLANs, a mDNS gateway is proposed.
The mDNS gateway records a list of all available printing and other services and responds to requests of terminals so that service discovery can happen across network segments and VLANs.
Configuring mDNS Gateway
Step 1
Create a service for mDNS gateway using mdns-sd service command. No mdns-sd disable mDNS gateway on VLAN interface. Multiple services IDs can be grouped into a single service.
Switch1(config)# interface vlan 20
Switch1(config-if-vlan)# mdns-sd
To disable use
Switch1(config)# interface vlan 20
Switch1(config-if-vlan)# no mdns-sd
Provide description for each service using description command. No description deletes service description.
description <SERVICE-DESCRIPTION>
no description <SERVICE-DESCRIPTION>
Step 2
Create unique service IDs with id command. The service ID configured here should be the same as the service ID that is in the packet. no id removes service ID from service
id <SERVICE-ID>
no id <SERVICE-ID>
Step 3
Create a profile to be applied to a VLAN using mdns-sd profile command. Profile has a set of rules to define match parameters – service-name and service-instance-name.
Switch1(config)# mdns-sd profile test
Step 4
Add rules to profile using sequence-number command. This command adds a filter rule to the service profile. The configured sequence number determines the priority of the rule match. Lower sequence number indicates higher priority
Filter match has two parameters:
- Service-name – matches against the service IDs the mDNS packets configured under the service name
- Service-instance-name – matches against the service instance name of the mDNS packets present in the mDNS packets.
Any mDNS packet will be matched if no match criteria is specified. Packets will be denied or permitted based on action defined in the rule. The no form of this command delete filter configured in this service profile.
<SEQUENCE_NUMBER> {permit | deny}
{service-name <SERVICE-NAME> | service-instance-name <SERVICE-INSTANCE-NAME>}
no <SEQUENCE-NUMBER> {permit | deny}
{service-name <SERVICE-NAME> | service-instance-name <SERVICE-INSTANCE-NAME>}
Step 5
Enable mDNS gateway on VLAN using mdns-sd command
Switch1(config)# interface vlan 20
Switch1(config-if-vlan) # mdns-sd
Step 6
Apply profile to VLAN with mdns-sd apply-profile tx command
Switch1(config)# interface vlan 20
Switch1(config-if-vlan)# mdns-sd
Switch1(config-if-vlan)# mdns-sd apply-profile test tx
You can view configuration of profile for an interface using show running-config interface command.
Switch1# show running-config interface vlan10
interface vlan20
mdns-sd
mdns-sd apply-profile test tx
ip address 11.2.2.2/24
Step 7
To enable mDNS gateway globally use mdns-sd enable command
Switch1(config)# mdns-sd enable
Step 8
Type show mdns-ds summary command to view mDNS enabled at VLAN interface.
Switch1# show mdns-sd summary
global mdns-sd status: enabled
————————————-
VLAN-Id Status Tx-Profile
————————————-
1 enabled test
2 disabled dev
Tag:services