As shown in Figure 1, mobile terminals of an enterprise connect to the Internet through the WLAN. Layer 2 forwarding is performed between the Switch and AP_1 and AP_2. Departments 1 and 2 belong to VLAN 10 and VLAN 20 respectively, and each department has a Bonjour-compliant printer. The enterprise requires that the Apple terminals discover services provided by all printers in the enterprise using Bonjour.
If mobile terminals with Apple iOS V6.0 or later dynamically obtain IP addresses using DHCP, run the dns-list command in the global address pool view or the dhcp server dns-list command in the interface address pool view to configure the DNS server IP address.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] mdns gateway enable
[Switch] mdns group group1 [Switch-mdns-group-group1] user-vlan 10 [Switch-mdns-group-group1] service-vlan 20 [Switch-mdns-group-group1] quit
[Switch] mdns permit service-type _raop._tcp.local id 0 [Switch] mdns permit service-type _airplay._tcp.local id 1 [Switch] mdns permit service-type _printer._tcp.local id 2 [Switch] mdns permit service-type _device-info._tcp.local id 3 [Switch] mdns permit service-type _rfb._tcp.local id 4 [Switch] mdns permit service-type _sftp-ssh._tcp.local id 5 [Switch] mdns permit service-type _ssh._tcp.local id 6 [Switch] mdns permit service-type _smb._tcp.local id 7 [Switch] mdns permit service-type _afpovertcp._tcp.local id 8 [Switch] mdns permit service-type _universal._sub._ipp._tcp.local id 9
[Switch] vlan 10 [Switch-vlan10] mdns probe interval 100 [Switch-vlan10] quit [Switch] interface vlanif 10 [Switch-Vlanif10] ip address 192.168.2.1 24 [Switch-Vlanif10] quit [Switch] vlan 20 [Switch-vlan20] mdns probe interval 100 [Switch-vlan20] quit [Switch] interface vlanif 20 [Switch-Vlanif20] ip address 192.168.3.1 24 [Switch-Vlanif20] quit
# Run the display mdns gateway command on the Switch to check the mDNS gateway configuration.
[Switch] display mdns gateway MDNS Information: -------------------------------------------------------------------------------- MDNS Gateway Status : Enable MDNS Source IP : - -------------------------------------------------------------------------------- Gateway Probe Vlan : vlan10 vlan20 --------------------------------------------------------------------------------
# Run the display mdns service all command on the Switch to check service information recorded on the mDNS gateway.
[Switch] display mdns service all MDNS Service Info: Service name : Officejet Pro 8100 [C12FFA] (6)._printer._tcp.local TXT Info: Data Length : 297 Service name : _printer._tcp.local PTR Info: Domain Name : Officejet Pro 8100 [C12FFA] (6)._printer._tcp.local Service name : Officejet Pro 8100 [C12FFA] (7)._ipp._tcp.local TXT Info: Data Length : 408 Service name : _ipp._tcp.local PTR Info: Domain Name : Officejet Pro 8100 [C12FFA] (7)._ipp._tcp.local Total: 4
# After the configuration is complete, Bonjour-compliant terminals can discover printers in VLAN 10 and VLAN 20.
Configuration file of the Switch
# sysname Switch # mdns gateway enable mdns permit service-type _raop._tcp.local id 0 mdns permit service-type _airplay._tcp.local id 1 mdns permit service-type _printer._tcp.local id 2 mdns permit service-type _device-info._tcp.local id 3 mdns permit service-type _rfb._tcp.local id 4 mdns permit service-type _sftp-ssh._tcp.local id 5 mdns permit service-type _ssh._tcp.local id 6 mdns permit service-type _smb._tcp.local id 7 mdns permit service-type _afpovertcp._tcp.local id 8 mdns permit service-type _universal._sub._ipp._tcp.local id 9 # mdns group group1 user-vlan 10 service-vlan 20 # vlan 10 mdns probe interval 100 # vlan 20 mdns probe interval 100 # interface Vlanif 10 ip address 192.168.2.1 255.255.255.0 # interface Vlanif20 ip address 192.168.3.1 255.255.255.0 # return