|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Administration: Network Interfaces and Network Virtualization Oracle Solaris 11 Information Library|
The netcfg command can be used with the list subcommand to list all of the profiles, property-value pairs, and resources that exist at the current or specified scope. Use the list subcommand to query the system for general information about all profiles or to retrieve specific information about a particular profile. The list subcommand can be used in either interactive mode or command-line mode.
If you need to obtain information about profiles and their current state, use the netadm command with the list subcommand. For more information, see Displaying the Current State of a Profile.
The netcfg list command lists all of the system-defined and user-defined profiles on a system. Note that using the list subcommand without any options displays all of the top-level profiles that are on a system. The command does not list the state of each profile. To display a list of the profiles and their state (online or offline), use the netadm list command.
To list all of the top level profiles on a system, type the following command:
$ netcfg list NCPs: Automatic User Locations: Automatic NoNet home office ENMs: myvpn testenm WLANs: workwifi coffeeshop homewifi
In this example, the following profiles are listed:
There are two NCPs listed: the Automatic NCP, which is a system-defined profile, and a user-defined NCP, named User.
There are four Location profiles listed: two locations that are system-defined (Automatic and NoNet) and two locations that are user-defined (home and office).
There are two ENMs listed: one ENM for an installed and configured VPN application, and one test ENM.
There are three WLANs listed: one WLAN for work, one WLAN for the local coffee shop, and one WLAN for the user's home wireless network.
Note - Only user-defined profiles can be created, modified, or removed.
Use the netcfg command with the list subcommand to list all of the property values for a specified profile.
The syntax for the list subcommand is as follows:
$ netcfg list [ object-type [ class ] object-name ]
Example 4-11 Listing All of the Property Values of an NCU
For example, to list all of the property values for an IP NCU in the User NCP, you would type the following command:
$ netcfg "select ncp User; list ncu ip net0" NCU:net0 type interface class ip parent "User" enabled true ip-version ipv4 ipv4-addrsrc dhcp ipv6-addrsrc dhcp,autoconf
Example 4-12 Listing All of the Property Values of an ENM
In the following example, all of the properties for an ENM named myenm are listed.
$ list enm myenm ENM:myenm activation-mode manual enabled true start "/usr/local/bin/myenm start" stop "/bin/alt_stop"
In this example, the output of the list subcommand displays the following information:
The activation-mode property for this ENM is set to manual.
The ENM is enabled.
The start and stop method properties have been specified, rather than using an FMRI.
You can use the netcfg command with the get subcommand to obtain the specific value for a specified property. This subcommand can be used in either interactive mode or command-line mode.
The syntax for the get subcommand is as follows:
netcfg get [ -V ] prop-name
To obtain the value of the ip-version property of an NCU named myncu, which is a part of the User NCP, you would type the following command. For example:
$ netcfg "select ncp User; select ncu ip myncu; get -V ip-version" ipv4
If the -V option is used with the get subcommand, only the property value is displayed, as shown here:
netcfg:ncp:User:ncu:net0> get -V activation-mode manual
Otherwise, both the property and its value are displayed. For example:
netcfg:ncp:User:ncu:net0> get activation-mode activation-mode manual
This procedure describes how to obtain a single property value by using the netcfg get command while in the netcfg interactive mode. In this particular procedure, some of the examples show how to obtain a single property value for an NCU in the User NCP. These examples are used for demonstration purposes only. The information that you provide when using this command would vary, depending on the profile and the property value that you attempt to retrieve.
If you want to view all of the property values for a profile, you can alternately use the walkprop subcommand. This subcommand walks you through all of the properties of a given profile, one at a time, enabling you to modify one or all of the profile's properties. For more information, see Interactively Viewing and Changing Property Values by Using the walkprop Subcommand .
$ netcfg netcfg>
netcfg> select object-type [ class ] object-name
Note - The class parameter is applicable only if you are selecting an NCU. Also, the class parameter must be specified if both the phys and ip class NCU share the same name. However, if the NCU name is unique, the class parameter is not required.
For example, to select the User NCP, you would type:
netcfg> select User NCP
In this example, selecting the User NCP moves the interactive session into the selected object's scope.
netcfg:ncp:User> list NCUs: phys net0 ip net0
In the following example, the link (phys) NCU net0 in the User NCP is selected:
netcfg:ncp:User> select ncu phys net0
Selecting the NCU net0 moves the interactive session to that object's scope and loads the current properties for the NCU from memory.
netcfg:ncp:User:ncu:net0> get property-value
For example, to obtain the value of the activation-mode property, you would type:
netcfg:ncp:User:ncu:net0> get activation-mode activation-mode manual
At this point, you can set a new value for the property by using the set subcommand, or you can exit the interactive session without making any changes. Note that if you modify a property value while in interactive mode, you must use the commit or exit subcommand to save your changes. For information about setting a property value in netcfg interactive mode, see Setting and Changing Property Values for a Profile.
The walkprop subcommand can be used interactively to view the properties of a profile. This subcommand “walks” you through a profile, one property at a time, displaying the name and current value for each property. An interactive command prompt is also displayed, that you can use to change the current value of the specified property. The delimiter for multi-valued properties is a comma (,). If an individual value for a given property contains a comma, it must be preceded it with a backslash (\). Commas within properties that only have a single value are not interpreted as delimiters and do not need to be preceded by a backslash.
Note - The walkprop subcommand is meaningful when used in interactive mode only.
Example 4-13 Viewing and Changing Property Values for a Specific Profile
In the following example, the activation-mode property for the location foo is viewed and then changed by using the walkprop subcommand. Note that when using the walkprop subcommand, you do not need to use the set subcommand to set the property value.
$ netcfg netcfg> select loc foo netcfg:loc:foo> list loc:foo activation-mode manual enabled false nameservices dns nameservices-config-file "/etc/nsswitch.dns" dns-nameservice-configsrc dhcp nfsv4-domain "Central.oracle.com" netcfg:loc:foo> walkprop activation-mode (manual) [manual|conditional-any|conditional-all]> conditional-all conditions> advertised-domain is oracle.com nameservices (dns) [dns|files|nis|ldap]> nameservices-config-file ("/etc/nsswitch.dns")> dns-nameservice-configsrc (dhcp) [manual|dhcp]> nfsv4-domain ("Central.oracle.com")> ipfilter-config-file> ipfilter-v6-config-file> ipnat-config-file> ippool-config-file> ike-config-file> ipsecpolicy-config-file> netcfg:loc:foo> list loc:foo activation-mode conditional-all conditions "advertised-domain is oracle.com" enabled false nameservices dns nameservices-config-file "/etc/nsswitch.dns" dns-nameservice-configsrc dhcp nfsv4-domain "Central.oracle.com" netcfg:loc:foo> commit Committed changes netcfg:loc:foo> end netcfg> exit $
Note - Only relevant properties are walked. For example, if the ipv4-addrsrc property is set to static, the ipv4-addr property is included in the walk. However, if ipv4-addrsrc is set to dhcp, the ipv4-addr property is not walked.