Vous pouvez contrôler la sortie de la commande netstat pour afficher uniquement les informations IPv4, ou les informations IPv4 et IPv6.
DEFAULT_IP=IP_VERSION4
DEFAULT_IP=BOTH
DEFAULT_IP=IP_VERSION6
Pour plus d'informations, reportez-vous à la page de manuel inet_type(4).
L'exemple suivant présente la sortie lorsque vous spécifiez la variable DEFAULT_IP = BOTH ou la variable DEFAULT_IP = IP_VERSION6 dans le fichier : inet_type
# 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
Si vous spécifiez la variable DEFAULT_IP=IP_VERSION4 dans le fichier inet_type, la sortie suivante s'affiche :
# 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