华为配置mDNS网关示例(AP与AC间二层转发)
组网图形
组网需求
如图1所示,某企业的移动终端通过WLAN连接网络,AP_1和AP_2分别与AC之间采用二层转发。部门1和部门2分别属于VLAN10和VLAN20,且两个部门内各有一台支持Bonjour技术的打印机。部门内的Apple终端希望通过Bonjour技术发现企业中所有打印机提供的服务。
配置思路
通过在AC上配置mDNS网关,实现跨VLAN的服务发现。
操作步骤
- 配置iPhone、Printer_1和Printer_2通过WLAN接入Internet,具体配置请参见配置小型网络WLAN基本业务示例。
针对Apple iOS v6.0以上版本的移动终端,如果通过DHCP服务器动态获取IP地址,需要在地址池中执行命令dns-list(基于全局地址池)或dhcp server dns-list(基于接口地址池)配置DNS服务器的IP地址。
- 在AC上使能mDNS网关功能。
<HUAWEI> system-view [HUAWEI] sysname AC [AC] mdns gateway enable
- 在AC上配置mDNS组。
[AC] mdns group group1 [AC-mdns-group-group1] user-vlan 10 [AC-mdns-group-group1] service-vlan 20 [AC-mdns-group-group1] quit
- 在AC上配置mDNS网关允许记录的常用服务类型。
[AC] mdns permit service-type _raop._tcp.local id 0 [AC] mdns permit service-type _airplay._tcp.local id 1 [AC] mdns permit service-type _printer._tcp.local id 2 [AC] mdns permit service-type _device-info._tcp.local id 3 [AC] mdns permit service-type _rfb._tcp.local id 4 [AC] mdns permit service-type _sftp-ssh._tcp.local id 5 [AC] mdns permit service-type _ssh._tcp.local id 6 [AC] mdns permit service-type _smb._tcp.local id 7 [AC] mdns permit service-type _afpovertcp._tcp.local id 8 [AC] mdns permit service-type _universal._sub._ipp._tcp.local id 9
- 在AC上配置定时发现服务功能。
[AC] vlan 10 [AC-vlan10] mdns probe interval 100 [AC-vlan10] quit [AC] interface vlanif 10 [AC-Vlanif10] ip address 192.168.2.1 24 [AC-Vlanif10] quit [AC] vlan 20 [AC-vlan20] mdns probe interval 100 [AC-vlan20] quit [AC] interface vlanif 20 [AC-Vlanif20] ip address 192.168.3.1 24 [AC-Vlanif20] quit
- 验证配置结果
# 在AC上执行命令display mdns gateway,查看mDNS网关的配置信息。[AC] display mdns gateway mDNS Information: --------------------------------------------------------------------------------mDNS Gateway Status : Enable mDNS Gateway Policy : Disable mDNS Policy no-match action : Deny mDNS Gateway Unicast : Disable mDNS Source IP : - --------------------------------------------------------------------------------Gateway Probe Vlan : vlan10 vlan20 --------------------------------------------------------------------------------
# 在AC上执行命令display mdns service all,查看mDNS网关上记录的服务信息。
# 配置完成后,在用户终端上能够找到VLAN10和VLAN20内的打印服务。
配置文件
AC的配置文件#sysname AC
#
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
#
vlan batch 10 20
#
vlan 10 mdns probe interval 100
vlan 20 mdns probe interval 100
#
mdns group group1 user-vlan 10 service-vlan 20
#
interface Vlanif10 ip address 192.168.2.1 255.255.255.0
#
interface Vlanif20 ip address 192.168.3.1 255.255.255.0
#
return