On Tue, 2005-26-07 at 09:54 -0700, Ben Greear wrote:
[..]
> You will need to enforce that nothing else gets the index 34 while eth7 is
> removed.  
> How do you do that?  

Thats trivial if you assume there's one management app which most of the
router vendors implementing it have. It will get tricky when you have 10
apps fighting to get index 34 for other devices. 
You could of course enforce a reserved set of indices right on bootup
via a kernel option for example; but that doesnt solve a stupid admin
with 10 scripts all fighting for index 34 each for a different device.

> If you try to put that into the kernel, you
> have a big nasty mess, and if you try to make user-space do it, any bogus
> script can hose your system and potentially screw up your firewall and
> worse.
> 

Refer to above. It can actually be solved and not in a big mess like you
say. The question is whether such a feature is needed.

> Also, imagine that you remove your pro/100 pcmcia NIC and put in your
> tulip.  Both will be, say, eth1 currently, and that is probably what you
> want, but they will have different physical characteristics.  

The name is easy. Check out a utility like nameif for example which uses
MAC addresses as unique ids. DaveM mentions this in his other email on
this thread.

> Even if you
> put them in different cardbus slots, the likelyhood is that you want it
> to be called eth1 and treated the same regardless of which NIC you are
> using.  If you are matching firewall rules or whatever against a device
> index instead of a device name, this will fail because the device indexes
> will be different.

Again the name is easy. You can call a NIC whatever you want. 

> And, for purely virtual devices, with no lspci relationship, and no serial
> number, how do you match those?
> 

[You are taking things too literally (which is always dangerous): When i
mentioned lspci, serial number etc - I was not defining scripture. I was
giving an example of how you could find uniqueness. DaveM mentioned MAC
addresses for example; think outside the box a little - find something
thats unique on per device type if you are going to write a management
script/program.]

> Maybe we could make a small effort to keep the device indexes the same
> more often, but still not guarantee it.  That may help snmp related tools
> without overly complicating the kernel or user space.

We already almost guarantee a device will get the same ifindex and name
if created at boot time on the same kernel.
As for reserving, as i said above - an admin could be allowed to reserve
ifindices. Now you could go further with boot time reserving of a
name,ifindex pair example "ifreserve=eth7,34" and pass a series of
those; when someone creates eth7 they get ifindex 34 etc. But this is
assuming 10 other scripts will try to be mapping ifindex 34 to something
else.

cheers,
jamal

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to