Jeff Taylor's Weblog

  • Sun
    June 7, 2012

ndd on Solaris 10

This is mostly a repost of LaoTsao's Weblog, with some tweaks and additions. In 2008, his blog pointed out that with Solaris 9 and earlier,  an rc3 script would be used to specify ndd parameters at boot up. With Solaris 10 and later, it is more elegant to to SMF.

The last time that I tried to cut & paste directly off of his page, some of the XML was messed up, so I am reposting working Solaris 10 XML in this blog entry.

Additionally, I am including scripts that I use to distribute the settings to multiple servers. I run the distribution scripts from my MacBook, but they should also work from a windows laptop using cygwin, or from an existing Solaris installation.

Why is it necessary to set ndd parameters at boot up?

The problem being addressed is how to set ndd parameter which survive reboot. It is easy to specify ndd settings from a shell, but they only apply to the running OS and don't survive reboots.

Examples of ndd setting being necessary include performance tuning, as described in NFS Tuning for HPC Streaming Applications, and installing Oracle Database 11gR2 on Solaris 10 with prerequisites, as show here:


On Solaris 10 Update 10, the default values network settings don't match the Oracle 11gR2 prerequisites:

Expected Value Actual Value
tcp_smallest_anon_port 9000 32768
tcp_largest_anon_port 65500 65535
udp_smallest_anon_port 9000 32768
udp_largest_anon_port 65500 65535

To distribute the SMF files, and for future administration, it is helpful to enable passwordless ssh from your secure laptop:

If not already present, create a ssh key on you laptop

# ssh-keygen -t rsa


Enable passwordless ssh from my laptop.

Need to type in the root password for the remote machines.
Then, I no longer need to type in the password when I ssh or scp from my
laptop to servers.


#!/usr/bin/env bash

for server in `cat servers.txt`


  echo root@$server

  cat ~/.ssh/id_rsa.pub | ssh root@$server "cat >>


Specify the servers to distribute to:





In addition to ndd values, I offen use the following /etc/system setting: 




set rpcmod:clnt_max_conns=8

set zfs:zfs_arc_max=0x1000000000

set nfs:nfs3_bsize=131072

set nfs:nfs4_bsize=131072

Modify ndd-nettune.txt with the ndd values that are appropriate for your deployment: 






# ident   "@(#)ndd-nettune.xml    1.0     01/08/06 SMI"

. /lib/svc/share/smf_include.sh

. /lib/svc/share/net_include.sh

# Make sure that the libraries essential to this stage of
booting  can be found.


echo "Performing Directory Server Tuning..." >>


# Performance Settings


/usr/sbin/ndd -set /dev/tcp tcp_max_buf 2097152

/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 1048576

/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 1048576


# Oracle Database 11gR2 Settings


/usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 9000

/usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65500

/usr/sbin/ndd -set /dev/udp udp_smallest_anon_port 9000

/usr/sbin/ndd -set /dev/udp udp_largest_anon_port 65500

# Reset the library path now that we are past the critical stage





<?xml version="1.0"?>

<!DOCTYPE service_bundle SYSTEM

<!-- ident "@(#)ndd-nettune.xml 1.0 04/09/21 SMI" -->

<service_bundle type='manifest' name='SUNWcsr:ndd'>

  <service name='network/ndd-nettune' type='service'

    <create_default_instance enabled='true' />

    <single_instance />

    <dependency name='fs-minimal' type='service'
grouping='require_all' restart_on='none'>

      <service_fmri value='svc:/system/filesystem/minimal'


    <dependency name='loopback-network'
grouping='require_any' restart_on='none' type='service'>

      <service_fmri value='svc:/network/loopback' />


    <dependency name='physical-network'
grouping='optional_all' restart_on='none' type='service'>

      <service_fmri value='svc:/network/physical' />


    <exec_method type='method' name='start'
exec='/lib/svc/method/ndd-nettune' timeout_seconds='3' >

    <exec_method type='method' name='stop' 
exec=':true'                       timeout_seconds='3' >

    <property_group name='startd' type='framework'>

      <propval name='duration' type='astring'
value='transient' />


    <stability value='Unstable' />



    <loctext xml:lang='C'> ndd network tuning



    <manpage title='ndd' section='1M'
manpath='/usr/share/man' />





Execute this shell script to distribute the files. The ndd values will be immediately modified and then survive reboot. The servers will need to rebooted to pick up the /etc/system settings:




#!/usr/bin/env bash

for server in `cat servers.txt`


  cat etc_system_addins | ssh root@$server "cat >>

  scp ndd-nettune.xml

  scp ndd-nettune.txt root@${server}:/lib/svc/method/ndd-nettune

  ssh root@$server chmod +x /lib/svc/method/ndd-nettune

  ssh root@$server svccfg validate

  ssh root@$server svccfg import


Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.