[TriLUG] setting eth0 to full duplex

Ryan Leathers ryan.leathers at globalknowledge.com
Wed Mar 3 09:18:25 EST 2004


On Thu, 2004-01-29 at 10:41, John Turner wrote:

> We use this for forcing the duplex to 100 at boot time.
> 
> # more /sbin/ifup-pre-local
> #!/bin/sh
> if test "x$1" = "xeth0"; then
>          /sbin/ifconfig eth0 up
>          /sbin/ethtool -s eth0 autoneg off speed 100 duplex full
> fi
> exit 0
> 
> #
> 
> John
 
Now my question is where to do this.  I think I could insert this kind of thing into my
/etc/rc.d/init.d/network file just after the section I've pasted below.  I doubt that this 
is the "right way" to do it.  I would feel better about doing custom stuff in rc.local, 
but I need the speed and duplex to be right before I attempt to mount /home off an NFS server.
Forcing these settings from rc.local would be too late.  My guess is that the /sbin/if-pre-local
in John's example is a home grown thing.  What calls it?  Any advice?


//From my Redhat 9 /etc/rc.d/init.d/network 
# bring up all other interfaces configured to come up at boot time
        for i in $interfaces; do
                eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
                if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
                                                                                
                if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then
                        cipeinterfaces="$cipeinterfaces $DEVICE"
                        continue
                fi
                if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then
                        # this loads the module, to preserve ordering
                        is_available $i
                        continue
                fi
                # If we're in confirmation mode, get user confirmation
                [ -n "$CONFIRM" ]  &&
                        {
                            confirm $i
                            case $? in
                                0)
                                    :
                                ;;
                                2)
                                    CONFIRM=
                                ;;
                                *)
                                    continue
                                ;;
                            esac
                }
                                                                                
                action $"Bringing up interface $i: " ./ifup $i boot
        done

-- 
Ryan Leathers <ryan.leathers at globalknowledge.com>
Global Knowledge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20040303/fae9c19d/attachment.pgp>


More information about the TriLUG mailing list