Home

configure_network_adapter.sh




Purpose

configure_network_adapter.sh is a kornshell script to configure a network interface using ndd.


Back to top

License


# CDDL HEADER START
#
# The contents of this file and the script are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END


Back to top

History


Version
Releasedate
         Description
1.0.4
03/08/2005
initial public release
1.0.5
12/14/2005
added code for bge adapter
1.0.7
11/06/2007
#           1.0.7 06.11.2007
#           - added workaround for bug 6548250 for nxge driver
#
#           1.0.6 02.11.2007
#           - added support for nxge adapters
#
1.0.8
12/21/2007
#           1.0.8 21.12.2007
#           - added support for new GLDv3 driver
#           - added parameter createcmds

1.0.9
03/31/2008
#           1.0.9 31.03.2008
#           - added support for e1000gx driver



Back to top

Operating system

Solaris


Back to top

Language / type

Kornshell Script


Back to top

Prerequisites

You must be root to execute this script


Back to top

Usage


xtrnaw7@t30:/data/www/ARCOR/public/solaris/scripts$  ./configure_network_adapter.sh -h
configure_network_adapter.sh v1.0.8 - configure a network adapter

Usage: configure_network_adapter.sh adapter adapter_speed [createcmds [outputfile]]

Possible values for adapter_speed:

Value                                   means
-----------------------------------------------------------------
100fd, 100FD,    100FullDuplex        - 100 Mbit FullDuplex
100hd, 100HD,    100HalfDuplex        - 100 Mbit HalfDuplex
1000fd, 10000FD, 1000FullDuplex       - 1000 Mbit FullDuplex
1000hd, 1000HD,  1000HalfDuplex       - 1000 Mbit HalfDuplex
10fd,   10FD,    10HFullDuplex        - 10 Mbit FullDuplex
10hd,   10HD,    10HalfDuplex         - 10 Mbit HalfDuplex
10000, 10G                            - 10 Gigabit
auto,  AUTO                           - use Autonegotiation

createcmds : Save the commands in the file "outpufile" - do not change
             the adapter configuration; default output file is STDOUT.




Back to top

Examples


#--------------------------------------------------------
# example usage to configure a network adapter using ndd commands

bash-2.05# configure_network_adapter.sh hme0 100FD
Setting the adapter "hme0" to 100 Mbit/s FullDuplex
Setting "adv_100fdx_cap" "1" ...
Setting "adv_100T4_cap" "0" ...
Setting "adv_100hdx_cap" "0" ...
Setting "adv_10fdx_cap" "0" ...
Setting "adv_10hdx_cap" "0" ...
Setting "adv_autoneg_cap" "1" ...
Setting "adv_autoneg_cap" "0" ...
bash-2.05#


#--------------------------------------------------------
# example usage to create a script with the neccessary ndd commands

# ./configure_network_adapter.sh hme0 100fd createcmds ./configure_hme0.sh

# cat ./configure_hme0.sh
# Setting the adapter "hme0" to 100 Mbit/s FullDuplex
ndd -set /dev/hme adv_100fdx_cap 1
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_autoneg_cap 1
ndd -set /dev/hme adv_autoneg_cap 0




Back to top

Notes

Tested with hme, qfe, skge,  ce, bge, nxge, and e1000 interfaces.
The scripts supports GLDv3 and non-GLDv3 driver for the network adapter.



Back to top

Download


Download configure_network_adapter.sh



Back to top