Use the list subcommand to list all of the profiles, property-value pairs, and resources that exist at the current or specified scope, either interactively or in command-line mode.
In the global scope, the list subcommand lists all of the system-defined and user-defined profiles on a system, as shown in the following example:
$ netcfg list netcfg list NCPs: DefaultFixed Automatic myncp Locations: Automatic NoNet DefaultFixed office ENMs: test-enm WLANs: mywifi
Note that the list subcommand does not list the state of each profile. To display information about profiles and their states, use the netadm command with the list subcommand. For more information, see Displaying the Current State of a Profile.
The list subcommand in the profile scope lists all of the property values for a specified profile. The syntax is as follows:
netcfg> list [ object-type [ class ] object-name ]
The following procedure describes how to list all of the property values for a profile by using the list subcommand interactively. The example in the following procedure shows how to list the configuration information for an IP NCP name net0.The values that are listed for each profile vary, depending on the profile.
$ netcfg netcfg>
netcfg> select ncp myncp netcfg:ncp:myncp>
netcfg:ncp:myncp> list ncu ip net0 ncu:net0 type interface class ip parent "myncp" enabled false ip-version ipv4,ipv6 ipv4-addrsrc dhcp ipv6-addrsrc dhcp,autoconf netcfg:ncp:myncp>
netcfg:ncp:myncp> select ncu ip net0 netcfg:ncp:myncp:ncu:net0> list ncu:net0 type interface class ip parent "myncp" enabled false ip-version ipv4,ipv6 ipv4-addrsrc dhcp ipv6-addrsrc dhcp,autoconf netcfg:ncp:myncp:ncu:net0>
netcfg:ncp:myncp:ncu:net0> exit
The previous example that shows how to list property values interactively can be performed in command-line mode as well. The output is identical, regardless of which mode you use.
For example, you would list the properties of the net0 IP NCU from the NCP scope as follows:
$ netcfg "select ncp myncp; list ncu ip net0"
To list the properties of the net0 IP NCU from the profile scope, you would use the following command:
$ netcfg "select ncp myncp; select ncu ip net0; list"
Use the get subcommand to obtain a specific property value for a profile. This subcommand can be used either interactively or in command-line mode. The command syntax is as follows:
netcfg> get [ -V ] prop-name
The following procedure describes how to obtain a specific property value for a profile by using the get subcommand interactively. The example in the following procedure shows how to obtain the ip-version property of an IP NCU.
$ netcfg netcfg>
netcfg> select ncp myncp netcfg:ncp:myncp> select ncu ip net0 netcfg:ncp:myncp:ncu:net0>
netcfg:ncp:myncp:ncu:net0> get ip-version ip-version ipv4,ipv6
netcfg:ncp:myncp:ncu:net0> get -V ip-version ipv4,ipv6
netcfg:ncp:myncp:ncu:net0> exit
The previous interactive example can also be performed in command-line mode. The output is identical, regardless of which mode you use.
For example, you would obtain the value of the ip-version property for an IP NCU in command-line mode as follows:
$ netcfg "select ncp myncp; select ncu ip net0; get ip-version" ip-version ipv4,ipv6
The following example shows how to use the get subcommand with the –V option to obtain a specific property value. This method is useful for scripts, where the property name does not need to be parsed.
$ netcfg "select ncp myncp; select ncu ip net0; get -V ip-version" ipv4,ipv6