< Home

mdns source ip

Function

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.

Format

mdns source ip ip-address

undo mdns source ip

Parameters

Parameter

Description

Value

ip-address

Specifies the source IP address.

The value is in dotted decimal notation.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

This command is used on an mDNS gateway or mDNS relay.

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.

  • The mdns source ip command has three functions when the device works as an mDNS gateway:
    • When the mDNS gateway is enabled to periodically discover services, it encapsulates the configured source IP address into outgoing mDNS query packets so that it can receive response packets from service provisioning devices. If an IP address is assigned to the VLANIF interface of the VLAN where the device periodically discovers services, the mDNS gateway encapsulates the IP address of the VLANIF interface into outgoing mDNS query packets. In this case, you do not need to specify the source IP address in outgoing mDNS query packets.
    • Packets are unicast between an mDNS gateway and an mDNS relay. The mDNS gateway encapsulates the source IP address of the packets as the next-hop IP address of the outbound interface based on the routing table. If this command is configured, the device preferentially encapsulates the original source IP address as the configured source IP address.
    • The mDNS gateway encapsulates the configured source IP addresses in mDNS response packets sent to user terminals. If an IP address is assigned to the VLANIF interface of the VLAN to which the response packets belong, the mDNS gateway automatically encapsulates the IP address of the VLANIF interface into outgoing mDNS response packets, removing the need to specify the source IP address in outgoing mDNS response packets.
  • The mdns source ip command has two functions when the device works as an mDNS relay:
    • 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.

Example

# Specify the source IP address of 10.1.1.1 in mDNS packets to be sent to periodically discover services and to be forwarded to the mDNS gateway by the device as the mDNS relay.

<HUAWEI> system-view
[HUAWEI] mdns source ip 10.1.1.1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >