Share Directories using AFP

Preamble
Some of the information on this wiki page is outdated and only valid for netatalk 2.2.x. Starting with netatalk 3.0.x, volume shares are no longer defined in AppleVolumes.default but in afpd.conf and the syntax has changed significantly. See http://netatalk.sourceforge.net/3.0/htmldocs/upgrade.html for details.

Purpose
This tutorial will describe how to get a AFP share up and running on a Gentoo box, so a Mac client can mount the share.

Scope
This only covers how to use AFP over TCP, so AFP over AppleTalk is not covered.

Linux Server set-up

 * as of netatalk 2.2.1-r1, netatalk.conf doesn't exist. uses separate afpd.conf and cnid_metad.conf.
 * /etc/init.d/atalk has become /etc/init.d/afpd

afpd.conf
This is the configuration of the AFP daemon. The default config works fine.

AppleVolumes.default
This file describes the network volumes shown on the Mac.

'htpc' and 'mobby' are users names both existing on the local server and on the apple client.

Advertising the fileshare via Avahi
Avahi is software that implements the Zeroconf networking standard, so your file shares will show up automatically in the Mac client's Finder.

Troubleshooting
For Avahi to work properly, make sure CONFIG_IP_MULTICAST=y is enabled in the kernel configuration. It is located under Networking Support/Networking Options/TCP IP Networking.

You need Avahi before you use netatalk. Make sure you have the "avahi" and "dbus" USE flags set, and emerge Avahi if you don't already have it.

Your network device must be in "promiscuous mode" for Zeroconf to work (No it doesn't multicast works without promiscuous). Issue the following command and edit these lines in the sysctl config file.

Mount the shared volume
Click on Finder, select Go / Connect to Server from the menu. Enter afp:// /. You should be ready to go.