<chapter id="ipv6-admintasks-1"><title>Administering a TCP/IP Network (Tasks)</title><highlights><para>This chapter contains tasks for administering a TCP/IP network. The
following topics are covered:</para><itemizedlist><listitem><para><olink targetptr="ipv6-admintasks-2" remap="internal">Major TCP/IP Administrative
Tasks (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="ipconfig-142" remap="internal">Monitoring Network Status
With the netstat Command</olink></para>
</listitem><listitem><para><olink targetptr="ipv6-admintasks-53" remap="internal">Probing Remote Hosts
With the ping Command</olink></para>
</listitem><listitem><para><olink targetptr="ipv6-admintasks-5" remap="internal">Administering and Logging
Network Status Displays</olink></para>
</listitem><listitem><para><olink targetptr="ipv6-admintasks-72" remap="internal">Displaying Routing Information
With the traceroute Command</olink></para>
</listitem><listitem><para><olink targetptr="ipv6-admintasks-670" remap="internal">Monitoring Packet Transfers
With the snoop Command</olink></para>
</listitem><listitem><para><olink targetptr="ipv6-admintasks-43" remap="internal">Administering Default
Address Selection</olink></para>
</listitem>
</itemizedlist><para>The tasks assume that you have an operational TCP/IP network at your
site, either IPv4-only or dual-stack IPv4/IPv6. If you want to implement IPv6
at your site but have not done so, refer to following chapters for more information:</para><itemizedlist><listitem><para>To plan an IPv6 implementation, refer to <olink targetptr="ipv6-planning-1" remap="internal">Chapter&nbsp;4, Planning an IPv6 Network (Tasks)</olink>.</para>
</listitem><listitem><para>To configure IPv6 and create a dual-stack network environment,
refer to <olink targetptr="ipv6-config-tasks-1" remap="internal">Chapter&nbsp;7, Enabling IPv6 on a Network (Tasks)</olink>.</para>
</listitem>
</itemizedlist>
</highlights><sect1 id="ipv6-admintasks-2"><title>Major TCP/IP Administrative Tasks (Task
Map)</title><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry colsep="1" rowsep="1"><para>Task</para>
</entry><entry colsep="1" rowsep="1"><para>Description</para>
</entry><entry colsep="1" rowsep="1"><para>For Information</para>
</entry>
</row>
</thead><tbody><row><entry colsep="1" rowsep="1"><para>Display configuration information about an interface.</para>
</entry><entry colsep="1" rowsep="1"><para>Determine the current configuration of each interface on a system.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipconfig-46" remap="internal">How to Get Information About a Specific
Interface</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Display interface address assignments.</para>
</entry><entry colsep="1" rowsep="1"><para>Determine the address assignments for all interfaces on the local system.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipconfig-171" remap="internal">How to Display Interface Address Assignments</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Display statistics on a per-protocol basis.</para>
</entry><entry colsep="1" rowsep="1"><para>Monitor the performance of the network protocols on a particular system.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipconfig-143" remap="internal">How to Display Statistics by Protocol</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Display network status.</para>
</entry><entry colsep="1" rowsep="1"><para>Monitor your system by displaying all sockets and routing table entries.
The output includes the inet address family for IPv4 and inet6 address family
for IPv6. </para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipv6-admintasks-16" remap="internal">How to Display the Status of Sockets</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Display the status of network interfaces.</para>
</entry><entry colsep="1" rowsep="1"><para>Monitor the performance of network interfaces, which is useful for troubleshooting
transmission problems.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipconfig-144" remap="internal">How to Display Network Interface Status</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Display packet transmission status.</para>
</entry><entry colsep="1" rowsep="1"><para>Monitor the state of packets as they are sent over the wire.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipv6-admintasks-48" remap="internal">How to Display the Status of Transmissions
for Packets of a Specific Address Type</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Control the display output of IPv6-related commands.</para>
</entry><entry colsep="1" rowsep="1"><para>Controls the output of the <command>ping</command>, <command>netstat</command>, <command>ifconfig</command>, and <command>traceroute</command> commands.  Creates a
file that is named <filename>inet_type</filename>. Sets the <literal>DEFAULT_IP</literal> variable
in this file.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipv6-admintasks-22" remap="internal">How to Control the Display Output
of IP-Related Commands</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Monitor network traffic.</para>
</entry><entry colsep="1" rowsep="1"><para>Displays all IP packets by using the <command>snoop</command> command.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipv6-admintasks-10" remap="internal">How to Monitor IPv6 Network Traffic</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Trace all routes that are known to the network's routers.</para>
</entry><entry colsep="1" rowsep="1"><para>Uses the <command>traceroute</command> command to show all routes.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="ipv6-admintasks-29" remap="internal">How to Trace All Routes</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1>&ipv6-monitoring;<sect1 id="ipconfig-142"><title>Monitoring Network Status With the <command>netstat</command> Command</title><para>The <command>netstat</command> command generates displays that
show network status and protocol statistics. You can display the status of
TCP, SCTP, and UDP endpoints in table format. You can also display routing
table information and interface information. </para><para>The <command>netstat</command> command displays various types
of network data, depending on the selected command-line option. These displays
are the most useful for system administration. The basic syntax for <command>netstat</command> follows: </para><para><command>netstat</command> [<option>m</option>] [<option>n</option>]
[<option>s</option>] [<option>i</option> | <option>r</option>] [<option>f</option><replaceable>address-family</replaceable>]</para><para>This section describes the most commonly used options of the <command>netstat</command> command. For a detailed description of all <command>netstat</command> options,
refer to the <olink targetdoc="refman1m" targetptr="netstat-1m" remap="external"><citerefentry><refentrytitle>netstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para><task id="ipconfig-143"><title>How to Display Statistics by Protocol</title><tasksummary><para>The <command>netstat</command> <option>s</option> option displays protocol
statistics for the UDP, TCP, SCTP, ICMP, and IP protocols.</para><note><para>You can us your Solaris user account to obtain output from the <command>netstat</command> command.</para>
</note>
</tasksummary><procedure remap="single-step"><step id="ipconfig-step-55"><para>Display the protocol status.</para><screen>$ <userinput>netstat -s</userinput></screen>
</step>
</procedure><example id="eojah"><title>Network Protocol Statistics</title><para>The following example shows the output of the <command>netstat</command> <option>s</option> command. Parts of the output have been truncated. The output can
indicate areas where a protocol is having problems. For example, statistical
information from ICMPv4 and ICMPv6 can indicate where the ICMP protocol has
found errors. </para><screen width="100">RAWIP
        rawipInDatagrams    =  4701     rawipInErrors       =     0
        rawipInCksumErrs    =     0     rawipOutDatagrams   =     4
        rawipOutErrors      =     0

UDP
        udpInDatagrams      = 10091     udpInErrors         =     0
        udpOutDatagrams     = 15772     udpOutErrors        =     0

TCP     tcpRtoAlgorithm     =     4     tcpRtoMin           =   400
        tcpRtoMax           = 60000     tcpMaxConn          =    -1
        .
        .
        tcpListenDrop       =     0     tcpListenDropQ0     =     0
        tcpHalfOpenDrop     =     0     tcpOutSackRetrans   =     0

IPv4    ipForwarding        =     2     ipDefaultTTL        =   255
        ipInReceives        =300182     ipInHdrErrors       =     0
        ipInAddrErrors      =     0     ipInCksumErrs       =     0
        .
        .
        ipsecInFailed       =     0     ipInIPv6            =     0
        ipOutIPv6           =     3     ipOutSwitchIPv6     =     0

IPv6    ipv6Forwarding      =     2     ipv6DefaultHopLimit =   255
        ipv6InReceives      = 13986     ipv6InHdrErrors     =     0
        ipv6InTooBigErrors  =     0     ipv6InNoRoutes      =     0
        .
        .
        rawipInOverflows    =     0     ipv6InIPv4          =     0
 
       ipv6OutIPv4         =     0     ipv6OutSwitchIPv4   =     0

ICMPv4  icmpInMsgs          = 43593     icmpInErrors        =     0
        icmpInCksumErrs     =     0     icmpInUnknowns      =     0
        .
        .
        icmpInOverflows     =     0

ICMPv6  icmp6InMsgs         = 13612     icmp6InErrors       =     0
        icmp6InDestUnreachs =     0     icmp6InAdminProhibs =     0
        .
        .
        icmp6OutGroupQueries=     0     icmp6OutGroupResps  =     2
        icmp6OutGroupReds   =     0

IGMP:
      12287 messages received
          0 messages received with too few bytes
          0 messages received with bad checksum
      12287 membership queries received
SCTP  sctpRtoAlgorithm     =  vanj    
      sctpRtoMin           =  1000 
      sctpRtoMax           = 60000
      sctpRtoInitial       =  3000
      sctpTimHearBeatProbe =     2
      sctpTimHearBeatDrop  =     0
      sctpListenDrop       =     0
      sctpInClosed         =     0 </screen>
</example>
</task><task id="esbee"><title>How to Display the Status of Transport Protocols</title><tasksummary><para>You can display the status of the transport protocols through the <command>netstat</command> command. For detailed information, refer to the <olink targetdoc="refman1m" targetptr="netstat-1m" remap="external"><citerefentry><refentrytitle>netstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</tasksummary><procedure><step><para>Display the status of the TCP and SCTP transport protocols on
a system.</para><screen>$ <command>netstat</command></screen>
</step><step><para>Display the status of a particular transport protocol on a system.</para><screen>$ <command>netstat</command> <option>P</option> <replaceable>transport-protocol</replaceable></screen><para>Values for the <replaceable>transport-protocol</replaceable> variable
are <literal>tcp</literal>, <literal>sctp</literal>, or <literal>udp</literal>.</para>
</step>
</procedure><example id="esbdw"><title>Displaying the Status of the TCP and SCTP Transport Protocols</title><para>This example shows the output of the basic <command>netstat</command> command.
Note that IPv4-only information is displayed.</para><screen width="100">$ <userinput>netstat</userinput>

TCP: IPv4
   Local Address     Remote Address    Swind Send-Q  Rwind Recv-Q      State
----------------- -------------------- ----- ------  ----- ------     -------
lhost-1.login      abc.def.local.Sun.COM.980 49640      0     49640    0 ESTABLISHED
lhost-1.login      ghi.jkl.local.Sun.COM.1020 49640     1     49640    0 ESTABLISHED
remhost-1.1014     mno.pqr.remote.Sun.COM.nfsd 49640    0     49640    0 TIME_WAIT
SCTP:                  
Local Address    Remote Address  Swind  Send-Q  Rwind  Recv-Q StrsI/O  State 
---------------- --------------  -----  ------ ------ ------  ------   -------
 *.echo            0.0.0.0            0       0 102400      0   128/1   LISTEN
 *.discard         0.0.0.0            0       0 102400      0   128/1   LISTEN
 *.9001            0.0.0.0            0       0 102400      0   128/1   LISTEN</screen>
</example><example id="esbez"><title>Displaying the Status of a Particular Transport Protocol</title><para>This example shows the results when you specify the <option>P</option> option
of <command>netstat</command>.</para><screen width="100">$ <userinput>netstat -P tcp</userinput>
   
TCP: IPv4
   Local Address     Remote Address    Swind Send-Q  Rwind Recv-Q      State
----------------- -------------------- ----- ------  ----- ------     -------
lhost-1.login      abc.def.local.Sun.COM.980 49640      0     49640    0 ESTABLISHED
lhost.login        ghi.jkl.local.Sun.COM.1020 49640     1     49640    0 ESTABLISHED
remhost.1014       mno.pqr.remote.Sun.COM.nfsd 49640    0     49640    0 TIME_WAIT

TCP: IPv6
 Local Address    Remote Address        Swind Send-Q Rwind Recv-Q   State If 
---------------- ---------------------- ------ ----- ------ ----------- -----
localhost.38983   localhost.32777       49152      0 49152      0 ESTABLISHED      
localhost.32777   localhost.38983       49152      0 49152      0 ESTABLISHED      
localhost.38986   localhost.38980       49152      0 49152      0 ESTABLISHED      </screen>
</example>
</task><task id="ipconfig-144"><title>How to Display Network Interface Status</title><tasksummary><para>The <option role="nodash">i</option> option of the <command>netstat</command> command
shows the state of the network interfaces that are configured on the local
system. With this option, you can determine the number of packets a system
transmits and receives on each network. </para>
</tasksummary><procedure remap="single-step"><step id="ipconfig-step-57"><para>Display the status of interfaces on the
network.</para><screen>$ <userinput>netstat -i</userinput></screen>
</step>
</procedure><example id="eojbg"><title>Network Interface Status Display</title><para>The next example shows the status of IPv4 and IPv6 packet flow through
the host's interfaces.</para><para>For example, the input packet count (<filename>Ipkts</filename>) that
is displayed for a server can increase each time a client tries to boot, while
the output packet count (<filename>Opkts</filename>) remains steady. This
outcome suggests that the server is seeing the boot request packets from the
client. However, the server does not know to respond to them. This confusion
might be caused by an incorrect address in the <filename>hosts</filename>,  or <filename>ethers</filename> database. </para><para>However, if the input packet count is steady over time, then the machine
does not see the packets at all. This outcome suggests a different type of
failure, possibly a hardware problem. </para><screen width="100">Name  Mtu  Net/Dest      Address        Ipkts  Ierrs Opkts  Oerrs Collis Queue 
lo0   8232 loopback      localhost      142    0     142    0     0      0     
hme0  1500 host58        host58        1106302 0     52419  0     0      0     

Name  Mtu  Net/Dest      Address                    Ipkts  Ierrs Opkts  Oerrs Collis
lo0   8252 localhost     localhost                   142    0     142    0     0     
hme0  1500 fe80::a00:20ff:feb9:4c54/10 fe80::a00:20ff:feb9:4c54  1106305 0  52422 0  0   </screen>
</example>
</task><task id="ipv6-admintasks-16"><title>How to Display the Status of Sockets</title><tasksummary><para>The <command>-a</command> option of the <command>netstat</command> command
enables you to view the status of sockets on the local host.</para>
</tasksummary><procedure remap="single-step"><step><para>Type the following to display the status of sockets and routing
table entries:</para><para>You can use your user account to run this option
of <command>netstat</command>.</para><screen>% <userinput>netstat -a</userinput>  </screen>
</step>
</procedure><example id="eojbb"><title>Displaying All Sockets and Routing Table Entries</title><para>The output of the <command>netstat</command> <option>a</option> command
shows extensive statistics. The following example shows portions of typical <command>netstat</command> <option>a</option> output.</para><screen width="100">UDP: IPv4
   Local Address         Remote Address     State
-------------------- -------------------- -------
      *.bootpc                              Idle
host85.bootpc                               Idle
      *.*                                   Unbound
      *.*                                   Unbound
      *.sunrpc                              Idle
      *.*                                   Unbound
      *.32771                               Idle
      *.sunrpc                              Idle
      *.*                                   Unbound
      *.32775                               Idle
      *.time                                Idle
       .
       .
      *.daytime                             Idle
      *.echo                                Idle
      *.discard                             Idle
      
UDP: IPv6
   Local Address                     Remote Address                   State      If  
--------------------------------- --------------------------------- ---------- -----
      *.*                                                           Unbound   
      *.*                                                           Unbound   
      *.sunrpc                                                      Idle      
      *.*                                                           Unbound   
      *.32771                                                       Idle      
      *.32778                                                       Idle      
      *.syslog                                                      Idle      
      .
      .
TCP: IPv4
   Local Address        Remote Address    Swind Send-Q Rwind Recv-Q  State
-------------------- -------------------- ----- ------ ----- ------ -------
      *.*                  *.*                0      0 49152      0 IDLE
localhost.4999             *.*                0      0 49152      0 LISTEN
      *.sunrpc             *.*                0      0 49152      0 LISTEN
      *.*                  *.*                0      0 49152      0 IDLE
      *.sunrpc             *.*                0      0 49152      0 LISTEN
      .
      .
      *.printer            *.*                0      0 49152      0 LISTEN
      *.time               *.*                0      0 49152      0 LISTEN
      *.daytime            *.*                0      0 49152      0 LISTEN
      *.echo               *.*                0      0 49152      0 LISTEN
      *.discard            *.*                0      0 49152      0 LISTEN
      *.chargen            *.*                0      0 49152      0 LISTEN
      *.shell              *.*                0      0 49152      0 LISTEN
      *.shell              *.*                0      0 49152      0 LISTEN
      *.kshell             *.*                0      0 49152      0 LISTEN
      *.login  
       .
       .
            *.*                0      0 49152      0 LISTEN
   *TCP: IPv6
 Local Address            Remote Address        Swind Send-Q Rwind Recv-Q   State If      
----------------------- ----------------------- ----- ------ ----- ------    ----
   *.*                         *.*                0      0 49152      0      IDLE             
   *.sunrpc                    *.*                0      0 49152      0      LISTEN           
   *.*                         *.*                0      0 49152      0      IDLE             
   *.32774                     *.*                0      0 49152</screen>
</example>
</task><task id="ipv6-admintasks-48"><title>How to Display the Status of Transmissions
for Packets of a Specific Address Type</title><tasksummary><para>Use the <option>f</option> option of the <command>netstat</command> command
to view statistics related to packet transmissions of a particular address
family.</para>
</tasksummary><procedure remap="single-step"><step><para>View statistics for transmissions of either IPv4 or IPv6 packets.</para><screen>$ netstat -f <replaceable>inet  |  inet6</replaceable></screen><para>To view IPv4 transmission information, type <command>inet</command> as
the argument to <command>netstat -f</command>. Use <command>inet6</command> as
the argument to <command>netstat -f</command> to view IPv6 information.</para>
</step>
</procedure><example id="ipv6-admintasks-50"><title>Status of IPv4 Packet Transmission</title><para>The following example shows output from the <command>netstat</command> <option>f</option> <command>inet</command> command.</para><screen>TCP: IPv4
   Local Address        Remote Address    Swind Send-Q Rwind Recv-Q  State
-------------------- -------------------- ----- ------ ----- ------ -------
host58.734         host19.nfsd       49640      0 49640      0 ESTABLISHED
host58.38063       host19.32782      49640      0 49640      0 CLOSE_WAIT
host58.38146       host41.43601      49640      0 49640      0 ESTABLISHED
host58.996         remote-host.login 49640      0 49206      0 ESTABLISHED</screen>
</example><example id="ipv6-admintasks-51"><title>Status of IPv6 Packet Transmission</title><para>The following example shows output from the <command>netstat</command> <option>f</option> <command>inet6</command> command.</para><screen width="100">TCP: IPv6
 Local Address          Remote Address        Swind Send-Q Rwind Recv-Q   State    If
------------------ ------------------------- ----- ------ ----- ------ --------- -----
localhost.38065         localhost.32792       49152   0 49152      0    ESTABLISHED  
localhost.32792         localhost.38065       49152   0 49152      0    ESTABLISHED 
localhost.38089         localhost.38057       49152   0 49152      0    ESTABLISHED </screen>
</example>
</task><task id="ipconfig-145"><title>How to Display the Status of Known Routes</title><tasksummary><para>The <option>r</option> option of the <command>netstat</command> command
displays the routing table for the local host. This table shows the status
of all routes that the host knows about. You can run this option of <command>netstat</command> from your user account.</para>
</tasksummary><procedure remap="single-step"><step id="ipconfig-step-59"><para>Display the IP routing table.</para><screen>$ <userinput>netstat -r</userinput></screen>
</step>
</procedure><example id="eojao"><title>Routing Table Output by the <command>netstat</command> Command</title><para>The following example shows output from the <command>netstat</command> <option>r</option> command.</para><screen width="100">Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
host15               myhost               U         1  31059  hme0
10.0.0.14            myhost               U         1      0  hme0
default              distantrouter        UG        1      2  hme0
localhost            localhost            UH        42019361  lo0

Routing Table: IPv6
  Destination/Mask            Gateway                   Flags Ref   Use   If  
--------------------------- --------------------------- ----- --- ------ -----
2002:0a00:3010:2::/64    2002:0a00:3010:2:1b2b:3c4c:5e6e:abcd U  1      0 hme0:1
fe80::/10                fe80::1a2b:3c4d:5e6f:12a2    U       1     23 hme0 
ff00::/8                 fe80::1a2b:3c4d:5e6f:12a2    U       1      0 hme0 
default                  fe80::1a2b:3c4d:5e6f:12a2    UG      1      0 hme0 
localhost                localhost                   UH      9  21832 lo0 </screen><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec3" colwidth="30.93*"/><colspec colname="colspec4" colwidth="69.07*"/><thead><row><entry><para>Parameter</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>Destination</literal></para><para><literal>Destination/Mask</literal></para>
</entry><entry><para>Specifies the host that is the destination endpoint of the route. Note
that the IPv6 routing table shows the prefix for a 6to4 tunnel endpoint (<literal>2002:0a00:3010:2::/64</literal>) as the route destination endpoint.</para>
</entry>
</row><row><entry><para><literal>Gateway</literal></para>
</entry><entry><para>Specifies the gateway to use for forwarding packets.</para>
</entry>
</row><row><entry><para><literal>Flags</literal></para>
</entry><entry><para>Indicates the current status of the route. The <literal>U</literal> flag
indicates that the route is up. The <literal>G</literal> flag indicates that
the route is to a gateway. </para>
</entry>
</row><row><entry><para><literal>Use</literal></para>
</entry><entry><para>Shows the number of packets sent.</para>
</entry>
</row><row><entry><para><literal>Interface</literal></para>
</entry><entry><para>Indicates the particular interface on the local host that is the source
endpoint of the transmission.</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</example>
</task>
</sect1><sect1 id="ipv6-admintasks-53"><title>Probing Remote Hosts With the <command>ping</command> Command</title><para>You can use the <command>ping</command> command to determine the status
of a remote host. When you run <command>ping</command>, the ICMP protocol
sends a datagram to the host that you specify, asking for a response. ICMP
is the protocol responsible for error handling on a TCP/IP network. When you
use <command>ping</command>, you can find out whether an IP connection exists
for the specified remote host. </para><para>The following is the basic syntax of <command>ping</command>:</para><para><command>/usr/sbin/ping</command> <replaceable>host [timeout]</replaceable></para><para>In this syntax, <replaceable>host</replaceable> is the name of
the remote host. The optional <replaceable>timeout</replaceable> argument
indicates the time in seconds for the <command>ping</command> command to continue
trying to reach the remote host. The default is 20 seconds. For additional
syntax and options, refer to the <olink targetdoc="refman1m" targetptr="ping-1m" remap="external"><citerefentry><refentrytitle>ping</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para><task id="ipv6-admintasks-54"><title>How to Determine if a Remote Host Is
Running</title><procedure remap="single-step"><step><para>Type the following form of the <command>ping</command> command:</para><screen>$ <userinput>ping</userinput> <replaceable>hostname</replaceable></screen><para>If host <replaceable>hostname</replaceable> is accepting ICMP transmissions,
this message is displayed:</para><screen><replaceable>hostname</replaceable> is alive</screen><para>This message indicates that <replaceable>hostname</replaceable> responded
to the ICMP request. However, if <replaceable>hostname</replaceable> is down
or cannot receive the ICMP packets, you receive the following response from
the <command>ping</command> command:</para><screen>no answer from <replaceable>hostname</replaceable></screen>
</step>
</procedure>
</task><task id="ipv6-admintasks-56"><title>How to Determine if a Host Is Dropping
Packets</title><tasksummary><para>Use the <option>s</option> option of the <command>ping</command> command
to determine if a remote host is running but nevertheless losing packets.</para>
</tasksummary><procedure remap="single-step"><step><para>Type the following form of the <command>ping</command> command:</para><screen>$ <userinput>ping -s</userinput> <replaceable>hostname</replaceable></screen>
</step>
</procedure><example id="ipv6-admintasks-58"><title><command>ping</command> Output for Detecting Packet Dropping</title><para>The <command>ping -s</command> <replaceable>hostname</replaceable> command
continually sends packets to the specified host until you send an interrupt
character or a time out occurs. The responses on your screen resemble the
following:</para><screen width="100">&amp; <userinput>ping -s host1.domain8</userinput>
PING host1.domain8 : 56 data bytes
64 bytes from host1.domain8.COM (172.16.83.64): icmp_seq=0. time=1.67 ms
64 bytes from host1.domain8.COM (172.16.83.64): icmp_seq=1. time=1.02 ms
64 bytes from host1.domain8.COM (172.16.83.64): icmp_seq=2. time=0.986 ms
64 bytes from host1.domain8.COM (172.16.83.64): icmp_seq=3. time=0.921 ms
64 bytes from host1.domain8.COM (172.16.83.64): icmp_seq=4. time=1.16 ms
64 bytes from host1.domain8.COM (172.16.83.64): icmp_seq=5. time=1.00 ms
64 bytes from host1.domain8.COM (172.16.83.64): icmp_seq=5. time=1.980 ms

^C

----host1.domain8  PING Statistics----
7 packets transmitted, 7 packets received, 0% packet loss
round-trip (ms)  min/avg/max/stddev = 0.921/1.11/1.67/0.26</screen><para>The packet-loss statistic indicates whether the host has dropped
packets. If <command>ping</command> fails, check the status of the network
that is reported by the <command>ifconfig</command> and <command>netstat</command> commands.
Refer to <olink targetptr="ipconfig-141" remap="internal">Monitoring the Interface Configuration
With the ifconfig Command</olink> and <olink targetptr="ipconfig-142" remap="internal">Monitoring
Network Status With the netstat Command</olink>. </para>
</example>
</task>
</sect1><sect1 id="ipv6-admintasks-5"><title>Administering and Logging Network Status
Displays</title><para>The following tasks show how to check the status of the network by using
well-known networking commands.</para><task id="ipv6-admintasks-22"><title>How to Control the Display Output of
IP-Related Commands</title><tasksummary><para>You can control the output of the <command>netstat</command> and <command>ifconfig</command> commands to display IPv4 information only, or both IPv4 and IPv6
information.</para>
</tasksummary><procedure><step><para>Create the <filename>/etc/default/inet_type</filename> file.</para>
</step><step><para>Add one of the following entries to <filename>/etc/default/inet_type</filename>,
as required for your network:</para><itemizedlist><listitem><para>To display IPv4 information only:</para><screen>DEFAULT_IP=IP_VERSION4</screen>
</listitem><listitem><para>To display both IPv4 and IPv6 information:</para><screen>DEFAULT_IP=BOTH</screen><para>Or</para><screen>DEFAULT_IP=IP_VERSION6</screen><para>For more information about the <filename>inet_type</filename> file,
see the <olink targetdoc="refman4" targetptr="inet-type-4" remap="external"><citerefentry><refentrytitle>inet_type</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page.</para>
</listitem>
</itemizedlist><note><para>The <option>4</option> and <option>6</option> flags in the <command>ifconfig</command> command override the values set in the <command>inet_type</command> file.
The <option>f</option> flag in the <command>netstat</command> command also
overrides the values set in the <filename>inet_type</filename> file. </para>
</note>
</step>
</procedure><example id="eojat"><title>Controlling Output to Select IPv4 and IPv6 Information</title><itemizedlist><listitem><para>When you specify the <literal>DEFAULT_IP=BOTH</literal> or <literal>DEFAULT_IP=IP_VERSION6</literal> variable in the <filename>inet_type</filename> file,
you should have the following output:</para><screen>% <userinput>ifconfig -a</userinput>
lo0: flags=1000849 mtu 8232 index 1
        inet 10.10.0.1 netmask ff000000 
qfe0: flags=1000843 mtu 1500 index 2
        inet 10.46.86.54 netmask ffffff00 broadcast 10.46.86.255
        ether 8:0:20:56:a8 
lo0: flags=2000849 mtu 8252 index 1
        inet6 ::1/128 
qfe0: flags=2000841 mtu 1500 index 2
        ether 8:0:20:56:a8 
        inet6 fe80::a00:fe73:56a8/10 
qfe0:1: flags=2080841 mtu 1500 index 2
        inet6 2001:db8:3c4d:5:a00:fe73:56a8/64 </screen>
</listitem><listitem><para>When you specify the <literal>DEFAULT_IP=IP_VERSION4</literal> or <literal>DEFAULT_IP=IP_VERSION6</literal> variable in the <filename>inet_type</filename> file,
you should have the following output:</para><screen>% <userinput>ifconfig -a</userinput>
lo0: flags=849 mtu 8232
        inet 10.10.0.1 netmask ff000000 
qfe0: flags=843 mtu 1500
        inet 10.46.86.54 netmask ffffff00 broadcast 10.46.86.255
        ether 8:0:20:56:a8</screen>
</listitem>
</itemizedlist>
</example>
</task><task id="ipv6-admintasks-59"><title>How to Log Actions of the IPv4 Routing
Daemon</title><tasksummary><para>If you suspect a malfunction of <command>routed</command>, the IPv4
routing daemon, you can start a log that traces the daemon's activity. The
log includes all packet transfers when you start the <command>routed</command> daemon. </para>
</tasksummary><procedure><step><para>On the local host, assume the Primary Administrator role, or become
superuser.</para><para>The Primary Administrator role includes the Primary
Administrator profile. To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="ipconfig-step-63"><para>Create a log file of routing daemon actions: </para><screen># <userinput>/usr/sbin/in.routed /var/</userinput><replaceable>log-file-name</replaceable></screen><caution><para>On a busy network, this command can generate almost continuous
output.</para>
</caution>
</step>
</procedure><example id="eojba"><title>Network Log for the <command>in.routed</command> Daemon</title><para>The following example shows the beginning of the log that is created
by the procedure <olink targetptr="ipv6-admintasks-59" remap="internal">How to Log Actions
of the IPv4 Routing Daemon</olink>.</para><screen>-- 2003/11/18 16:47:00.000000 --
Tracing actions started
RCVBUF=61440
Add interface lo0  #1   127.0.0.1      -->127.0.0.1/32   
   &lt;UP|LOOPBACK|RUNNING|MULTICAST|IPv4> &lt;PASSIVE> 
Add interface hme0 #2   10.10.48.112    -->10.10.48.0/25   
    &lt;UP|BROADCAST|RUNNING|MULTICAST|IPv4> 
turn on RIP
Add    10.0.0.0        -->10.10.48.112      metric=0  hme0  &lt;NET_SYN>
Add    10.10.48.85/25  -->10.10.48.112      metric=0  hme0  &lt;IF|NOPROP></screen>
</example>
</task><task id="ipv6-admintasks-62"><title>How to Trace the Activities of the IPv6
Neighbor Discovery Daemon</title><tasksummary><para>If you suspect a malfunction of the IPv6 <command>in.ndpd</command> daemon,
you can start a log that traces the daemon's activity. This trace is displayed
on the standard output until terminated. This trace includes all packet transfers
when you start the <command>in.ndpd</command> daemon. </para>
</tasksummary><procedure><step><para>Assume the Primary Administrator role, or become superuser, on
the local IPv6 node.</para><para>The Primary Administrator role includes the
Primary Administrator profile. To create the role and assign the role to a
user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="ipv6-admintasks-step-64"><para>Start a trace of the <command>in.ndpd</command> daemon.</para><screen># <userinput>/usr/lib/inet/in.ndpd -t</userinput></screen>
</step><step id="ipv6-admintasks-step-65"><para>Terminate the trace as needed by
typing Control-C.</para>
</step>
</procedure><example id="eojae"><title>Trace of the <command>in.ndpd</command> Daemon</title><para>The following output shows the beginning of a trace of <command>in.ndpd</command>.</para><screen width="100"># <userinput>/usr/lib/inet/in.ndpd -t</userinput>
Nov 18 17:27:28 Sending solicitation to  ff02::2 (16 bytes) on hme0
Nov 18 17:27:28         Source LLA: len 6 &lt;08:00:20:b9:4c:54>
Nov 18 17:27:28 Received valid advert from fe80::a00:20ff:fee9:2d27 (88 bytes) on hme0
Nov 18 17:27:28         Max hop limit: 0
Nov 18 17:27:28         Managed address configuration: Not set
Nov 18 17:27:28         Other configuration flag: Not set
Nov 18 17:27:28         Router lifetime: 1800
Nov 18 17:27:28         Reachable timer: 0
Nov 18 17:27:28         Reachable retrans timer: 0
Nov 18 17:27:28         Source LLA: len 6 &lt;08:00:20:e9:2d:27>
Nov 18 17:27:28         Prefix: 2001:08db:3c4d:1::/64
Nov 18 17:27:28                 On link flag:Set
Nov 18 17:27:28                 Auto addrconf flag:Set
Nov 18 17:27:28                 Valid time: 2592000
Nov 18 17:27:28                 Preferred time: 604800
Nov 18 17:27:28         Prefix: 2002:0a00:3010:2::/64
Nov 18 17:27:28                 On link flag:Set
Nov 18 17:27:28                 Auto addrconf flag:Set
Nov 18 17:27:28                 Valid time: 2592000
Nov 18 17:27:28                 Preferred time: 604800</screen>
</example>
</task>
</sect1><sect1 id="ipv6-admintasks-72"><title>Displaying Routing Information With
the <command>traceroute</command> Command</title><para>The <command>traceroute</command> command traces the route an IP packet
follows to a remote system. For technical details about <command>traceroute</command>,
see the <olink targetdoc="refman1m" targetptr="traceroute-1m" remap="external"><citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para><para>You use the <command>traceroute</command> command to uncover any routing
misconfiguration and routing path failures. If a particular host is unreachable,
you can use <command>traceroute</command> to see what path the packet follows
to the remote host and where possible failures might occur.</para><para>The <command>traceroute</command> command also displays the round trip
time for each gateway along the path to the target host. This information
can be useful for analyzing where traffic is slow between the two hosts.</para><task id="ipv6-admintasks-73"><title>How to Find Out the Route to a Remote
Host</title><procedure remap="single-step"><step><para>Type the following to discover the route to a remote system:</para><screen>% <userinput>traceroute</userinput> <replaceable>destination-hostname</replaceable></screen><para>You can run this form of the <command>traceroute</command> command from
your user account.</para>
</step>
</procedure><example id="ipv6-admintasks-673"><title>Using the <command>traceroute</command> Command to Show the Route to
a Remote Host</title><para>The following output from the <command>traceroute</command> command
shows the seven&ndash;hop path a packet follows from the local system <literal>nearhost</literal> to the remote system <literal>farhost</literal>. The output also
shows the times for a packet to traverse each hop.</para><screen width="100">istanbul% <userinput>traceroute farhost.faraway.com</userinput>
	traceroute to farhost.faraway.com (172.16.64.39), 30 hops max, 40 byte packets
	 1  frbldg7c-86 (172.16.86.1)  1.516 ms  1.283 ms  1.362 ms
	 2  bldg1a-001 (172.16.1.211)  2.277 ms  1.773 ms  2.186 ms
	 3  bldg4-bldg1 (172.16.4.42)  1.978 ms  1.986 ms  13.996 ms
	 4  bldg6-bldg4 (172.16.4.49)  2.655 ms  3.042 ms  2.344 ms
	 5  ferbldg11a-001 (172.16.1.236)  2.636 ms  3.432 ms  3.830 ms
	 6  frbldg12b-153 (172.16.153.72)  3.452 ms  3.146 ms  2.962 ms
	 7  sanfrancisco (172.16.64.39)  3.430 ms  3.312 ms  3.451 ms</screen>
</example>
</task><task id="ipv6-admintasks-29"><title>How to Trace All Routes</title><tasksummary><para>This procedure uses the <option>a</option> option of the <command>traceroute</command> command to trace all routes.</para>
</tasksummary><procedure remap="single-step"><step><para>Type the following command on the local system:</para><screen>% <userinput>traceroute -a</userinput><replaceable>host-name</replaceable></screen><para>You can run this form of the <command>traceroute</command> command from
your user account.</para>
</step>
</procedure><example id="eojaf"><title>Tracing All Routes to a Dual-Stack Host</title><para>This example shows all possible routes to a dual-stack host.</para><screen width="100">% <userinput>traceroute -a v6host.remote.com</userinput>
traceroute: Warning: Multiple interfaces found; using 2::56:a0:a8 @ eri0:2
traceroute to v6host (2001:db8:4a3b::102:a00:fe79:19b0),30 hops max, 60 byte packets
 1  v6-rout86 (2001:db8:4a3b:56:a00:fe1f:59a1)  35.534 ms  56.998 ms * 
 2  2001:db8::255:0:c0a8:717  32.659 ms  39.444 ms *
 3  farhost.faraway.COM (2001:db8:4a3b::103:a00:fe9a:ce7b)  401.518 ms  7.143 ms *
 4  distant.remote.com (2001:db8:4a3b::100:a00:fe7c:cf35)  113.034 ms  7.949 ms *
 5  v6host (2001:db8:4a3b::102:a00:fe79:19b0)  66.111 ms *  36.965 ms

traceroute to v6host.remote.com  (192.168.10.75),30 hops max,40 byte packets
 1  v6-rout86 (172.16.86.1)  4.360 ms  3.452 ms  3.479 ms
 2  flrmpj17u.here.COM (172.16.17.131)  4.062 ms  3.848 ms  3.505 ms
 3  farhost.farway.com (10.0.0.23)  4.773 ms *  4.294 ms
 4  distant.remote.com (192.168.10.104)  5.128 ms  5.362 ms *
 5  v6host  (192.168.15.85)  7.298 ms  5.444 ms *
 </screen>
</example>
</task>
</sect1><sect1 id="ipv6-admintasks-670"><title>Monitoring Packet Transfers With the <command>snoop</command> Command</title><para>You can use the <command>snoop</command> command to monitor the
state of data transfers. <command>snoop</command> captures network packets
and displays their contents in the format that you specify. Packets can be
displayed as soon as they are received, or saved to a file.  When <command>snoop</command> writes
to an intermediate file, packet loss under busy trace conditions is unlikely.
 <command>snoop</command> itself is then used to interpret the file. </para><para>To capture packets to and from the default interface in promiscuous
mode, you must assume the Network Management role or become superuser. In
summary form, <command>snoop</command> displays only the data that pertains
to the highest-level protocol. For example, an NFS packet only displays NFS
information. The underlying RPC, UDP, IP, and Ethernet frame information is
suppressed but can be displayed if either of the verbose options is chosen.</para><para>Use <command>snoop</command> frequently and consistently to become familiar
with normal system behavior. For assistance in analyzing packets, look for
a recent white paper and RFC, and seek the advice of an expert in a particular
area, such as NFS or NIS. For details on using <command>snoop</command> and
its options, refer to the <olink targetdoc="refman1m" targetptr="snoop-1m" remap="external"><citerefentry><refentrytitle>snoop</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page. </para><task id="ipv6-admintasks-67"><title>How to Check Packets From All Interfaces</title><procedure><step><para>On the local host, assume the Network Management role or become
superuser.</para><para>Roles contain authorizations and privileged commands.
For more information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</step><step><para>Print information about the interfaces that are attached to the
system. </para><screen># <userinput>ifconfig -a</userinput></screen><para>The <command>snoop</command> command normally uses the first non-loopback
device, typically the primary network interface.</para>
</step><step><para>Begin packet capture by typing <command>snoop</command> without
arguments, as shown in <olink targetptr="eojbm" remap="internal">Example 8&ndash;19</olink></para>
</step><step id="ipv6-admintasks-step-70"><para>Use Control-C to halt the process.</para>
</step>
</procedure><example id="eojbm"><title>Output From the snoop Command</title><para>The basic <command>snoop</command> command returns output that resembles
the following, for a dual-stack host.</para><screen remap="wide" width="100">% <userinput>snoop</userinput>
Using device /dev/hme (promiscuous mode)
farhost.remote.com -> myhost       RLOGIN C port=993 
    myhost -> farhost.remote.com   RLOGIN R port=993 Using device /dev/hme
router5.local.com -> router5.local.com ARP R 10.0.0.13, router5.local.com is
    0:10:7b:31:37:80
router5.local.com -> BROADCAST     TFTP Read "network-confg" (octet)
myhost -> DNSserver.local.com      DNS C 192.168.10.10.in-addr.arpa. Internet PTR ?
DNSserver.local.com  myhost        DNS R 192.168.10.10.in-addr.arpa. Internet PTR niserve2.
.
.
farhost.remote.com-> myhost        RLOGIN C port=993 
    myhost -> farhost.remote.com   RLOGIN R port=993 fe80::a00:20ff:febb:
.
fe80::a00:20ff:febb:e09 -> ff02::9 RIPng R (5 destinations)</screen><para>The packets that are captured in this output show a remote login section,
including lookups to the NIS and DNS servers for address resolution. Also
included are periodic ARP packets from the local router and advertisements
of the IPv6 link-local address to <command>in.ripngd</command>.</para>
</example>
</task><task id="ipv6-admintasks-674"><title>How to Capture <command>snoop</command> Output
Into a File</title><procedure><step><para>On the local host, assume the Network Management role or become
superuser.</para><para>Roles contain authorizations and privileged commands.
For more information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</step><step><para>Capture a <command>snoop</command> session into a file.</para><screen># <userinput>snoop -o</userinput> <replaceable>filename</replaceable></screen><para>For example:</para><screen># <userinput>snoop /tmp/cap</userinput>
Using device /dev/eri (promiscuous mode)
30 snoop: 30 packets captured</screen><para>In the example, 30 packets have been captured in a file named <filename>/tmp/cap</filename>. The file can be in any directory with enough disk space. The
number of packets that are captured is displayed on the command line, enabling
you to press Control-C to abort at any time.</para><para><command>snoop</command> creates
a noticeable networking load on the host machine, which can distort the results.
To see the actual results, run <command>snoop</command> from a third system.</para>
</step><step><para>Inspect the <command>snoop</command> output captures file.</para><screen># <userinput>snoop -i</userinput> <replaceable>filename</replaceable></screen>
</step>
</procedure><example id="eojbn"><title>Contents of a <command>snoop</command> Output Captures File</title><para>The following output shows a variety of captures such as you might receive
as output from the <command>snoop -i</command> command.</para><screen width="100"># <userinput>snoop -i /tmp/cap</userinput>
1   0.00000 fe80::a00:20ff:fee9:2d27 -> fe80::a00:20ff:fecd:4375 
    ICMPv6 Neighbor advertisement
2   0.16198 farhost.com   -> myhost     RLOGIN C port=985 
3   0.00008 myhost -> farhost.com       RLOGIN R port=985 
10  0.91493    10.0.0.40 -> (broadcast)  ARP C Who is 10.0.0.40, 10.0.0.40 ?
34  0.43690 nearserver.here.com  -> 224.0.1.1  IP  D=224.0.1.1 S=10.0.0.40 LEN=28, 
      ID=47453, TO =0x0, TTL=1
35  0.00034  10.0.0.40 -> 224.0.1.1    IP  D=224.0.1.1 S=10.0.0.40 LEN=28, ID=57376, 
     TOS=0x0, TTL=47  </screen>
</example>
</task><task id="ipv6-admintasks-676"><title>How to Check Packets Between an IPv4
Server and a Client</title><procedure><step><para>Establish a <literal>snoop</literal> system off a hub that is
connected to either the client or the server. </para><para>The third system
(the <literal>snoop</literal> system) checks all the intervening traffic,
so the <command>snoop</command> trace reflects what is actually happening
on the wire.</para>
</step><step><para>On the <command>snoop</command> system, assume the Network Management
role or become superuser.</para><para>Roles contain authorizations and privileged
commands. For more information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</step><step><para>Type <command>snoop</command> with options and save the output
to a file.</para>
</step><step><para>Inspect and interpret the output. </para><para>Refer to <ulink url="http://www.ietf.org/rfc/rfc1761.txt?number=1761" type="text_url">RFC 1761, Snoop Version 2 Packet Capture File Format</ulink> for
details of the <command>snoop</command> capture file. </para>
</step>
</procedure>
</task><task id="ipv6-admintasks-10"><title>How to Monitor IPv6 Network Traffic</title><tasksummary><para>You can use the <command>snoop</command> command to display only IPv6
packets.</para>
</tasksummary><procedure><step><para>On the local node, assume the Network Management role or become
superuser.</para><para>Roles contain authorizations and privileged commands.
For more information about roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</step><step><para>Capture IPv6 packets.</para><screen># <userinput>snoop ip6</userinput></screen><para>For more information on the <command>snoop</command> command, see the <olink targetdoc="refman1m" targetptr="snoop-1m" remap="external"><citerefentry><refentrytitle>snoop</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</step>
</procedure><example id="ipv6-admintasks-26"><title>Displaying Only IPv6 Network Traffic</title><para>The following example shows typical output such as you might receive
from running the <command>snoop ip6</command> command on a node.</para><screen># <userinput>snoop ip6</userinput>
fe80::a00:20ff:fecd:4374 -> ff02::1:ffe9:2d27 ICMPv6 Neighbor solicitation
fe80::a00:20ff:fee9:2d27 -> fe80::a00:20ff:fecd:4375 ICMPv6 Neighbor 
      solicitation
fe80::a00:20ff:fee9:2d27 -> fe80::a00:20ff:fecd:4375 ICMPv6 Neighbor 
      solicitation
fe80::a00:20ff:febb:e09 -> ff02::9      RIPng R (11 destinations)
fe80::a00:20ff:fee9:2d27 -> ff02::1:ffcd:4375 ICMPv6 Neighbor solicitation</screen>
</example>
</task>
</sect1><sect1 id="ipv6-admintasks-43"><title>Administering Default Address Selection</title><para>The Solaris OS enables a single interface to have multiple IP addresses.
For example, technologies, such as network multipathing (IPMP) enable multiple
network interface cards (NICs) to connect to the same IP link layer. That
link can have one or more IP addresses. Additionally, interfaces on IPv6-enabled
systems have a link-local IPv6 address, at least one IPv6 routing address,
and an IPv4 address for at least one interface. </para><para>When the system initiates a transaction, an application makes a call
to the <command>getaddrinfo</command> socket. <command>getaddrinfo</command> discovers
the possible address in use on the destination system. The kernel then prioritizes
this list to find the best destination to use for the packet. This process
is called <emphasis>destination address ordering</emphasis>. The Solaris kernel
then selects the appropriate format for the source address, given the best
destination address for the packet. The process is known as <emphasis>address
selection</emphasis>. For more information on destination address ordering,
see the <olink targetdoc="refman3b" targetptr="getaddrinfo-3socket" remap="external"><citerefentry><refentrytitle>getaddrinfo</refentrytitle><manvolnum>3SOCKET</manvolnum></citerefentry></olink> man page.</para><para>Both IPv4-only and dual-stack IPv4/IPv6 systems must perform default
address selection. In most circumstances, you do not need to change the default
address selection mechanisms. However, you might need to change the priority
of address formats to support IPMP or to prefer 6to4 address formats, for
example. </para><task id="ipv6-admintasks-77"><title>How to Administer the IPv6 Address Selection
Policy Table</title><tasksummary><para>The following procedure explains how to modify the address selection
policy table. For conceptual information about IPv6 default address selection,
refer to <olink targetptr="ipv6-ref-108" remap="internal">ipaddrsel Command</olink>.</para><caution><para>Do not change the IPv6 address selection policy table, except
for the reasons shown in the next task. You can cause problems on the network
with a badly constructed policy table. Be sure to save a backup copy of the
policy table, as is done in the next procedure.</para>
</caution>
</tasksummary><procedure><step><para>Assume the Primary Administrator role, or become superuser.</para><para>The Primary Administrator role includes the Primary Administrator profile.
To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="ipv6-admintasks-step-79"><para>Review the current IPv6 address selection
policy table.</para><screen># <userinput>ipaddrsel</userinput>
# Prefix                  Precedence Label
::1/128                           50 Loopback
::/0                              40 Default
2002::/16                         30 6to4
::/96                             20 IPv4_Compatible
::ffff:0.0.0.0/96                 10 IPv4</screen>
</step><step id="ipv6-admintasks-step-80"><para>Make a backup copy of the default
address policy table.</para><screen># <userinput>cp /etc/inet/ipaddrsel.conf /etc/inet/ipaddrsel.conf.orig</userinput></screen>
</step><step id="ipv6-admintasks-step-81"><para>Use a text editor to add your customizations
to <filename>/etc/inet/ipaddrsel.conf</filename>. </para><para>Use the following
syntax for entries in <filename>/etc/inet/ipaddrsel</filename>:</para><screen><replaceable>prefix/prefix-length precedence label [# comment ]</replaceable> </screen><para>Here are some common modifications that you might want to make to your
policy table:</para><itemizedlist><listitem><para>Give the highest priority to 6to4 addresses.</para><screen>2002::/16                         50 6to4
::1/128                           45 Loopback</screen><para>The 6to4 address format now has the highest priority, 50. Loopback,
which previously had a 50 precedence, now has a 45 precedence. The other addressing
formats remain the same.</para>
</listitem><listitem><para>Designate a specific source address to be used in communications
with a specific destination address.</para><screen>::1/128                           50 Loopback
2001:1111:1111::1/128             40 ClientNet
2001:2222:2222::/48               40 ClientNet
::/0                              40 Default</screen><para>This particular entry is useful for hosts with only one physical interface.
Here <literal>2001:1111:1111::1/128</literal> is preferred as the source address
on all packets that are bound for destinations within network <literal>2001:2222:2222::/48</literal>. The 40 priority gives higher precedence to the source address <literal>2001:1111:1111::1/128</literal> than to other address formats configured for
the interface.</para>
</listitem><listitem><para>Favor IPv4 addresses over IPv6 addresses.</para><screen>::ffff:0.0.0.0/96                 60 IPv4
::1/128                           50 Loopback
.
.</screen><para>The IPv4 format <literal>::ffff:0.0.0.0/96</literal> has its precedence
changed from the default 10 to 60, the highest priority in the table.</para>
</listitem>
</itemizedlist>
</step><step id="ipv6-admintasks-step-82"><para>Load the modified policy table into
the kernel.</para><screen><userinput>ipaddrsel -f /etc/inet/ipaddrsel.conf</userinput></screen>
</step><step id="ipv6-admintasks-step-85"><para>If the modified policy table has
problems, restore the default IPv6 address selection policy table.</para><screen># <userinput>ipaddrsel -d</userinput></screen>
</step>
</procedure>
</task><task id="ipv6-admintasks-87"><title>How to Modify the IPv6 Address Selection
Table for the Current Session Only</title><tasksummary><para>When you edit the <filename>/etc/inet/ipaddrsel.conf,</filename> file,
any modifications that you make persist across reboots. If you want the modified
policy table to exist only in the current session, follow this procedure.</para>
</tasksummary><procedure><step><para>Assume the Primary Administrator role, or become superuser.</para><para>The Primary Administrator role includes the Primary Administrator profile.
To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Copy the contents of <filename>/etc/inet/ipaddrsel</filename> into <replaceable>filename</replaceable>, where <replaceable>filename</replaceable> represents
a name of your choice.</para><screen># <userinput>cp</userinput> <filename>/etc/inet/ipaddrsel</filename> <replaceable>filename</replaceable></screen>
</step><step id="ipv6-admintasks-step-84"><para>Edit the policy table in <replaceable>filename</replaceable> to your specifications. </para>
</step><step id="ipv6-admintasks-step-86"><para>Load the modified policy table into
the kernel.</para><screen><userinput># ipaddrsel -f <replaceable>filename</replaceable></userinput></screen><para>The kernel uses the new policy table until you reboot the system.</para>
</step>
</procedure>
</task>
</sect1>
</chapter>