UPDATE : This documentation still works, but it uses netatalk version 2 and is more complex than using version 3. Please consider using this documentation using netatalk version 3 instead.
If you backup your MacOS X 10.6 machine to a netatalk server, then you may have found that MacOS X 10.7 cannot backup to the same machine. Apparently, the major reason why it's now broken is a lack of « replay cache » which was introduced in AFP 3.3. So what you need to do is upgrade netatalk to version 2.2.x.
UPDATE : I've successfully this setup with MacOS X 10.8 and 10.9.
Let's configure a FreeBSD machine to serve as a Time Machine target for MacOS X 10.7. I'm using FreeBSD 8.2 as this is the production version. If you prefer using a Linux machine, then take a look at this blog post by Steffen L. Norgren.