|Skip Navigation Links|
|Exit Print View|
|Connecting Systems Using Reactive Network Configuration in Oracle Solaris 11.1 Oracle Solaris 11.1 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.
For information about the netcfg subcommands, see netcfg Subcommands.
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.
You can list all of the top-level profiles on a system by using the list subcommand.
$ netcfg list NCPs: DefaultFixed Automatic User Locations: Automatic NoNet home office DefaultFixed ENMs: myvpn testenm WLANs: workwifi coffeeshop homewifi
In this example, the following profiles are listed:
The following NCPs are listed:
DefaultFixed NCP – System-defined fixed profile
Automatic NCP – System-defined reactive profile
User NCP – User-defined reactive NCP
The following Location profiles are listed:
User-defined reactive locations:
The following ENMs are listed:
myvpn – An ENM for an installed and configured VPN application
testenm – A test ENM for testing the working of ENMs
The following WLANs are listed:
workwifi – WLAN for work
coffeeshop – WLAN for the local coffee shop
homewifi – 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 2-8 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 2-9 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 and list 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 and list 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 alternatively 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 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 NCP User
In this example, selecting the User NCP moves the interactive session into the selected object's scope.
netcfg:ncp:User> list ncp:User management-type reactive 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 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. For information about the netcfg subcommands, see netcfg Subcommands.
Note - The walkprop subcommand is meaningful when used in interactive mode only.
Example 2-10 Viewing and Changing Property Values for a Specific Profile
In the following example, the activation-mode property for the location test-loc 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 test-loc netcfg:loc:test-loc> list loc:test-loc activation-mode manual enabled false nameservices dns nameservices-config-file "/etc/nsswitch.dns" dns-nameservice-configsrc dhcp nfsv4-domain "Central.example.com" netcfg:loc:test-loc> walkprop activation-mode (manual) [manual|conditional-any|conditional-all]> conditional-all conditions> advertised-domain is example.com nameservices (dns) [dns|files|nis|ldap]> nameservices-config-file ("/etc/nsswitch.dns")> dns-nameservice-configsrc (dhcp) [manual|dhcp]> nfsv4-domain ("Central.example.com")> ipfilter-config-file> ipfilter-v6-config-file> ipnat-config-file> ippool-config-file> ike-config-file> ipsecpolicy-config-file> netcfg:loc:test-loc> list loc:test-loc activation-mode conditional-all conditions "advertised-domain is example.com" enabled false nameservices dns nameservices-config-file "/etc/nsswitch.dns" dns-nameservice-configsrc dhcp nfsv4-domain "Central.example.com" netcfg:loc:test-loc> commit Committed changes netcfg:loc:test-loc> 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.