The mdns source ip command configures a source IP address for the device acting as an mDNS relay to discover services and forward mDNS packets to the mDNS gateway, or configures a source IP address for the device acting as an mDNS gateway to send mDNS query or response packets.
The undo mdns source ip command deletes the configured source IP address.
By default, the source IP address is not configured.
Parameter |
Description |
Value |
---|---|---|
ip-address |
Specifies the source IP address. |
The value is in dotted decimal notation. |
Usage Scenario
If the device works as an mDNS relay, it is recommended that the IP address of an interface on the mDNS relay connecting to the mDNS gateway be used as the source IP address.
If the destination addresses of mDNS response packets sent by an mDNS gateway or mDNS relay to terminals and probe packets sent by an mDNS gateway or mDNS relay to service provisioning devices are multicast addresses, terminals and service provisioning devices will ignore the source IP address in the received multicast mDNS packets. Therefore, if no IP address is configured for VLANIF interfaces of the VLANs where the terminals and service provisioning devices reside, the mDNS gateway or mDNS relay can specify any source IP address for the packets.
When the mDNS relay is enabled to periodically discover services, it encapsulates the configured source IP address into outgoing mDNS discover packets so that it can receive response packets from service provisioning devices. If an IP address is assigned to the VLANIF interface corresponding to the VLAN where the device periodically discovers services, the device encapsulates the IP address of the VLANIF interface into outgoing mDNS discover packets. In this case, you do not need to specify the source IP address in outgoing mDNS discover packets.
When the device as the mDNS relay forwards mDNS packets to the mDNS gateway, it encapsulates the source IP address as the next hop IP address of the outbound interface according to its routing table. If the mdns source ip command is used, the device preferentially uses the configured source IP address.
Precautions
When the device acting as an mDNS gateway is configured to periodically discover services, the device periodically sends mDNS query packets to all mDNS service provisioning devices in the VLAN, which are expected to return response packets. The destination IP address is the multicast address 224.0.0.251.
Before the mDNS service TTL expires, the mDNS gateway sends mDNS query packets to service provisioning devices that are expected to return response
packets. If an mDNS service is advertised through an mDNS relay, the destination IP address of the query packets is the IP address of the mDNS relay. If an mDNS service is not advertised through an mDNS relay, the destination IP address is the multicast address 224.0.0.251.
When the device acting as an mDNS gateway receives mDNS requests from terminals and the requested services are available, the device returns mDNS response packets. If the mDNS request packets are forwarded through an mDNS relay, the destination IP address of the response packets is the IP address of the mDNS relay. If mDNS request packets are not forwarded through an mDNS relay, the destination IP address is the multicast address 224.0.0.251.