[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Does sungem support MII?



On Sat, Feb 08, 2003 at 05:31:14PM +0100, ?ukasz Studzi?ski wrote:
> I would like to use laptop-net package on ibook3 (Nov2002), but I am not
> quite sure if its NIC (which is sungem) support MII (Media Independent
> Interface). I had some trouble with network when a driver was configured
> as a module.
> I move the computer to many locations, so since suspending works with no
> problem now I would like to automatize network configuring. Maybe some
> of you have some experience on this subject?

I do this in /etc/power/pwrctl-local, by testing for the network when
the laptop wakes up:

function is_network_up () {
    timeout=${1-10}
    # get default gateway machine
    gateway=`ip route list | awk '/^default via [0-9.]+/{print $3}'`
    if [ -n "$gateway" ] ; then
        # ping for a maximum of $timeout s, until at least one packet is returned
        ping -w${timeout} -c1 -n $gateway > /dev/null
        return $?
    else
        return 1
    fi
}

case $1 in
    wakeup)
        if ! is_network_up ; then
            ifdown eth0 ppp0
            ifup eth0 ppp0
        fi
    ;;
esac


Then, I do magic in /etc/network/interfaces (which controls how ifup and
ifdown do their stuff). I use guessnet to choose the right network,
which can then be mapped to how to set it up (using dhcp, static IP,
etc.).

This works quite well for me.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm@physics.mcmaster.ca



Reply to: