System Administration Guide, Volume 3

How to Control the Display Output of IPv6 Related Commands

You can control the output of the netstat and ifconfig commands by creating a file named inet_type in the /etc/default directory and specifying the value of the DEFAULT_IP variable. For more information about the inet_type, see the inet_type(4) man page.

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

  2. Make one of the following entries, as needed.

    1. To display IPv4 information only, enter:


      DEFAULT_IP=IP_VERSION4
    2. To display both IPv4 and IPv6 information, enter:


      DEFAULT_IP=BOTH

      or


      DEFAULT_IP=IP_VERSION6

Note -

The -4 and -6 flags in ifconfig and -f flag in netstat override the value set in the inet_type file (if it exists).


Examples--Controlling Output to Select IPv4 and IPv6 Information