System Administration Guide: IP Services

ProcedureHow to Control the Display Output of IP-Related Commands

You can control the output of the netstat and ifconfig commands to display IPv4 information only, or both IPv4 and IPv6 information.

  1. Create the /etc/default/inet_type file.

  2. Add one of the following entries to /etc/default/inet_type, as required for your network:

    • To display IPv4 information only:


      DEFAULT_IP=IP_VERSION4
    • To display both IPv4 and IPv6 information:


      DEFAULT_IP=BOTH

      Or


      DEFAULT_IP=IP_VERSION6

      For more information about the inet_type file, see the inet_type(4) man page.


    Note –

    The -4 and -6 flags in the ifconfig command override the values set in the inet_type file. The -f flag in the netstat command also overrides the values set in the inet_type file.



Example 7–14 Controlling Output to Select IPv4 and IPv6 Information