Subject: Re: [netatalk-admins] Using Netatalk as a Router

From: [email-masked]
Date: Sat, 2 May 98 20:54:28 PST

Original message sent on Fri, May 1  1:09 AM by [email-masked] (Andras
Kadinger) :

>> So, if I want afpd to seed a single cable with two zone names,
>> do I need two cards? Do I need one card?
>
>It is irrelevant, how many network interfaces You have. The only relevant
>point is, that You have to specify -seed for atalkd, to make it 'seed' the
>network with zone information.
.
.
>> Do you need a router?
>
>No. You should be able to do this even on a Linux machine without any
>network connectivity (atalkd must have a network interface to bind to,
>though), and define Zones.
.
.
>> What would afpd.conf look like?
>>  
>> ed0 -seed -phase 2 -????? -zone "Foo" -zone "Bar"
>
>I think You meant atalkd.conf here. The man-page can be followed here, so
>Your example is correct (but no need for any extra options in place of the
>?-s). Like this:
>
>eth0 -seed -phase 2 -net 10 -addr 10.10 -zone "Appletree" -zone "Twilight"

Sorry to disagree, but in my experience atalkd does not work like this. I also 
have a small network with no routers and no zones.  I attempted to do exactly
what you describe, but I could not make it work.  Every time atalkd started up
it over-wrote atalkd.conf and removed the "-zone" options, even though I had
included "-seed".  To be specific, I changed atalkd.conf to look like this:

eth0 -seed -phase 2 -net 2 -addr 2.176 -zone "Engineering" -zone "Production"

Looks pretty much like the example above.  But after restarting the Unix box,
the network still has no zones, and atalkd.conf now looks like this:

eth0 -seed -phase 2 -net 0-65534 -addr 2.176

I tried putting a different range for "-net", but every time it would revert to
"0-65534", and every time the "-zone" options disappeared.  There is also a
comment in atalkd.conf that says "-seed only works if you have
multi-interfaces."  From all this I conclude that you cannot use atalkd to
define zones when there is only one interface on your Unix machine and no other
router on your network.

The important detail here might be not having any other routers on the network. 
If your network has other routers that show the same structure as atalkd.conf,
it might appear that atalkd is seeding when actually it is probing and finding
the structure defined by the other routers, and writing that to atalkd.conf.  If
the other routers were not there, the zone list in atalkd.conf would disappear. 
This might explain why it seems to work in some cases.

Bob

---

From: William LeFebvre <[email-masked]>
Date: Sun, 03 May 1998 01:11:58 -0400

bsmith wrote:
> included "-seed".....

As someone explained earlier on this list, atalkd will ignore -seed
and all the network settings if there is only one interface on the box.
The designers must have followed the obvious maxim: if you only have
one interface then you can't be a router.

				William LeFebvre
				Group sys Consulting
				<[email-masked]>
				+1 770 813 3224

---

From: Andras Kadinger <[email-masked]>
Date: Sun, 03 May 1998 09:12:36 +0200

> one interface then you can't be a router.

But this should not also mean, that You can not participate in a zoned
network...
(see my other message).

Or am I overseeing something here?

Sincerely,
Andras Kadinger
[email-masked]

---

From: Andras Kadinger <[email-masked]>
Date: Sun, 03 May 1998 09:50:53 +0200

Hello Bob, William and others,

Thank You for correcting me. On the day I wrote my 'correcting', but as
well wrong message, I found out that I was wrong (which was pointed
out); it is a weak explanation to say, my Friday message correcting
myself didn't make it to the list.

I apologize for again not telling the truth and causing another
misunderstanding.

> >though), and define Zones.

[Please note the word 'should'.]
[...]

> define zones when there is only one interface on your Unix machine and no other

This behaviour seems to be wrong in the scenario, where You are in a
zoned environment, but no other routers did start up yet (like starting
up in the morning): atalkd would start up without zones, but later, when
routers start up, I doubt, it would be able to switch to a zoned
environment (and would correctly notify all running appletalk services).

[...]

> This might explain why it seems to work in some cases.

Unfortunately, the situation is even worse.

I have another router on my network (not atalkd), seeding five or six
ethernet segments (on one of these segments is a Linux machine with
netatalk).

I define one network interface in atalkd.conf.

Now unless I make atalkd.conf read-only, atalkd ignores all my requests
to work in a multi-zone ('seeded') network: even if the config agrees to
the last bit with that of the other router, atalkd rewrites atalkd.conf
to be like just as if there were no routers at all, removing all the
'-seed' and '-zone' directives - indeed nbplkup can not see any other
objects on the (fully populated) network, just as other hosts can't see
the netatalk box.

Making atalkd.conf read-only does not remove atalkd's complaints to
syslog, but at least makes it integrate into the network and behave; if
I had no other routers, atalkd would only complain to syslog and deny
start-up completely (although I have to check this once again).

So even the presence of an other router would not stop atalkd from
removing the zoning information; I must admit, my original posting was
based on pure logical conclusions, and I stick to that we _should_ be
able to define zones and 'seed' our networks - I risk, even with no
other routers around.

Quickly checking atalkd source, it seems, it only honors the '-seed'
option when having multiple interface definitions, where I think from
the above explanations, it shouldn't need to make this distinction.

Sincerely,
Andras Kadinger
[email-masked]
PS: I include a completely untested patch here (I am no appletalk
expert, so my fix might be wrong); as I won't be able to get to any
AppleTalk network in a couple of days, people might want to test this
out. It bypasses the test of having only one interface, and lets atalkd
go on as there were more, thus allowing -seed to get effect. Warning:
untested, although compliles.

--- etc/atalkd/main.c.orig Sun May  3 08:46:04 1998
+++ etc/atalkd/main.c      Sun May  3 08:46:33 1998
@@ -170,7 +170,7 @@
                iface->i_time++;
            } else {
                iface->i_flags |= IFACE_NOROUTER;
-               if ( ninterfaces > IFBASE ) {
+               if ( 1 ) {
                    if (( iface->i_flags & IFACE_SEED ) == 0 ) {
                        /*
                         * No seed info, and we've got multiple
interfaces.

---

From: William LeFebvre <[email-masked]>
Date: Sun, 03 May 1998 11:35:32 -0400

Andras wrote:
> Date: Sun, 03 May 1998 09:12:36 +0200
> From: Andras Kadinger <[email-masked]>
> To: William LeFebvre <[email-masked]>,
Netatalk list <[email-masked]>
> Subject: Re: [netatalk-admins] Using Netatalk as a Router
>
> William LeFebvre wrote:

I'd have to dig to find your other message.  Yes you should be able to
be a client (that is, an end workstation) in a zoned network, but you
can't act as a seed.  If you explicitly specify a configuration for
your atalkd, it will (I believe) get changed based on what it sees
from seeds on the network.  These seeds will be appropriately
configured routers, be they Macs, netatalk servers, Ciscos, etc.

I'll go look for your "other message" to see if your experience
contradicts this belief.

				William LeFebvre
				Group sys Consulting
				<[email-masked]>
				+1 770 813 3224