- AFP and Bonjour under Linux
- Install and configure Netatalk
- Configure shared Volumes
- Install and configure Avahi
- Что такое Zeroconf и с чем его едят
- Bonjour (Zeroconf) Networking for Windows and Linux
- Overview
- New Subscription
- Bonjour (Zeroconf) Networking for Windows and Linux
- Overview
- New Subscription
- Zeroconf / Bonjour
- Installation
- Windows
- On GNU/Linux based operating systems
- Mac OSX
- Advanced information: What Zeroconf does for you
- Local domain name (mDNS)
- Link-local IPv4 addresses (IPv4LL)
- Alternatives to find the IP address of a computer on your local network
- Questions ?
AFP and Bonjour under Linux
For quite some time I use my Linux machine as a file and backup server (Mac File Server and Time Machine Volume) for all Mac’s in my network which is accessible from the Finder in Mac OS X.
We will use the following packages to implement the needed features on Linux mashine:
- The analog of the Apple Filing Protocol (AFP) in Linux is the Netatalk .
- The analog of the Bonjour in Linux is the Avahi .
Install and configure Netatalk
Netatalk is the Open Source implementation of AFP.
First we should deactivate services provided by Netatalk which are not needed.
Locate the following startup options and change them as noted below:
Configure shared Volumes
Now we have to tell the afpd daemon what volumes we want to share.
Scroll to the bottom of the document and define your shared volumes:
You can setup as many shared volumes as you wish. You can even define which users are allowed to access each share. You do this using the allow option.
On my server, I have the following setup for my external drive.
Since you’ll probably want to use your file server as a time machine backup, we can also define a volume just for that. Create a directory TimeMachine , and set it up using the following line.
Finally restart Netatalk to activate the changes:
Now we have a fully configured AFP it will not show up in the Finder sidebar on OS X, it is however reachable via Go -> Connect to Server in Finder.
Install and configure Avahi
OS X use a service called Bonjour for automatic discovery, which displays the server on your sidebar. Linux can emulate this functionality with an open source implementation of Bonjour called Avahi.
Create a xml-file for the afpd service with the following line:
Источник
Что такое Zeroconf и с чем его едят
Я, как старый линуксоид, когда впервые установил Ubuntu и увидел незнакомое слово avahi, конечно же сразу посмотрел в google. Потыкался в несколько ссылок, увидел другие непонятные слова, типа zeroconf, multicast dns, bonjour. Сразу понял, что это какая то мутная технология от Apple и нафиг мне ненужная.
Однако, с ростом локальной сети внутри моей квартиры, подумал, что неплохо бы было полюбопытствовать, как можно приспособить zeroconf, чтобы облегчить себе жизнь.
Давайте разберемся с терминологией:
- Zeroconf — это протокол, разработанный Apple и призванный решать следующие проблемы:
- выбор сетевого адреса для устройства;
- нахождение компьютеров по имени;
- обнаружение сервисов, например принтеров.
- Avahi — открытая и свободная реализация протокола zeroconf.
- Bonjour — open-source реализация протокола zeroconf от Apple.
Для назначения IP-адресов устройствам, zeroconf использует RFC 3927. Стандарт описывает назначение, так называемых link-local адресов, из диапазона 169.254.0.0/16 . Технология называется IPv4 Link-Local или IPv4LL.
Для разрешения имен (name resolving) используется протокол Multicast DNS или сокращено mDNS. Он позволяет устройству выбрать имя в зоне .local. Работает это почти как обычный DNS, но с нюансами. Каждый компьютер хранит записи своей зоны ( A , MX , SRV ) сам и сам же обслуживает запросы к ним. Когда какой либо компьютер хочет узнать запись зоны, скажем определить IP-адрес по имени (получить запись A для заданной зоны), он обращается по multicast-адресу 224.0.0.251 . Соответственно, запрос получают все компьютеры в локальной сети, а отвечает тот, кто хранит зону для интересующего нас имени.
Для поиска и обнаружения сервисов используется протокол DNS based Service Discovery или DNS-SD. Для того, чтобы прорекламировать, какие сервисы доступны на устройстве, используются DNS-записи типа SRV , TXT , PTR .
Как все это заставить работать на Linux? Гораздо проще, чем кажется. Разберем по шагам:
- Поставить пакеты avahi-daemon , avahi-autoipd , libnss-mdns . Если у вас стоит Ubuntu, то скорее всего эти пакеты уже установлены.
- Включить IPv4LL. Этот шаг совершенно не обязателен. Если у вас есть любой IP-адрес, который нормально маршрутизируется в локальной сети, то использовать IPv4LL не нужно и даже вредно, так как по стандарту, маршрутизатуры не должны форвардить пакеты с link-local адресами ( 169.254.* ). Иными словами, пробросить интернет через NAT скорее всего не удастся (мне не удалось). Но если вы уж решились, то достаточно для сетевого интерфейса локальной сети, в файле /etc/network/interfaces поставить тип ipv4ll . Что-то типа такого:
Далее можно сделать sudo invoke-rc.d networking restart или даже перезагрузиться ( avahi-autoipd не будет устанавливать на интерфейсе адрес 169.254.* , если там уже есть другой IP-адрес, а он после sudo invoke-rc.d networking restart скорее всего никуда не исчезнет).
На этом настройку можно считать завершенной. Какие бонусы после этого вы получите? Перечисляю: все компьютеры получат имена в домене *.local, без лишних телодвижений с вашей стороны; jabber-клиенты Gajim или Empathy будут показывать всех собеседников в локальной сети; Rhythmbox будет расшаривать всю музыку; Ekiga позволит находить и звонить всем, у кого она запущена в локалке; PulseAudio сможет находить все опубликованные звуковые устройства в сети; ну и многое, многое другое. Вы можете ознакомится со списком программ, поддерживающих avahi.
Источник
Bonjour (Zeroconf) Networking for Windows and Linux
Overview
New Subscription
Please sign in to subscribe to this guide.
You will be redirected back to this guide once you sign in, and can then subscribe to this guide.
Zeroconf (aka Bonjour, very rarely Rendezvous) is a group of technologies to “automagically” discover systems and services on a local area network.
With the proliferation of embedded, networked Raspberry Pi projects, it can be a chore to keep track of numeric IP addresses for each. Dynamically-assigned addresses (via DHCP) can further confuse the issue.
Zeroconf helps by assigning the system a name (e.g. raspberrypi.local instead of 192.168.0.42). It can then be easily accessed from other computers on the local network…provided they’re also running Zeroconf! It’s needed at both ends.
Here’s how to set that up…
Nothing to be done. Support for Bonjour/Zeroconf is already baked in!
This includes systems running the application (e.g. OctoPrint or Cupcade) as well as other Linux systems accessing those applications (or for remote administration).
Zeroconf is provided through an optional package called Avahi. It’s super easy to install from the command line:
This takes about five minutes. Once installed, the system can be contacted from other computers at hostname.local, where hostname is either the default (raspberrypi) or an alternate name assigned in the Advanced menu of raspi-config. If the SSH server is enabled (also via the Advanced menu), remote login is possible via ssh, and files can be transferred to and from the system using sftp or scp.
If the system will be sharing a network with any Mac computers, I like to install Netatalk:
This adds support for Apple Filing Protocol, making it easy to move files back and forth in the Finder. The system will be listed in the Finder sidebar if “Bonjour computers” is enabled in the Sidebar preferences. Otherwise use the “Connect to Server…” option under the Go menu. In either case, you’ll need to provide your name and password (e.g. “pi” and “raspberry” by default, not your Mac credentials).
Windows doesn’t have Zeroconf support out of the box, but a few popular applications slip it in for their own needs, including Skype, Apple’s iTunes and Adobe Photoshop CS3 or later. So you might not need to add anything at all!
Otherwise, it’s most easily installed using Bonjour Print Services for Windows 2.0.2.
The newest-and-shiniest version 3.0 is only available in the iTunes installer. So one option is to simply install iTunes, even if you don’t plan to use it.
Some users are understandably reluctant to install unneeded software. In that case, Bonjour 3 can still be installed with a little trick: download the iTunes installer but don’t run it. Using an archive utility like 7-Zip or WinRAR, you’ll discover there’s a separate Bonjour installer inside. Just extract and run that one piece, and you’re done!
Once installed, Zeroconf systems on the local network can then be accessed by name instead of numbers…in a web browser, for example, one might reach a Raspberry Pi hosting OctoPrint at http://octopi.local
This guide was first published on Sep 13, 2014. It was last updated on Sep 13, 2014.
This page (Overview) was last updated on Oct 09, 2021.
Источник
Bonjour (Zeroconf) Networking for Windows and Linux
Overview
New Subscription
Please sign in to subscribe to this guide.
You will be redirected back to this guide once you sign in, and can then subscribe to this guide.
Zeroconf (aka Bonjour, very rarely Rendezvous) is a group of technologies to “automagically” discover systems and services on a local area network.
With the proliferation of embedded, networked Raspberry Pi projects, it can be a chore to keep track of numeric IP addresses for each. Dynamically-assigned addresses (via DHCP) can further confuse the issue.
Zeroconf helps by assigning the system a name (e.g. raspberrypi.local instead of 192.168.0.42). It can then be easily accessed from other computers on the local network…provided they’re also running Zeroconf! It’s needed at both ends.
Here’s how to set that up…
Nothing to be done. Support for Bonjour/Zeroconf is already baked in!
This includes systems running the application (e.g. OctoPrint or Cupcade) as well as other Linux systems accessing those applications (or for remote administration).
Zeroconf is provided through an optional package called Avahi. It’s super easy to install from the command line:
This takes about five minutes. Once installed, the system can be contacted from other computers at hostname.local, where hostname is either the default (raspberrypi) or an alternate name assigned in the Advanced menu of raspi-config. If the SSH server is enabled (also via the Advanced menu), remote login is possible via ssh, and files can be transferred to and from the system using sftp or scp.
If the system will be sharing a network with any Mac computers, I like to install Netatalk:
This adds support for Apple Filing Protocol, making it easy to move files back and forth in the Finder. The system will be listed in the Finder sidebar if “Bonjour computers” is enabled in the Sidebar preferences. Otherwise use the “Connect to Server…” option under the Go menu. In either case, you’ll need to provide your name and password (e.g. “pi” and “raspberry” by default, not your Mac credentials).
Windows doesn’t have Zeroconf support out of the box, but a few popular applications slip it in for their own needs, including Skype, Apple’s iTunes and Adobe Photoshop CS3 or later. So you might not need to add anything at all!
Otherwise, it’s most easily installed using Bonjour Print Services for Windows 2.0.2.
The newest-and-shiniest version 3.0 is only available in the iTunes installer. So one option is to simply install iTunes, even if you don’t plan to use it.
Some users are understandably reluctant to install unneeded software. In that case, Bonjour 3 can still be installed with a little trick: download the iTunes installer but don’t run it. Using an archive utility like 7-Zip or WinRAR, you’ll discover there’s a separate Bonjour installer inside. Just extract and run that one piece, and you’re done!
Once installed, Zeroconf systems on the local network can then be accessed by name instead of numbers…in a web browser, for example, one might reach a Raspberry Pi hosting OctoPrint at http://octopi.local
This guide was first published on Sep 13, 2014. It was last updated on Sep 13, 2014.
This page (Overview) was last updated on Oct 09, 2021.
Источник
Zeroconf / Bonjour
Zeroconf also called Bonjour (name of Apple implementation) or Avahi (name of Linux implementation), is a set of technologies that allow more easily communication between computers without configuration.
- It makes able to reach the robot on your local network without having to know its IP address
- It makes able to connect the robot to your computer directly with an Ethernet wire without using a router, and without a DHCP server.
Zeroconf is not mandatory on your computer to use Poppy robots, but it is strongly recommended, and the documentation will assume it is installed. Otherwise replace all poppy.local occurrences by the IP address of the robot given by your router.
Installation
Windows
You have to install Bonjour print services for Windows (yes, it is an Apple software).
If you already have installed an Apple Software like iTunes or QuickTime, Bonjour should be installed.
Times to times, even if Bonjour is already installed on your computer you can’t connect directly to your Ergo Jr. To solve the issue, un-install and re-install Bonjour.
On GNU/Linux based operating systems
On GNU/Linux, you have to install avahi-daemon (mDNS) and avahi-autoipd (IPv4LL), it may or may not be installed by default depending on your installation.
On Ubuntu/Debian, run
On Fedora / CentOS, run
To connect to your robot directly with an Ethernet wire, you need to select local link only on the IPv4 configuration of your Network manager.
Mac OSX
Bonjour is already installed with OSX. Moreover, if you plan to connect your computer directly to the robot (without a router), use a Thunderbolt to Ethernet adapter rather than a USB to Ethernet
Advanced information: What Zeroconf does for you
Local domain name (mDNS)
Zeroconf client publishes a decentralized local domain name (mDNS) with the ‘.local’ top level domain. It means that you can join any local local computer by its hostname with the ‘.local’ suffix instead of its IP address.
With a zeroconf client, to ping a computer called (hostname) ‘ergojr’, you can simply do:
You no longer need to look for its IP address on your local network; you don’t even need to understand what an IP address is.
It also work on your web browser. To open the website hosted on the robot computer called ‘ergojr’, you have to open: http://ergojr.local on your favorite web browser URL field.
Link-local IPv4 addresses (IPv4LL)
Among other Zeroconf tools, there is an implementation of decentralized DHCP (IPv4LL), which allow computers obtain an IP and connect each others without a DHCP server.
The auto-adressed IP is in the APIPA range, from 169.254.0.0 to 169.254.255.255.
This is why you may see thiese unusual IP addressses when connecting your robot to your computer. Whereas, in presence of a DHCP server, IP addresses of computers and robots are from 10.0.0.0 to 10.255.255.255 or 172.16.0.0 to 172.31.255.255 or, more frequently, 192.168.0.0 to 192.168.255.255. You might observe that, if you enable the internal hotspot of Poppy, addresses are from 10.0.0.0 to 10.255.255.255.
This way, it is possible to connect your robot directly to your computer with a single Ethernet cable because no intermediary device like a router or any DHCP server is needed to provide the IP addresses, they are self-assigned.
Alternatives to find the IP address of a computer on your local network
If you cannot (or doesn’t want to) install a zeroconf client on your personal computer, you can use one of the following methods to find the IP address of your robot.
- You can use Fing, famous for its Android and iOS applications
- If you are connected in Wifi through a smartphone via its accept point feature (Android or iOS), most access points display a list of connected clients as well as their associated IP address
- Nmap or arp(only GNU/Linux and MAC OSX) if you are not afraid of command line interfaces.
- You can also go to your router web interface (with its IP address on your web browser like http://192.168.0.1 or http://192.168.1.1 or http://192.168.0.254 or http://192.168.1.254), you should have a section of connected hosts.
Questions ?
We’re always happy to help with code or other questions you might have! You can ask questions and share solutions on our community Forum.
Источник