特殊:Badtitle/NS100:HowToZeroconf:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第12行: | 第12行: | ||
* Sharing music - Rhythmbox, Banshee, iTunes | * Sharing music - Rhythmbox, Banshee, iTunes | ||
* Sharing files - gShare | * Sharing files - gShare | ||
* Automatic discovery of VoIP clients in your local network - [http://wiki.ekiga.org/index.php/Avahi Ekiga] | * Automatic discovery of [[UbuntuHelp:VoIP|VoIP]] clients in your local network - [http://wiki.ekiga.org/index.php/Avahi Ekiga] | ||
=== Installation === | === Installation === | ||
==== Ubuntu 9.04 (Jaunty Jackalope) ==== | ==== Ubuntu 9.04 (Jaunty Jackalope) ==== |
2009年5月18日 (一) 16:14的版本
![]() |
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/HowToZeroconf }} |
![]() |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/af | • {{#if: UbuntuHelp:HowToZeroconf|Afrikaans| [[::HowToZeroconf/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ar | • {{#if: UbuntuHelp:HowToZeroconf|العربية| [[::HowToZeroconf/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/az | • {{#if: UbuntuHelp:HowToZeroconf|azərbaycanca| [[::HowToZeroconf/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/bcc | • {{#if: UbuntuHelp:HowToZeroconf|جهلسری بلوچی| [[::HowToZeroconf/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/bg | • {{#if: UbuntuHelp:HowToZeroconf|български| [[::HowToZeroconf/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/br | • {{#if: UbuntuHelp:HowToZeroconf|brezhoneg| [[::HowToZeroconf/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ca | • {{#if: UbuntuHelp:HowToZeroconf|català| [[::HowToZeroconf/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/cs | • {{#if: UbuntuHelp:HowToZeroconf|čeština| [[::HowToZeroconf/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/de | • {{#if: UbuntuHelp:HowToZeroconf|Deutsch| [[::HowToZeroconf/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/el | • {{#if: UbuntuHelp:HowToZeroconf|Ελληνικά| [[::HowToZeroconf/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/es | • {{#if: UbuntuHelp:HowToZeroconf|español| [[::HowToZeroconf/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/fa | • {{#if: UbuntuHelp:HowToZeroconf|فارسی| [[::HowToZeroconf/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/fi | • {{#if: UbuntuHelp:HowToZeroconf|suomi| [[::HowToZeroconf/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/fr | • {{#if: UbuntuHelp:HowToZeroconf|français| [[::HowToZeroconf/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/gu | • {{#if: UbuntuHelp:HowToZeroconf|ગુજરાતી| [[::HowToZeroconf/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/he | • {{#if: UbuntuHelp:HowToZeroconf|עברית| [[::HowToZeroconf/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/hu | • {{#if: UbuntuHelp:HowToZeroconf|magyar| [[::HowToZeroconf/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/id | • {{#if: UbuntuHelp:HowToZeroconf|Bahasa Indonesia| [[::HowToZeroconf/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/it | • {{#if: UbuntuHelp:HowToZeroconf|italiano| [[::HowToZeroconf/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ja | • {{#if: UbuntuHelp:HowToZeroconf|日本語| [[::HowToZeroconf/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ko | • {{#if: UbuntuHelp:HowToZeroconf|한국어| [[::HowToZeroconf/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ksh | • {{#if: UbuntuHelp:HowToZeroconf|Ripoarisch| [[::HowToZeroconf/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/mr | • {{#if: UbuntuHelp:HowToZeroconf|मराठी| [[::HowToZeroconf/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ms | • {{#if: UbuntuHelp:HowToZeroconf|Bahasa Melayu| [[::HowToZeroconf/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/nl | • {{#if: UbuntuHelp:HowToZeroconf|Nederlands| [[::HowToZeroconf/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/no | • {{#if: UbuntuHelp:HowToZeroconf|norsk| [[::HowToZeroconf/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/oc | • {{#if: UbuntuHelp:HowToZeroconf|occitan| [[::HowToZeroconf/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/pl | • {{#if: UbuntuHelp:HowToZeroconf|polski| [[::HowToZeroconf/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/pt | • {{#if: UbuntuHelp:HowToZeroconf|português| [[::HowToZeroconf/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ro | • {{#if: UbuntuHelp:HowToZeroconf|română| [[::HowToZeroconf/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/ru | • {{#if: UbuntuHelp:HowToZeroconf|русский| [[::HowToZeroconf/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/si | • {{#if: UbuntuHelp:HowToZeroconf|සිංහල| [[::HowToZeroconf/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/sq | • {{#if: UbuntuHelp:HowToZeroconf|shqip| [[::HowToZeroconf/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/sr | • {{#if: UbuntuHelp:HowToZeroconf|српски / srpski| [[::HowToZeroconf/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/sv | • {{#if: UbuntuHelp:HowToZeroconf|svenska| [[::HowToZeroconf/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/th | • {{#if: UbuntuHelp:HowToZeroconf|ไทย| [[::HowToZeroconf/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/tr | • {{#if: UbuntuHelp:HowToZeroconf|Türkçe| [[::HowToZeroconf/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/vi | • {{#if: UbuntuHelp:HowToZeroconf|Tiếng Việt| [[::HowToZeroconf/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/yue | • {{#if: UbuntuHelp:HowToZeroconf|粵語| [[::HowToZeroconf/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/zh | • {{#if: UbuntuHelp:HowToZeroconf|中文| [[::HowToZeroconf/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/zh-hans | • {{#if: UbuntuHelp:HowToZeroconf|中文(简体)| [[::HowToZeroconf/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:HowToZeroconf | UbuntuHelp:HowToZeroconf | {{#if: | :}}HowToZeroconf}}/zh-hant | • {{#if: UbuntuHelp:HowToZeroconf|中文(繁體)| [[::HowToZeroconf/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:HowToZeroconf|:HowToZeroconf|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :HowToZeroconf/zh | | {{#ifexist: HowToZeroconf/zh | | {{#ifeq: {{#titleparts:HowToZeroconf|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:HowToZeroconf|1|-1|}} | zh | | }}
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 (Multicast DNS) 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. It can currently be used for
- Sharing music - Rhythmbox, Banshee, iTunes
- Sharing files - gShare
- Automatic discovery of VoIP clients in your local network - Ekiga
Installation
Ubuntu 9.04 (Jaunty Jackalope)
Zeroconf is installed and configured by default in the Desktop version of Ubuntu 9.04. The following steps can be used for testing:
- Open Terminal and deduce the local host name from the prompt (e.g., myuser@myhost:~$)
- Go to System > Preferences > Remote Desktop. Check the first two boxes under Sharing and configure the Security settings as desired.
- From another computer, launch a VNC client and enter myhost.local as the host name, replacing the "myhost" portion with the host name deduced from step 1 above.
- Assuming the remote Ubuntu computer responded to the VNC connection request, then Zeroconf is properly resolving the local host name.
Ubuntu 7.04
Just install the package avahi-daemon
to allow other hosts to see this host as hostname.local.
(note the trailing dot).
Ubuntu 6.10
All the packages are installed by default. To turn on zeroconf edit the file
/etc/default/avahi-daemon
and change
AVAHI_DAEMON_START=0
to
AVAHI_DAEMON_START=1
Then reboot. You can also restart the daemon without rebooting with:
sudo /etc/init.d/avahi-daemon restart
Ubuntu 6.06 and 5.10
Just install the packages avahi-daemon
and libnss-mdns
.
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
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.
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/user-pre
as root. You will need to chmod u+w this file to make it writable before editing. For example,
sudo -s cd /etc/firestarter chmod +w user-pre gedit user-pre
Set the contents of the file to the following
$IPT -A INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT $IPT -A OUTPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
Then, save the file, make it read-only, and restart firestarter
chmod -w user-pre /etc/init.d/avahi-daemon 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
If you are using [Guarddog] as a firewall, you'll need to create a new zone for multicast traffic and add an entry to the networkprotocoldb.xml file. Call the new zone "multicast" and set it's Zone Addresses to 224.0.0.0/255.0.0.0 Add the XML below into /usr/share/apps/guarddog/networkprotocoldb.xml just above where it says "<protocol name="domain">". Restart [Guarddog] & then check the boxes to allow mDns traffic between your zones.
<protocol name="mDns"> <!-- Protocol information guessed by Greg N <[email protected]> --> <longname>mDns,Bonjour,Avahi,ZeroConf</longname> <longname lang="nl">mDns</longname> <longname lang="fr">mDns</longname> <longname lang="it">mDns</longname> <longname lang="es">mDns</longname> <description>Protocols to allow networks to configure themselves. It is called Bonjour (formerly Rendezvous) by Apple, and used extensively on Mac OS X. </description> <classification class="net"/> <network> <udp source="server" dest="client"> <source><port portnum="nonprivileged"/></source> <dest><port portnum="5353"/></dest> </udp> <udp source="client" dest="server"> <source><port portnum="5353"/></source> <dest><port portnum="nonprivileged"/></dest> </udp> </network> <security threat="medium" falsepos="low"/> </protocol>