Configuring and Administering Network Components in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

Obtaining Information About Profile Configuration

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 -  In the interactive mode, using the list subcommand in the global scope lists the same information.

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.

Listing Property Values for an Individual 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 ]

How to List All of the Property Values for a Profile Interactively

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.

  1. Initiate the netcfg interactive session.
    $ netcfg
    netcfg>
  2. Select the NCP.
    netcfg> select ncp myncp
    netcfg:ncp:myncp>
  3. List the configuration for the IP NCU by using one of the following methods:
    • List the configuration from the global scope:
      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>
    • List the configuration from the profile scope:
      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>
  4. Exit the interactive session.
    netcfg:ncp:myncp:ncu:net0> exit
Example 6-9  Listing Property Values in Command-Line Mode

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"

Obtaining a Specific Property Value for a Profile

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

How to Obtain a Specific Property Value for a Profile

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.

  1. Initiate the netcfg interactive session.
    $ netcfg
    netcfg>
  2. Select the NCP, then select the IP NCU. For example:
    netcfg> select ncp myncp
    netcfg:ncp:myncp> select ncu ip net0
    netcfg:ncp:myncp:ncu:net0>
  3. Obtain the specific property value by using one of the following commands:
    • Use the get subcommand to display the property name and the property value as follows:
      netcfg:ncp:myncp:ncu:net0> get ip-version
      	ip-version	ipv4,ipv6
      
    • If you only want to obtain the property value, without displaying the property name, use the –V option with the get subcommand, as follows:
      netcfg:ncp:myncp:ncu:net0> get -V ip-version
      ipv4,ipv6
  4. Exit the interactive session.
    netcfg:ncp:myncp:ncu:net0> exit
Example 6-10  Obtaining a Specific Property Value for a Profile in Command-Line Mode

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