You are on page 1of 4

CentOS on Hyper‐v for AirPlay Zeroconf discovery

Thursday, January 3, 2013 10:52 AM

Airplay exclusively uses mDNS for advertisement, unlike airprint the advertisement can not be propagated via dns/dns‐sd. My guess is that the airplay clients will only 
search  the local link using mDns.
This document goes through installing a 'zeroconf' mdns/dns‐sd compliant service that will propagate mDNS registrations across multiple interfaces/networks. 
Therefore, airplay clients can find airplay servers on different vlans/networks, whereas without a 'mDNS proxy' they would be limited within the same network.

Hyper‐V network configuration 
This will be the virtual network used by the Linux VM.
Select 'Virtual Network Manager'. Select 'New virtual network'. 
Uncheck 'Allow management operating system to share this network adapter'. Make sure that you are using an unused network card on you server.

Installing CenOS
Create a new VM. Assign the connection to previously created above virtual network.

Linux Page 1
     

After the vm is installed select 'settings'. Remove the network interface, and re‐add it, and use the legacy driver. We will only be using the Legacy Network Adapter 
for initial installation. Once the Linux integration services are installed we will remove and re‐add it using the 'Network Adapter'

Download CentOS 6.3‐minimal.iso (insert disk & install)  
Typical drive size of 20Gig and 2Gig of ram.
Complete the install.

Install linux integration services for HyperV. It can be found here ‐> http://www.microsoft.com/en‐ca/download/details.aspx?id=34603

Download LinuxICv34.iso (insert disk). That is mount the iso under the HyperV management console for the given VM.

mount /dev/sr0 /mnt
cd /mnt/RHEL63
./install.sh
umount /dev/sr0

**NOTE About the cdrom after the integration services are installed**
After the integration services are installed  and the system is rebooted, the cdrom driver is not automatically loaded. And the following command must be run 
before mounting the device. 

Linux Page 2
# insmod /lib/modules/$(uname -r)/kernel/drivers/ata/ata_piix.ko
From <http://social.technet.microsoft.com/Forums/en‐US/linuxintegrationservices/thread/5d10cb5a‐8e4b‐4371‐bebb‐78b41eb0bee7> 

Once the install is done, shutdown the VM, note the mac address and then remove the legacy adapter.
Add a standard network adapter. Apply and restart the VM

Update your network settings via vi
vi /etc/sysconfig/network‐scripts/ifcfg‐eth0
use "i" to insert text, (esc) to exit and ":wq" to write your changes.

IT should look something like this:

DEVICE="eth0"
BOOTPROTO=none
ONBOOT="yes"
TYPE="Ethernet"
HWADDR=(MAC ADDRESS, This should match what is configured in Hyper‐V)
IPADDR=(YOUR SERVER IP)
GATEWAY=(YOUR DEFAULT GATEWAY) <‐ **Omit this here. Put the gateway in the /etc/sysconfig/network**

Add additional network interfaces. Please remember to 'Enable virtual LAN identification' and the proper VLAN ID. The additional interfaces will use dhcp, but still have 
to be configured in the /etc/sysconfig/network‐scripts. i.e. ifcfg‐eth1 ‐> eth1, ifcfg‐eth2 ‐> eth2

Once complete restart network working. /etc/init.d/network restart

Check interfaces by 'ifconfig'.  If you do not see eth0, try a 'ifup eth0'. If you get an error regarding a delay, check your mac‐address in the 
/etc/sysconfig/network‐scripts/ifcfg‐eth0 and /etc/udev/rules.d/70‐persistent‐net.rules. Make sure the mac‐address matches the interface assignment.

Add a dns server to /etc/resolv.conf ‐> nameserver 8.8.8.8

Test network connectivity. 'ping www.google.com'

Update system. 'yum update'

The only static ip for our configuration with be eth0. All other interfaces just use DHCP.

Disable rp_filter in the /etc/sysctl.conf. 
Run sysctl ‐p after file is modified and saved. Check by Running sysctl ‐a | grep "\\.rp_filter" all entries should be equal to zero.

Avahi installation / configuration
Install Avahi. 

Linux Page 3
'yum install avahi'
Edit the /etc/avahi/avahi‐daemon.conf.  Please note that you must include all interfaces that are participating in service discovery.

allow‐interfaces=eth0,eth1 
enable‐reflector=yes

Restart avahi. 
Test for discovered services.  'avahi‐browse ‐a'

Gre Tunnel configuration
To have the mDNS advertisements to be propagated across an intermediate network bridging multiple LANS, gre tunnels can be created.

The 172 addresses will be only used for the gre tunnel interface.  An example ‐> 

#!/bin/sh

ip tunnel add net7 mode gre remote 10.7.0.7 local 10.10.0.7 ttl 255
ip link set net7 up
ip link set net7 multicast on
ip addr add 172.16.10.1 dev net7

The ip address of the gre tunnel does not require a route for this implementation, but if you would like to create one that would be fine.
Add the tunnel script to the /etc/rc.d/rc.local. Or if you feel motivated you can create a init script and enable it using chkconfig.
Do not forget to add the 'netX' device to your avahi configuration file.

Good Luck.

Linux Page 4

You might also like