Professional Documents
Culture Documents
The following is a Bourne shell script I wrote to determine the speed and duplex settings
for all active network interfaces on a Solaris system. Thanks to William Favorite for
fixing the script to work with two-letter network interfaces (e.g. ge0), and to Royce
Williams for providing a patch to exclude subinterface information.
Download the script.
Example output:
Interface
--------hme0
hme1
hme2
Speed
----100 Mbit/s
100 Mbit/s
100 Mbit/s
Duplex
-----full
full
full
The /etc/system settings listed above are not supported for configuring ce Ethernet
adapters during system startup; you may either use ndd commands in an /etc/rc?.d
script or create a /platform/sun4u/kernel/drv/ce.conf file with appropriate
settings.
Example: /etc/init.d/nddconfig
#!/bin/sh
ndd
ndd
ndd
ndd
ndd
ndd
ndd
ndd
-set
-set
-set
-set
-set
-set
-set
-set
/dev/ce
/dev/ce
/dev/ce
/dev/ce
/dev/ce
/dev/ce
/dev/ce
/dev/ce
instance 0
adv_1000fdx_cap 0
adv_1000hdx_cap 0
adv_100fdx_cap 1
adv_100hdx_cap 0
adv_10fdx_cap 0
adv_10hdx_cap 0
adv_autoneg_cap 0
# ln -s /etc/init.d/nddconfig /etc/rc2.d/S31nddconfig
$ dmesg | grep ce0
Jan 20 11:05:01 crmmdb22 genunix: [ID 611667 kern.info]
NOTICE: ce0: xcvr addr:0x01 - link up 100 Mbps half duplex
Jan 20 11:05:15 crmmdb22 genunix: [ID 408822 kern.info]
NOTICE: ce0: no fault external to device; service available
Jan 20 11:05:15 crmmdb22 genunix: [ID 611667 kern.info]
NOTICE: ce0: xcvr addr:0x01 - link up 100 Mbps full duplex
To query a different NIC, such as hme1, set the "instance" to 1, and then perform the
link_mode and link_speed queries above.
# ndd -set /dev/hme instance 1
Note: the ndd commands above must be run as root. Otherwise, you will receive errors
such as "couldn't push module 'hme0', No such device or address."
ce Ethernet adapters
Older versions of the Sun GigaSwift Ethernet 1.0 driver do not support the ndd
link_mode and link_speed parameters. You may either install the latest Sun
GigaSwift Ethernet adapter patch (111883) or you may use kstat ce ce_device to
get speed and duplex information for ce Ethernet adapters.
For example (from http://www.samag.com/documents/s=9142/sam0405l/0405l.htm):
$ netstat -k ce | egrep 'link_speed|link_status|link_duplex'
Interpretation:
link_up - 0 down, 1 up
link_speed - speed in Mbit/s
link_duplex - 1 half duplex, 2 full duplex, 0 down
CHANGELOG
Ipkts
Queue
1430247
24663