|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Administration: Network Interfaces and Network Virtualization Oracle Solaris 11 Express 11/10|
The nwamcfg 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 nwamadm command with the list subcommand. For more information, see Displaying the Current State of a Profile.
The nwamcfg 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 nwamadm list command.
To list all of the top level profiles on a system, type the following command:
$ nwamcfg 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: one Automatic NCP, which is a system-defined profile, and one User NCP, which is a user-defined profile.
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 nwamcfg 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:
$ nwamcfg list [ object-type [ class ] object-name ]
Example 3-10 Listing All of the Property Values of an NCU
For example, to list all of the properties for an IP NCU in the User NCP, you would type the following command:
$ nwamcfg select "ncp User; list ncu ip eg1000g" NCU:e1000g0 type interface class ip parent "User" enabled true ipv4-addrsrc dhcp ipv6-addrsrc dhcp,autoconf ip-version ipv4
Example 3-11 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 nwamcfg command with the get subcommand to obtain a specific value for a given property. This subcommand can be used in either interactive mode or command-line mode.
The syntax for the get subcommand is as follows:
nwamcfg get [ -V ] prop-name
If the -V option is used, only the property value is displayed, as shown here:
nwamcfg:ncp:User:ncu:e1000g0> get -V activation-mode manual
Otherwise, both the property and its value are displayed. For example:
nwamcfg:ncp:User:ncu:e1000g0> get activation-mode activation-mode manual
To obtain a single value for the ip-version property of an NCU named myncu which is part of the User NCP, you would type the following command:
$ nwamcfg "select ncp User; select ncu ip myncu; get ip-version"
This procedure describes how to obtain a single property value by using the nwamcfg get command while in the nwamcfg 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 .
$ nwamcfg nwamcfg>
nwamcfg> 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:
nwamcfg> select user NCP
In this example, selecting the User NCP moves the interactive session into the selected object's scope.
nwamcfg:ncp:User> list NCUs: phys e1000g0 ip e1000g0
In the following example, the link (phys) NCU e1000g0 in the User NCP is selected:
nwamcfg:ncp:User> select ncu phys e1000g0
Selecting the NCU e1000g0 moves the interactive session to that object's scope and loads the current properties for the NCU from memory.
nwamcfg:ncp:User:ncu:e1000g0> get property-value
For example, to obtain the value of the activation-mode property, you would type:
nwamcfg:ncp:User:ncu:e1000g0> 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 nwamcfg interactive mode, see Setting and Changing Property Values of 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 3-12 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.
$ nwamcfg nwamcfg> select loc foo nwamcfg:loc:foo> list LOC:foo enabled false nameservices dns dns-nameservice-configsrc dhcp nameservices-config-file "/etc/nsswitch.dns" conditions "system-domain is oracle.com" nfsv4-domain "domainl.oracle.com" activation-mode manual nwamcfg:loc:foo> walkprop activation-mode (manual) [manual|conditional-any|conditional-all]> conditional-all conditions ("system-domain is oracle.com")> "system-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> nwamcfg:loc:foo> list LOC:foo enabled false nameservices dns dns-nameservice-configsrc dhcp nameservices-config-file "/etc/nsswitch.dns" nfsv4-domain "domain.oracle.com" activation-mode conditional-all conditions "system-domain is oracle.com" nwamcfg:loc:foo> commit Committed changes nwamcfg:loc:foo> end nwamcfg> exit Nothing to commit