Example for Configuring the mDNS Gateway
Service Requirements
Departments 1 and 2 of an enterprise belong to VLAN 101 and VLAN 102, respectively. A Bonjour-capable printer is added to each department. When submitting printing requests using Apple STAs, employees in both the departments want to discover and use printers in VLAN 101 and VLAN 102. Bonjour technology advertises available services using mDNS packets. Therefore, STAs can discover services only in the local VLAN. To resolve this problem, you can configure an AC as the mDNS gateway, so that STAs can discover services across VLANs.
Networking Requirements
AC networking mode: Layer 2 networking in bypass mode
Data Planning
Item |
Data |
---|---|
Communication interface of the AC |
VLANs to which STAs and service provisioning devices belong: VLAN 101 and VLAN 102 VLANIF 101: 10.23.101.3/24 VLANIF 102: 10.23.102.3/24 |
Scheduled service discovery |
Enabled. The interval for discovering services is 150 seconds. |
Configuration Roadmap
- Deploy the AC, STAs, and service provisioning devices on a Layer 2 network and ensure that they can communicate with each other.
- Configure the mDNS gateway. To proactively query and update existing services on the network, enable scheduled service discovery on the mDNS gateway.
Configuration Notes
When the AC and service provisioning devices are deployed on a Layer 3 network, you need to enable scheduled service discovery on the mDNS relay agent instead of the mDNS gateway.
If scheduled service discovery is enabled in the VLAN, and no VLANIF interface is configured on the AC accordingly, you need to specify a source interface to ensure that service provisioning devices can send response packets to the AC.
Only one mDNS gateway can be deployed on a service sharing network.
If the number of network services recorded by the mDNS gateway exceeds 64, you are advised to divide services into different mDNS groups for refined management.
If the AC and APs are connected at Layer 3 and direct forwarding is used, it is recommended that the mdns centralized-control enable command be executed in the VAP profile view to enable tunnel forwarding for mDNS packets so that mDNS packets can be forwarded to the AC for centralized processing.
Procedure
- Configure the AC, STAs, and service provisioning devices to communicate with each other.# Add GE0/0/2 on the aggregation device SwitchB to VLAN 101 and VLAN 102.
<SwitchB> system-view [SwitchB] vlan batch 101 102 [SwitchB] interface GigabitEthernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] port link-type trunk [SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 101 102 [SwitchB-GigabitEthernet0/0/2] quit
# Add GE0/0/1 on the AC to VLAN 101 and VLAN 102.
<AC> system-view [AC] vlan batch 101 102 [AC] interface GigabitEthernet 0/0/1 [AC-GigabitEthernet0/0/1] port link-type trunk [AC-GigabitEthernet0/0/1] port trunk allow-pass vlan 101 102 [AC-GigabitEthernet 0/0/1] quit
# Configure IP addresses of VLANIF 101 and VLANIF 102 on the AC.
[AC] interface vlanif 101 [AC-Vlanif101] ip address 10.23.101.3 24 [AC-Vlanif101] quit [AC] interface vlanif 102 [AC-Vlanif102] ip address 10.23.102.3 24 [AC-Vlanif102] quit
- Configure the mDNS gateway.
# Enable the mDNS gateway function on the AC.
[AC] mdns gateway enable
# Enable scheduled service discovery.
[AC] vlan 101 [AC-vlan101] mdns probe interval 150 [AC-vlan101] quit [AC] vlan 102 [AC-vlan102] mdns probe interval 150 [AC-vlan102] quit
- Verify the configuration.
When an Apple STA accesses the WLAN of department 1, it can discover and use printers of department 2.
Configuration Files
- SwitchB configuration file
# vlan batch 101 to 102 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 101 to 102 # return
- AC configuration file
# 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 101 to 102 # vlan 101 mdns probe interval 150 vlan 102 mdns probe interval 150 # interface Vlanif101 ip address 10.23.101.3 255.255.255.0 # interface Vlanif102 ip address 10.23.102.3 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 to 102 # return