Subject: Re: Problems getting AFP to autoswitch protocols

From: Robert Thiemann <[email-masked]>
Date: Thu, 7 Feb 2002 15:56:26 -0500

>What is the first entry in your /etc/hosts? If this is set to 127.0.0.1 and
>localhost, then try to move the entry with the right interface's ip address
>to the top, eg. '128.172.20.38  my.netatalk.server'

Actually, all that was in it was 127.0.0.1. Since we're not running 
DNS, and I'm not comfortable making changes to that file yet, I'm 
leaving it for now.

>  > "ADC_Admin" -ipaddr 128.172.20.38 -transall -uamlist
>>  uams_clrtxt.so,uams_dhx.so -nosavepassword
>
>Hmm. I always thought, supplying a correct ip address in afpd.conf will fix
>the issue. Are you sure that with this line enabled and afpd restartet
>things still won't work? Did you trash the AppleShare prefs on the macs from
>which you try to connect?

Yeah, it did. I had fought with netatalk most of last week trying to 
get it configured  (if there's something that needs docs, this does), 
and hadn't tried the -ipaddr switch. I did it, and now it works.

Cool.

-- 
Robert Thiemann
Network Engineer
VCU Adcenter
[email-masked]

---

From: Steve Freitas <[email-masked]>
Date: Thu, 07 Feb 2002 15:18:56 -0800

Robert,

You need to set the line in /etc/hosts to match the AppleShare name of the
server. So if your netatalk.conf contains this...

ATALK_NAME=Jeeves

And your server is on IP 1.2.3.4, then you'd want this line at the top of
/etc/hosts...

1.2.3.4 Jeeves

That should solve it. It's not a DNS issue, exactly. What's happening is
that the AppleShare Client first contacts the fileserver by AppleTalk, and
asks it for its IP. Netatalk responds by looking in /etc/hosts to see what
IP it should report. If it finds nothing, it reverts to AppleTalk.

Steve

> From: Robert Thiemann <[email-masked]>
> Date: Thu, 7 Feb 2002 15:56:26 -0500
> To: [email-masked]
> Subject: Re: Problems getting AFP to autoswitch protocols
> Resent-From: [email-masked]
> Resent-Date: Thu, 7 Feb 2002 15:58:30 -0500 (EST)
>

---

From: Thomas Kaiser <[email-masked]>
Date: Fri, 08 Feb 2002 11:16:50 +0100

On Thu, 07 Feb 2002 15:18:56 -0800, Steve Freitas wrote:

[FPGetSrvrInfo request]
> Netatalk responds by looking in /etc/hosts to see what IP it should report.

No, that's definitely not true.

On my SuSE installations the only entry in /etc/hosts is localhost and the
protocol switch works flawlessly. So it might be true for RedHat systems but
not for linux in general or all the other OSes, netatalk runs on? As Sak
explained here on this list a year ago, netatalk tries to get the
interface's address by a 'gethostbyname' call. This will result on some
systems in the localhost address. On other systems it will result in a
correct address. 

Sak's detailled explanation can be found here:
<http://www.umich.edu/~rsug/netatalk/archive/admins/2001/0016.html>

> If it finds nothing, it reverts to AppleTalk.

Not true either. It's the client's choice, which protocol to use, not the
server's. (<ftp://terminator.rsug.itd.umich.edu/unix/netatalk/archive/netata
lk-admins-mail/1880.html>)

As I said before (because there is also another side effect with generating
the server signature, which can confuse macs when there is more than one afp
server) it would the best to propagate the -ipaddr switch in afpd.conf as
the correct solution. Maybe we can add a small README about the protocol
switch issue and point to it from within the comments in afpd.conf, since
this confuses many users?

Regards,

Thomas

---

From: Damien MATTEI <[email-masked]>
Date: Fri, 08 Feb 2002 12:44:33 +0100

> > and hadn't tried the -ipaddr switch. I did it, and now it works.

i'am running netatalk 1.5pre2-6 on linure redhat 7.2 ,
and i confirm that there is _NO_ need to put the interface IP on the top
of /etc/hosts as i have first my loopback and after my ethernet IP.
i didn't set my IP in afpd.conf too and it works well.

-- 
MATTEI Damien					Phone: +33 (0)4 93 37 76 66
C.N.R.S / U.N.S.A				Fax:   +33 (0)4 93 53 30 71
UMR 6549 Instabilite & Alterations des Genomes	E-mail: [email-masked]
Faculte de Medecine - Avenue de Valombrose - 06107 NICE Cedex 2 - France

---

From: Sak Wathanasin <[email-masked]>
Date: Fri, 8 Feb 2002 12:39:38 +0000

In reply to Thomas Kaiser's message of the 08/02/2002 at 11:16 +0100,

>systems in the localhost address. On other systems it will result in a

What actually happens depends on a lot of things like which flavour 
of Unix you're running and how you've configured it. On Linux, 
Solaris the name lookup is controlled by /etc/nsswitch.conf which 
specifies whether /etc/hosts, DNS, NIS, LDAP etc is used to resolve 
the name and in what order. The essential thing here is that netatalk 
does a "gethostbyname" and whatever it gets back is what is 
advertised to the world as being its "IP addr".

-- 
Sak Wathanasin
Network Analysis Limited           http://www.network-analysis.ltd.uk

Phone: (+44) 24 76 41 99 96     Mobile: (+44) 79 70 75 19 12 
Fax: (+44) 24 76 69 06 90

---

From: Thomas Kaiser <[email-masked]>
Date: Fri, 08 Feb 2002 14:57:26 +0100

On Fri, 8 Feb 2002 12:39:38 +0000, Sak Wathanasin wrote:

> The essential thing here is that netatalk does a "gethostbyname" and whatever
> it gets back is what is advertised to the world as being its "IP addr".

Thanks for the addendum.

One small footprint: This will happen unless you specify the IP address with
the '-ipaddr' switch in afpd.conf. So I would strongly recommend using this
switch (in 1.42b+asun days called '-address') to avoid confusion.

Netatalk is the only AFPoverTCP capable AFP server, I know of, which has the
'ability' to lead to this sort of confusion. All the other flavours supply a
correct address by default unless one changes it by editing the
configuration. So, I believe it is important to add this to the docs.

Regards,

Thomas