Subject: Re: Setting duplex options on NICs
To: Edward Dowllar <edowllar@eosinc.com>
From: Jon Lindgren <jlindgren@slk.com>
List: netbsd-help
Date: 06/01/2001 06:35:42
On Thu, 31 May 2001, Edward Dowllar wrote:

> Greetings everyone,
>  
> I am running NetBSD 1.5 (i386) and have a NETGEAR FA311 ethernet card
> that Net' recognizes and uses a Tulip driver for. I am running through a
> switch and would like to specify that the card run at 10 or 100, and its
> duplex option. It currently is autodetecting every connection. Any
> ideas?

Let's assume your interface is called tlp0 (you can find out what
interfaces are available by 'ifconfig -a').  If you do an 'ifconfig -m
tlp0' it will show you all the media options available.  After this, just
select one using the ifconfig command, such as "ifconfig tlp0 media
100baseTX mediaopt full-duplex"

If you want to use a new media option as the "boot default", then check
the /etc/ifconfig.tlp0 file (for example...).  By default, when the rc
scripts are run at boot time, the system will look to see which network
interfaces you have.  Assuming you have only a tlp0, it will consult
/etc/ifconfig.tlp0 for parameters to pass to ifconfig.  If you had a ec0
interface as well, it would consult /etc/ifconfig.ec0 for
parameters.  Basically, if you vi the /etc/ifconfig.tlp0 file you'll find
something like this:

inet 1.2.3.4 netmask 255.255.255.0

When the system boots, it consults the file, then basically calls
"ifconfig tlp0 inet 1.2.3.4 netmask 255.255.255.0" - so, just tack on the
new media options:

inet 1.2.3.4 netmask 255.255.255.0 media 100baseTX mediaopt full-duplex

And you should be all set.

Note that you can tweak the rc scripts to do different things, so if you
have (probably haven't - wild guess ;-) you may have to adapt the above
info.  Check the man page for ifconfig for more details on how to
setup/tweak your network interfaces.

Hope this helps,

-
Jon
 --------------------------------------------------------------------
 "'The chicken,' it's been said, 'is just an eggs way of making more
  eggs.'" -- Alton Brown