|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
|
The ndd utility is used to examine and set kernel parameters, namely the TCP/IP drivers. Most kernel parameters accessible through ndd can be adjusted without rebooting the system. To see which parameters are available for a particular driver, use the following ndd command:
# ndd /dev/hme \?
Here /dev/hme is the name of the driver and command lists the parameters for this particular driver. Use of backslash in from of "?" prevents the shell from interpreting the question mark as a special character.
Using \? will list all parameters for the driver and indicate whether the parameter is read only or read and write. The current parameter value or status information can be read by specifying the driver and parameter names. Only the parameters marked as read and write can be changed.
# ndd /dev/hme link_speed 0
This example shows the output of a ndd command examining the link speed of the
hme driver (The output 0 indicates that the option is set for 10Mbps). ndd-specified
parameter values are integers with 0 meaning disabled, 1 meaning enabled, or a large
integer to set a time or size value.
Setting parameters requires the -set option, the driver name, the parameter
name, and the new value. For example, to enable the 100 Mbps hme driver use the
following ndd command:
# ndd -set /dev/hme link_speed 1 && ndd /dev/hme link_speed
ndd parameters are also available for the ARP, IP, ICMP, and TCP drivers. To see which parameters are available for those drivers use the following commands:
# ndd /dev/arp \? && ndd /dev/icmp \? && ndd /dev/ip \? && ndd /dev/tcp \?
For example for ARP you need to use the command:
ndd /dev/ip ip_ire_arp_interval
to display the length of time that ARP entries are cached. The default is 1200000 microseconds (20 min). That means that Solaris cache solicited ARP entries for 20 minutes. Unsolicited ARP entries cache for only 5 minutes. Use the command:
ndd /dev/ip arp_cleanup_interval
Note - ndd parameter documentation is currently not available from Sun except for network card configuration. This is a known issue. Setting driver parameters involves making trade-offs. Most parameters involve changing the default Solaris Operating Environment configuration. The default settings are optimal for most situations. Adjusting parameters can affect normal system operation, so Sun does not encourage making parameter changes. Sun may also change the names of parameters in future versions of the Solaris Operating Environment.
You can set the hme device driver parameters in three ways (ndd,
/etc/system, or startup shell script), depending on
your needs. To set parameters that are valid until you reboot the system, use the
ndd utility. Using the ndd utility interactively is a good way to test parameter
settings.
To set parameters so they remain in effect after you reboot the system, add the
parameter values to /etc/system when you want
to configure parameters for all devices in the system.
A startup script can also be used to set a ndd parameters across system reboots.
Include the appropriate ndd command in a system startup script, such as the
/etc/init.d/inetinit file or a customized script
in /etc/rc2.d or /etc/rc3.d.
Be sure to make a copy of any files before adding the ndd commands.
Summary: Manually setting nic speed / duplex problem Solaris 9
Solaris Tips - Ethernet Card Tips
ndd– get and set driver configuration parameters
ndd [-set] driver parameter [value]ndd gets and sets selected configuration parameters in some kernel drivers. Currently, ndd only supports the drivers that implement the TCP/IP Internet protocol family. Each driver chooses which parameters to make visible using ndd. Since these parameters are usually tightly coupled to the implementation, they are likely to change from release to release. Some parameters may be read-only.
If the -set option is omitted, ndd queries the named driver, retrieves the value associated with the specified parameter, and prints it. If the -set option is given, ndd passes value, which must be specified, down to the named driver which assigns it to the named parameter.
By convention, drivers that support ndd also support a special read-only parameter named ``?'' which can be used to list the parameters supported by the driver.
To see which parameters are supported by the TCP driver, use the following command:
example% ndd /dev/tcp \?
The parameter name ``?'' may need to be escaped with a backslash to prevent its being interpreted as a shell meta character.
The following command sets the value of the parameter ip_forwarding in the dual stack IP driver to zero. This disables IPv4 packet forwarding.
example% ndd -set /dev/ip ip_forwarding 0
Similarly, in order to disable IPv6 packet forwarding, the value of parameter ip6_forwarding
example% ndd -set /dev/ip ip6_forwarding 0
To view the current IPv4 forwarding table, use the following command:
example% ndd /dev/ip ipv4_ire_status
To view the current IPv6 forwarding table, use the following command:
example% ndd /dev/ip ipv6_ire_status
See attributes(5) for descriptions of the following attributes:
The parameters supported by each driver may change from release to release. Like programs that read /dev/kmem, user programs or shell scripts that execute ndd should be prepared for parameter names to change.
The ioctl() command that ndd uses to communicate with drivers is likely to change in a future release. User programs should avoid making dependencies on it.
The meanings of many ndd parameters make sense only if you understand how the driver is implemented.
Q1. Which command will increase the TCP transmit and receive buffers ?
A: ndd
Q2: The network interface on your system is capable of functioning in both half-duplex and full-duplex modes. Which command allows you to view whether your network interface is functioning in half-duplex or full-duplex mode?
Q3: Which command will cause subsequent commands of the same type, to affect only hme1
A: ndd -set /dev/hme instance 1
Q4: When using the ndd utility, which command sets the device instance in order to examine the values associated with the third network interface?
Last modified: June 02, 2008