个人工具
登录
查看“UbuntuHelp:HowToZeroconf”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:HowToZeroconf”的源代码
来自Ubuntu中文
←
UbuntuHelp:HowToZeroconf
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/HowToZeroconf}} {{Languages|UbuntuHelp:HowToZeroconf}} [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 (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 - [http://wiki.ekiga.org/index.php/Avahi Ekiga] === Installation === ==== Ubuntu 6.10 ==== All the packages are installed by default. To turn on zeroconf edit the file <pre><nowiki> /etc/default/avahi-daemon </nowiki></pre> and change <pre><nowiki> AVAHI_DAEMON_START=0 </nowiki></pre> to <pre><nowiki> AVAHI_DAEMON_START=1 </nowiki></pre> Then reboot. You can also restart the daemon without rebooting with: <pre><nowiki> sudo /etc/init.d/avahi-daemon restart </nowiki></pre> ==== Ubuntu 7.04 ==== Just install the package <code><nowiki>avahi-daemon</nowiki></code> to allow other hosts to see this host as <code><nowiki>hostname.local.</nowiki></code> (note the trailing dot). ==== Ubuntu 6.06 and 5.10 ==== Just install the packages <code><nowiki>avahi-daemon</nowiki></code> and <code><nowiki>libnss-mdns</nowiki></code>. === MDNS === Now each computer with avahi-daemon (or mdnsresponder) installed will identify its self on the network as <pre><nowiki> hostname.local </nowiki></pre> for example, my computer flute, identifies itself as <pre><nowiki> flute.local </nowiki></pre> Now any computer on the network can use hostname.local in place of an ip address. For example you can do <pre><nowiki> ping flute.local </nowiki></pre> or <pre><nowiki> ssh flute.local </nowiki></pre> === Firewall configuration === If you are running a firewall and you are having problems like <pre><nowiki> sam@titania:~$ ping flute.local ping: unknown host flute.local </nowiki></pre> 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 <code><nowiki>/etc/firestarter/user-pre</nowiki></code> as root. You will need to chmod u+w this file to make it writable before editing. For example, <pre><nowiki> sudo -s cd /etc/firestarter chmod +w user-pre gedit user-pre </nowiki></pre> Set the contents of the file to the following <pre><nowiki> $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 </nowiki></pre> Then, save the file, make it read-only, and restart firestarter <pre><nowiki> chmod -w user-pre /etc/init.d/avahi-daemon restart </nowiki></pre> Now you should be able to resolve .local names. <pre><nowiki> 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 </nowiki></pre> 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. <pre><nowiki> <protocol name="mDns"> <!-- Protocol information guessed by Greg N <emailgregn@googlemail.com> --> <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> </nowiki></pre> === Resources === * [http://www.zeroconf.org/ Zeroconf] * [http://developer.apple.com/networking/bonjour/index.html Bonjour] * [http://0pointer.de/lennart/projects/nss-mdns/ libnss-mdns] * [http://avahi.org/ Avahi mdns responder] * [http://www.porchdogsoft.com/products/howl/ Howl mdns responder] [[category:CategoryCleanup]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:HowToZeroconf
。