• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

AFP from a Synology NAS

ironborn65

Well-known member
Hi pals,

I have something that can be useful to other and some questions at the end.

I was struggling installing Netatalk as a docker container in my NAS 218+ when I noticed the error "port 548 already in use" .."WHAT???".
I then recall an AFP flag in the "File Services". When I installed it a couple of years ago it was meaningless to me...

1681457508728.png

I configures a "mac" user in the NAS and I opened my OS 9.2.2 virtualised in UTM and typing the IP address of the NAS ...

1681457890526.png

.. It worked!

I then installed OT 1.1.2 + AppleShare Client 3.7.4 (thanks to www.savagetaylor.com) in my SE/40 system 7.5.5 equipped with a NIC card and from the Chooser typing the IP address I was able to connect.
From the SE/40, I can browse, get and put files in the shared folder: amazing! This can be handy for anyone with a suitable Synology NAS.

One weird thing is that files' size shown in the Finder are wrong, it's mostly 158MB for almost every file with some exception, even if they are of a few Kbytes. When copied locally they are just fine, it a known issue? Any way to solve it? i believe the file system used in shared folded in the NAS does not support resource fork and files must remain sit or binhex, not a big deal.

Any advice for a better configuration and other features for my networked Macs? E.g. since the SE/40 is running a 68040, would it be convenient to install a 040 compiled network libraries?

As a next step I'd like to network my non-NIC-card-equipped Macs. For this I have an Asante LocalTalk/Ethernet bridge and a set of LocalTalk boxes + serial cables. In addition also a couple of AirTalk from @cheesestraws .
From the LocalTalk of the macs I should see the share folder? Is it?
How is server discovery supposed to work in this case? because there will be no IP to type in the Chooser since it's plain AppleTalk over LocalTalk.
 

robin-fo

Well-known member
The AFP server in your NAS probably doesn’t speak AppleTalk, so LocalTalk (which only supports AppleTalk/DDP packets) will block any IP traffic. You could try a MacIP gateway though..
 

ironborn65

Well-known member
thanks pal, it's not my comfort zone here so I might be wrong but ... sure thing the NAS speaks only TCP/IP but it might supports EtherTalk which is LocalTalk over Ethernet. The Asante can do the magic by converting AppleTalk on Ethernet <--> AppleTalk on LocalTalk.
If the AFP implementation on the NAS does not support EtherTalk I could install a Ethernet to LocalTalk gateway in a Mac with both connections, but I want to avoid a physical Mac for this purpose and rely on a virtualised environment, either docker or VM.
 

robin-fo

Well-known member
You should try to find out if you NAS runs Netatalk 2 or Netatalk 3 (3 is more likely)

If Netatalk 2:
Find out if it is compiled with AppleTalk (DDP) support
If this is true, you’re very lucky! You can try with a LocalTalk bridge (Asante etc.. or vintage Mac). Your AFP share will be supported by almost all Macs and will show up in Chooser.

If Netatalk 3 or Netatalk 2 without AppleTalk support:
You need a MacIP gateway (probably runs inside Docker). This encapsulates IP packets inside AppleTalk (DDP) packets. Using a LocalTalk bridge (Asante etc.. or vintage Mac), those encapsulated packets can now be safely carried over LocalTalk. *However* they will not be the same as proper AFP over DDP packets. You will need to setup TCP/IP on your client Mac and have an AppleShare Client version which supports AFP over IP packets. Your NAS will NOT show up in Chooser and you will need to enter its IP address to connect.

I‘ve never tried this.. Please forgive me if it doesn‘t work 😅

There is no way I am currently aware of which allows to convert „AFP over IP“ into pure „AFP over DDP“ packets.

Hint: Use only a wired Ethernet connection between NAS (or MacIP gateway) and your LocalTalk bridge. If the latter is a device from Asanté or Farallon, you might need to connect it to a (forced) Half-duplex 10baseT Ethernet link!

Background information:
AFP (AppleShare) can be implemented upon arbitrary low level networking protocols. Originally, the AppleTalk stack was used. It was encapsulated like this:

AFP (Apple Filing Protocol)
ASP (AppleTalk Session Protocol)
ATP (AppleTalk Transaction Protocol)
DDP (Datagram Delivery Protocol)
LocalTalk or EtherTalk/Ethernet

Later, support for the Internet Protocol (TCP/IP) was added:

AFP (Apple Filing Protocol)
DSI (Data Stream Interface)
TCP
IP
Ethernet

Edit:
If you have Netatalk 3, chances are very small that you can connect from a vintage Mac in any case if it runs something earlier than maybe Mac OS 9. I‘ll have to investigate…
 

ironborn65

Well-known member
DSM uses Netatalk-3.1.12.
AFP protocol version supported: 2.2 3.0 3.1 3.2 3.3 3.4
Open-source Netatalk removed AppleTalk since Netatalk-3.0. Therefore, DSM does not support DDP.

I'll disable AFP from the NAS and install MacIPgw
 

slipperygrey

Well-known member
DSM uses Netatalk-3.1.12.
AFP protocol version supported: 2.2 3.0 3.1 3.2 3.3 3.4
Open-source Netatalk removed AppleTalk since Netatalk-3.0. Therefore, DSM does not support DDP.

I'll disable AFP from the NAS and install MacIPgw
When you say MacIPgw, I assume you refer to MacIPgw-VM from macip.net? It's a pet peeve of mine, but macipgw itself is an open source MacIP bridge implementation, and doesn't come with AppleShare capabilities itself. The creator of macip.net (who is part of this community) took macipgw and helpfully bundled it with Netatalk in a range of distributions. The unfortunately generic naming of the macip.net distributions makes it hard to talk about this with clarity.

Anyhow, I wouldn't recommend macip.net distributions for Netatalk right now, since they use a very old version of Netatalk with known bugs and security holes. I suggest you set up a Linux or *BSD server to run Netatalk 2.2.8 instead. We're also preparing to release Netatalk 2.2.9 shortly with additional bugfixes and security patches. (Poke @mactjaap with a reminder to get macip.net distributions updated!)

BTW, the Wikipedia article for Netatalk has a long list of NAS solutions that use Netatalk as AFP server.
 

slipperygrey

Well-known member
One weird thing is that files' size shown in the Finder are wrong, it's mostly 158MB for almost every file with some exception, even if they are of a few Kbytes. When copied locally they are just fine, it a known issue? Any way to solve it? i believe the file system used in shared folded in the NAS does not support resource fork and files must remain sit or binhex, not a big deal.
I've seen this bug happen with Netatalk and System 7.x machines. If it persists after upgrading to the latest netatalk2 or netatalk3 version, please raise an issue ticket with the github project.

Any advice for a better configuration and other features for my networked Macs? E.g. since the SE/40 is running a 68040, would it be convenient to install a 040 compiled network libraries?

As a next step I'd like to network my non-NIC-card-equipped Macs. For this I have an Asante LocalTalk/Ethernet bridge and a set of LocalTalk boxes + serial cables. In addition also a couple of AirTalk from @cheesestraws .
From the LocalTalk of the macs I should see the share folder? Is it?
How is server discovery supposed to work in this case? because there will be no IP to type in the Chooser since it's plain AppleTalk over LocalTalk.
If you use netatalk2, service discovery is automatic via the NBP protocol (a feature of AppleTalk.)

If the Mac is running at least System 7.1, you can also make it AFP over TCP capable by installing a later AppleShare Client. I did a write-up about this on the piscsi wiki.
 

Green78II

Well-known member
I use Fetch for FTP on my Beige G3 (with a 10/100 Ethernet card) running OS9 Connecting to a Synology RS819. Works fine for accessing my backups! for security reasons, I created an account on the NAS that can only access the classic Mac shares, just in case somehow those credentials were hijacked, that account can't access anything sensitive like my main machine backups.
 

ironborn65

Well-known member
@Green78II I'm successfully using FTP from the NAS for my legacy Macs as well, still I want to explore now AppleTalk and to share folders so keeping resource and data forks intact.

@slipperygrey if I got it right, my roadmap is to install Netatalk 2.2.8 in some host in my LAN, so to have AFP over DDP and auto-discovery with NDP.
With my Asante bridge I can then offer TCP/IP to my LocalTalk only Macs installing either MacTCP or OT. For the Mac not TCP capable I could use a Mac as bridge installing Apple IP Gateway to show the the share folder in Netatalk. Is it?
thanks
 

Danamania

Official 68k Muse
The file size issue on earlier system versions is a volume issue. Back when I had a smaller volume on my NAS it was less of a problem. Once I added another drive and brought the pool to 12TB, it really started getting ridiculous.

Still works, though, for everything down to 7.1 - except 7.1 doesn't believe it can write more than one file at a time to the NAS before a space remaining bug is triggered and it thinks there's no room left for files :)

Also, as it's an AFP share the NAS's own filesystem doesn't matter - forks are preserved happily, whether from OSX (Catalina here) or down to 7.1.
 

slipperygrey

Well-known member
@slipperygrey if I got it right, my roadmap is to install Netatalk 2.2.8 in some host in my LAN, so to have AFP over DDP and auto-discovery with NDP.
With my Asante bridge I can then offer TCP/IP to my LocalTalk only Macs installing either MacTCP or OT. For the Mac not TCP capable I could use a Mac as bridge installing Apple IP Gateway to show the the share folder in Netatalk. Is it?
thanks
Yes, this sounds about right to me! Any Mac on a bridged LocalTalk network should be able to see all DDP services including Netatalk's on the broader LAN.

What Mac do you have that is not TCP capable -- 128k or 512k?
 

slipperygrey

Well-known member
The file size issue on earlier system versions is a volume issue. Back when I had a smaller volume on my NAS it was less of a problem. Once I added another drive and brought the pool to 12TB, it really started getting ridiculous.

Still works, though, for everything down to 7.1 - except 7.1 doesn't believe it can write more than one file at a time to the NAS before a space remaining bug is triggered and it thinks there's no room left for files :)

Also, as it's an AFP share the NAS's own filesystem doesn't matter - forks are preserved happily, whether from OSX (Catalina here) or down to 7.1.
My theory is that older versions of the AppleShare Client assumed that volumes were max 2GB in size (the limit of HFS). So it ends up miscalculating file sizes on larger volumes.

Netatalk 2 actually has an option option:limitsize that limits volume size reporting to 2GB. See https://netatalk.sourceforge.io/2.2/htmldocs/AppleVolumes.default.5.html

That option is gone in Netatalk 3 I think.
 
Last edited:

Danamania

Official 68k Muse
Aye, I want to add a tiny gigabyte or two pool on the NAS, absolutely isolated so it just appears as a small share to swap files on 7.1 machines conveniently. At the moment I've been working around that by sharing my permanently set up and turned on Q605's 4GB drive, and ultimately that's the same thing. A separate small share to swap files, so I'm not in any rush to modify the Syno!
 

ironborn65

Well-known member
I'm going to create a docker container for Netatalk 2.2.8 and in case to make it available here, but apt for Debian only supports Netatalk v 3.1.12.
I might sound lazy, but I want to avoid the compile it and I'm struggling to find a binary for v-2.2.8: my base for docker file is going to be Debian.

Would be useful if the Netatalk github project had a binary folder from where to download the binaries for the docker file builder?
Supporting Ubuntu and Debian would be just enough
 

NJRoadfan

Well-known member
There won't be binaries or DEB packages of 2.2.8 out there. All the major distros long switched to 3.x. Compiling netatalk isn't difficult, it's getting the Docker container setup and handling DDP AppleTalk (most everything is geared toward TCP/IP these days).
 

slipperygrey

Well-known member
I'm going to create a docker container for Netatalk 2.2.8 and in case to make it available here, but apt for Debian only supports Netatalk v 3.1.12.
I might sound lazy, but I want to avoid the compile it and I'm struggling to find a binary for v-2.2.8: my base for docker file is going to be Debian.

Would be useful if the Netatalk github project had a binary folder from where to download the binaries for the docker file builder?
Supporting Ubuntu and Debian would be just enough
I've been gently lobbying the current netatalk deb package manager to create an official netatalk2 deb, offering my assistance. Progress is slow due to IRL commitments. The Debian Bug is here if you want to track the progress.
 

ironborn65

Well-known member
@slipperygrey thanks dude, much appreciated, hurry is not a thing in here.
BTW, I've asked Synology support to update their DSM package to support the latest Netatalk v3
 

slipperygrey

Well-known member
@slipperygrey thanks dude, much appreciated, hurry is not a thing in here.
BTW, I've asked Synology support to update their DSM package to support the latest Netatalk v3
The Synology folks contribute netatalk3 security patches every now and then so they should be aware of recent progress. In fact, they may be waiting for the upcoming 3.1.15 release that will include two security patches, before pushing any new package. I've been charged with the release management of said release... I'll try to get to it before the end of the week. :whistle:
 
Top