HowToZeroconf

Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2005-05-28 20:35:59
Size: 4346
Editor: adsl-213-190-44-43
Comment: imported from the old wiki
Revision 6 as of 2006-05-31 03:01:06
Size: 4464
Editor: S0106000fb085cc63
Comment: rework installation
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= How To Zeroconf =

[http://www.zeroconf.org/ Zeroconf] is a collection of tools and protocols to allow networks to configure themselves. It is called Bonjour (formerly Rendezvous) by Apple, and used extensivly on Mac OS X.
[http://www.zeroconf.org/ Zeroconf] is a collection of tools and protocols to allow networks to configure themselves. It is called Bonjour (formerly Rendezvous) by Apple, and used extensively on Mac OS X.
Line 10: Line 8:
Traditionally most of its work is done by DHCP and DNS. But the decentralised zeroconf method is appropriate is some situations, for example ad-hoc networks. It also requires no configuration (appart from the installation). Traditionally most of its work is done by DHCP and DNS. But the decentralised zeroconf method is appropriate is some situations, for example ad-hoc networks. It also requires no configuration (apart from the installation).
Line 12: Line 10:
It works happily along side traditional tools. For example you may have an IP address alocated by DHCP and use DNS to resolve address on the web, but still use the hostname.local from MDNS to resolve the addresses of other computer on the LAN. It works happily along side traditional tools. For example you may have an IP address allocated by DHCP and use DNS to resolve address on the web, but still use the hostname.local from MDNS to resolve the addresses of other computer on the LAN.

Note, if you are not doing this on your own network you may want to talk to the Network Admin first. Although zeroconf is a fairly efficient protocol the admin may not want the extra traffic. Also be aware that it is trivially easy to spoof an mdns .local name.
Line 16: Line 16:
To start using Zeroconf you need to install libnss-mdns and mdnsresponder on each computer. These are both in the universe, and can be installed with synaptic or a quick === Ubuntu 6.06 and 5.10 ===
Line 18: Line 18:
{{{
sudo apt-get install libnss-mdns mdnsresponder
}}}
Just install the packages {{{avahi-daemon}}} and {{{libnss-mdns}}}.


=== Ubuntu 5.04 ===

If you are running Ubuntu 5.04 then you will need to use the {{{libnss-mdns}}} package.
Line 39: Line 42:
Now each computer with mdnsresponder installed will identify its self on the network as Now each computer with avahi-daemon (or mdnsresponder) installed will identify its self on the network as
Line 57: Line 60:
== PowerPC problem on Ubuntu 5.04 ==
Line 58: Line 62:

== PowerPC problem ==

libnss-mdns 0.3 is broken on big-endian systems such as PowerPC ( https://bugzilla.ubuntu.com/show_bug.cgi?id=10912 ). However the problem is fixed with version 0.4. This will probably not be in the repository until [BreeezyBadger]. Until then it is possible to download the source from http://0pointer.de/lennart/projects/nss-mdns/ and build it.
libnss-mdns 0.3 is broken on big-endian systems such as PowerPC ( https://bugzilla.ubuntu.com/show_bug.cgi?id=10912 ). However the problem is fixed with version 0.4.
Line 65: Line 66:
If you are running a fire wall and you are having problems like If you are running a firewall and you are having problems like
Line 70: Line 71:
then it is possible that your firewall is blocking the zeroconf comunication. If you can turn your firewall off and this fixes the problem, then it is definately the firewall. then it is possible that your firewall is blocking the zeroconf communication. If you can turn your firewall off and this fixes the problem, then it is definitely the firewall.
Line 78: Line 79:
You will need to chmod u+x this file to make it writeable. You will need to chmod u+x this file to make it writable.
Line 122: Line 123:

CategoryDocumentation CategoryCleanup

[http://www.zeroconf.org/ Zeroconf] is a collection of tools and protocols to allow networks to configure themselves. It is called Bonjour (formerly Rendezvous) by Apple, and used extensively on Mac OS X.

Zeroconf consists of

  • Name resolution, MDNS
  • Service Advertising
  • Address allocation

Traditionally most of its work is done by DHCP and DNS. But the decentralised zeroconf method is appropriate is some situations, for example ad-hoc networks. It also requires no configuration (apart from the installation).

It works happily along side traditional tools. For example you may have an IP address allocated by DHCP and use DNS to resolve address on the web, but still use the hostname.local from MDNS to resolve the addresses of other computer on the LAN.

Note, if you are not doing this on your own network you may want to talk to the Network Admin first. Although zeroconf is a fairly efficient protocol the admin may not want the extra traffic. Also be aware that it is trivially easy to spoof an mdns .local name.

Installation

Ubuntu 6.06 and 5.10

Just install the packages avahi-daemon and libnss-mdns.

Ubuntu 5.04

If you are running Ubuntu 5.04 then you will need to use the libnss-mdns package.

Now you need to enable mdns name resolution. This is controlled by the file

/etc/nsswitch.conf

Find the line

hosts:       files dns

and change it to

hosts:       files dns mdns4

Make sure you do this on each computer.

MDNS

Now each computer with avahi-daemon (or mdnsresponder) installed will identify its self on the network as

hostname.local

for example, my computer flute, identifies itself as

flute.local

Now any computer on the network can use hostname.local in place of an ip address. For example you can do

ping flute.local

or

ssh flute.local

PowerPC problem on Ubuntu 5.04

libnss-mdns 0.3 is broken on big-endian systems such as PowerPC ( https://bugzilla.ubuntu.com/show_bug.cgi?id=10912 ). However the problem is fixed with version 0.4.

Firewall configuration

If you are running a firewall and you are having problems like

sam@titania:~$ ping flute.local
ping: unknown host flute.local

then it is possible that your firewall is blocking the zeroconf communication. If you can turn your firewall off and this fixes the problem, then it is definitely the firewall.

http://0pointer.de/lennart/projects/nss-mdns/ advises to "allow UDP traffic to the the mDNS multicast address 224.0.0.251 on port 5353."

If you are using [Firestarter] all multicast traffic is blocked. This may be configurable in the next version. The current work around is to edit

/etc/firestarter/firewall

You will need to chmod u+x this file to make it writable.

Find the section

# Block Multicast Traffic
#  Some cable/DSL providers require their clients to accept multicast transmissions
#  you should remove the following four rules if you are affected by multicasting
$IPT -A INPUT -s 224.0.0.0/8 -d 0/0 -j DROP
$IPT -A INPUT -s 0/0 -d 224.0.0.0/8 -j DROP
$IPT -A OUTPUT -s 224.0.0.0/8 -d 0/0 -j DROP
$IPT -A OUTPUT -s 0/0 -d 224.0.0.0/8 -j DROP

and comment out the 4 lines

# Block Multicast Traffic
#  Some cable/DSL providers require their clients to accept multicast transmissions
#  you should remove the following four rules if you are affected by multicasting
#$IPT -A INPUT -s 224.0.0.0/8 -d 0/0 -j DROP
#$IPT -A INPUT -s 0/0 -d 224.0.0.0/8 -j DROP
#$IPT -A OUTPUT -s 224.0.0.0/8 -d 0/0 -j DROP
#$IPT -A OUTPUT -s 0/0 -d 224.0.0.0/8 -j DROP

Then restart firestarter

sudo /etc/init.d/firestarter restart

Now you should be able to resolve .local names.

sam@titania:~$ ping flute.local
PING flute.local (192.168.1.101) 56(84) bytes of data.
64 bytes from flute.local (192.168.1.101): icmp_seq=1 ttl=64 time=4.45 ms
64 bytes from flute.local (192.168.1.101): icmp_seq=2 ttl=64 time=4.16 ms

Resources

CategoryDocumentation CategoryCleanup

HowToZeroconf (last edited 2008-08-06 16:36:59 by localhost)