Re: [leaf-devel] Docs for the 2 NIC config

View: New views
6 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [leaf-devel] Docs for the 2 NIC config

by Erich Titl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul

I move this to leaf users as I believe it is of general interest.

Paul Rogers wrote:

> On Mon, 12 Oct 2009 10:10:24 +0200, "Erich Titl"
> <erich.titl@...> said:
>
> Quite so.  That's esentially what I found out from a message reply by
> Charles re Dachstein in searching the message base.  Thing is, I've been
> running Linux for over 5 years.  In the versions of modutils I use,
> derived from LFS, such things can be assigned by "alias eth1 3c59x" for
> example.  I never ran across the "default case" before and didn't know
> it.  If one HASN'T run across this before, then one needs to know it,
> since Bering doesn't seem to use aliases in its /etc/modules file. (MY
> firewall uses a modem, and Bering-1.2, because dialup is all I can
> afford.)  I'm just suggesting that a few sentences like you wrote in the
> documentation would have been a big help, because I was stuck!
Oh I see, well I suppose you could look into the way the network gets
initialized. Basically the loading of the network drivers automagically
creates devices. MOdprobe does the aliasing for you, but it is not
implemented in LEAF.

I found this interesting snippet

>>>>>>>>>>>>>
The first thing you need in your modules.conf file is something to tell
modprobe what driver to use for the eth0 (and eth1 and...) network
interface. You use the alias command for this. For example, if you have
an ISA SMC EtherEZ card which uses the smc-ultra.o driver module, you
need to alias this driver to eth0 by adding the line:

        alias eth0 smc-ultra

Important Note: The alias above is only used by the module utilities to
translate a generic device name (e.g.eth0) into a hardware specific
driver module name. When the driver loads, it never even sees this
alias; instead it will simply choose the first free ethN (N=0,1,2,...)
device name available. Thus, if more than one ethernet module is being
loaded, the ethN assigned to the driver by the kernel may or may not be
the same as the one given on the alias line,
>>>>>>>>>>>>>>>

So you may never have seen this, because you never had multiple
instances of the same card in your other *x systems.

Actually it might not be that difficult to mimic the alias in Bering
uClibc. We have the ip link command which allows us to assign whaever
name we want to a specific NIC

[root@tristan]# ip link set dev eth0 name inside
[root@tristan]# ip link show dev inside
2: inside: <BROADCAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:80:c8:f8:4a:51 brd ff:ff:ff:ff:ff:ff

All that is left now is to determine which NIC will get which name,
which is not that obvious when you take the above snippet into
consideration.

What you can do is read the /etc/modules file for alias ethx lines, sort
them and then load the drivers in that order, preferrably after all
dependencies have been resolved :-)

cheers

Erich


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@...
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/

Parent Message unknown Re: [leaf-devel] Docs for the 2 NIC config

by Erich Titl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Paul Rogers wrote:
> On Mon, 12 Oct 2009 22:15:15 +0200, "Erich Titl"
...
>
> And STILL get it all on one floppy?  ;-)  I'm one of the ones that has
> always been in favor  of maintaining floppy compatability for a basic
> setup.  As long as the behavior is documented where an installer is sure
> to see it, then I'm in favor of using the far simpler default behavior.

I _believe_ the script should not take more than a few hundred bytes as
you need those utilities anyway. I think modutils is the place to do it

# Loop over every line in /etc/modules.
echo 'Loading modules: '
(cat /etc/modules; echo) | # make sure there is a LF at the end
while read module args
do
        case "$module" in
                \#*|"") continue ;;
        esac
        echo -n "$module - "
        MODTOLOAD=`find / -name $module.o |sort |sed -n 1p`
        if [ "$MODTOLOAD" = ""  ] ;then
           module="` echo $module | cut -c-8`"
           MODTOLOAD=`find / -name $module.o |sort |sed -n 1p `
        fi
        if [ ! "$MODTOLOAD" = "" ] ;then
        insmod $MODTOLOAD $args
        fi
#       insmod /lib/modules/"$module".o $args
done

cheers

Erich

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@...
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/

Re: [leaf-devel] Docs for the 2 NIC config

by Charles Steinkuehler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Erich Titl wrote:

> Actually it might not be that difficult to mimic the alias in Bering
> uClibc. We have the ip link command which allows us to assign whaever
> name we want to a specific NIC
>
> [root@tristan]# ip link set dev eth0 name inside
> [root@tristan]# ip link show dev inside
> 2: inside: <BROADCAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
>     link/ether 00:80:c8:f8:4a:51 brd ff:ff:ff:ff:ff:ff
>
> All that is left now is to determine which NIC will get which name,
> which is not that obvious when you take the above snippet into
> consideration.
>
> What you can do is read the /etc/modules file for alias ethx lines, sort
> them and then load the drivers in that order, preferrably after all
> dependencies have been resolved :-)

The problem is most of the time if you have multiple NICs, they use the
same chipset.  That means the ethX order is determined by the device
driver, not by the module load order, and the device drivers have no
standardized way of indicating which physical interface is "first".

So...either something has to talk to the kernel the way modprobe, udev,
etc. manage to do, or a different approach is needed (perhaps using MAC
addresses or logical names to identify the interfaces instead of ethX).

- --
Charles Steinkuehler
charles@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFK1G2ZLywbqEHdNFwRAn+BAKDZa+bl8pxQ/ZkWgl7oe9UGSWyYIgCfZaS0
1FVfdiWZZRq2cnBS2+5h7VM=
=rVbg
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@...
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/

Re: Docs for the 2 NIC config

by Erich Titl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Charles

Charles Steinkuehler wrote:
...
>
> The problem is most of the time if you have multiple NICs, they use the
> same chipset.  That means the ethX order is determined by the device
> driver, not by the module load order, and the device drivers have no
> standardized way of indicating which physical interface is "first".

Implemented as specified...

>
> So...either something has to talk to the kernel the way modprobe, udev,
> etc. manage to do, or a different approach is needed (perhaps using MAC
> addresses or logical names to identify the interfaces instead of ethX).
>

How would a logical name survive a reboot? I guess the only fixed
identification would be the mac address.

cheers

Erich

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@...
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/

Parent Message unknown Re: Docs for the 2 NIC config

by Paul Rogers-25 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I _believe_ the script should not take more than a few hundred
> bytes as you need those utilities anyway. I think modutils is the
> place to do it

We had a Senator who famously said, "A billion here, a billion there,
pretty soon you're talking real money."  All I think we need is that
the assignments be reliable, and the way it works be documented
rather than arcane knowledge some people might not know.  It could be
"fixed" with a few sentences in the installation manual.  (By someone
that knows it, which obviously isn't me!)
--
Paul Rogers
paulgrogers@...
http://www.xprt.net/~pgrogers/
Rogers' Second Law: "Everything you do communicates."
(I do not personally endorse any additions after this line. TANSTAAFL :-)

 

--
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@...
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/

Re: Docs for the 2 NIC config

by Erich Titl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul Rogers wrote:

>> I _believe_ the script should not take more than a few hundred
>> bytes as you need those utilities anyway. I think modutils is the
>> place to do it
>
> We had a Senator who famously said, "A billion here, a billion there,
> pretty soon you're talking real money."  All I think we need is that
> the assignments be reliable, and the way it works be documented
> rather than arcane knowledge some people might not know.  It could be
> "fixed" with a few sentences in the installation manual.  (By someone
> that knows it, which obviously isn't me!)
Wrong, you are now

cheers

Erich


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
------------------------------------------------------------------------
leaf-user mailing list: leaf-user@...
https://lists.sourceforge.net/lists/listinfo/leaf-user
Support Request -- http://leaf-project.org/