Administering TCP/IP Networks, IPMP, and IP Tunnels in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

How to Control the Display Output of IP-Related Commands

You can control the output of the netstat command 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 the /etc/default/inet_type file, as required for your network:
    • To display IPv4 information only, set the following variable:
      DEFAULT_IP=IP_VERSION4
    • To display both IPv4 and IPv6 information, set one of the following variables:
      DEFAULT_IP=BOTH
      DEFAULT_IP=IP_VERSION6

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


    Note -  The –f option of the netstat command overrides the values that are set in the inet_type file.
Example 1-7  Controlling Output to Display IPv4 and IPv6 Information

The following example shows the output when you specify the DEFAULT_IP=BOTH or DEFAULT_IP=IP_VERSION6 variable in the inet_type file:

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net0: flags=100001004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4,PHYSRUNNING> mtu 1500 index 603
        inet 10.46.86.54 netmask ffffff00 broadcast 10.46.8.255
        ether 0:1e:68:49:98:80
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128
net0: flags=120002000841<UP,RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 603
        inet6 fe80::21e:68ff:fe49:9880/10
        ether 0:1e:68:49:98:80
net0:1: flags=120002080841<UP,RUNNING,MULTICAST,ADDRCONF,IPv6,PHYSRUNNING> mtu 1500 index 603
        inet6 2001:b400:414:6059:21e:68ff:fe49:9880/64

When you specify the DEFAULT_IP=IP_VERSION4 variable in the inet_type file, you should see the following output:

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
net0: flags=100001004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4,PHYSRUNNING> mtu 1500 index 603
        inet 10.46.86.54 netmask ffffff00 broadcast 10.46.8.255
        ether 0:1e:68:49:98:80