Go to main content

Configuring and Managing Network Components in Oracle® Solaris 11.3

Exit Print View

Updated: December 2017

Setting Property Values for Profiles

Property values for reactive profiles are set or modified by using the set subcommand. This subcommand can be used interactively or in command-line mode. If a property value is set or changed in command-line mode, the change is immediately committed to persistent storage.

Note -  You cannot modify the DefaultFixed NCP or the DefaultFixed Location profile by using the set subcommand. Whenever the DefaultFixed NCP is active, use the dladm and ipadm commands to make configuration changes. When the DefaultFixed Location is active, make changes directly to the relevant SMF properties by using the svccfg and svcadm commands. See the svccfg(1M) and svcadm(1M) man pages.

The syntax for the set subcommand is as follows:

netcfg> set prop-name=value1[,value2,...]

How to Set Profile Property Values Interactively

The following procedure describes how to set property values for a Location profile interactively. When setting property values interactively, you must first select a profile from the current scope, which moves the interactive session into that profile's scope. The selected profile is then loaded into memory from persistent storage. In this scope, you can then modify the properties of the profile.

For example purposes only, the following procedure shows how to set the ipfilter-config-file property of the test-loc Location interactively.

  1. Initiate thenetcfg interactive session.
    $ netcfg
  2. Select the profile or configuration object to modify.
    netcfg> select loc test-loc
  3. Set the property value.

    In the following example, the ipfilter-config-file property is set:

    netcfg:loc:test-loc> set ipfilter-config-file = /path/to/ipf-file
  4. (Optional) List the configuration information.
    netcfg:loc:test-loc> list
    	activation-mode 		manual
    	enabled 			    false
    	nameservices 		     dns
    	dns-nameservice-configsrc 	dhcp
    	nameservices-config-file 	"/etc/nsswitch.dns"
    	ipfilter-config-file 		"/path/to/ipf-file"
  5. End the session.
    netcfg:loc:test-loc> end
    Committed changes

    The end subcommand saves and moves the session to the global scope.

  6. Exit the interactive session.
    netcfg> exit
Example 24  Setting Property Values for a Profile in Command-Line Mode

The previous example that shows how to interactively set the ipfilter-config-file property can also be performed in command-line mode as follows:

$ netcfg "select loc test-loc; set ipfilter-config-file = /path/to/ipf-file" 

The command-line mode is best suited for when you only need to perform a simple action. However, you can also use the command-line mode to perform more complex actions by carefully specifying the appropriate subcommands on the command line. As with the interactive example, in command-line mode you must also first select the Location to move into that profile's scope. You can then specify the set subcommand to set the individual property values.

When using the command-line mode, multiple values can be set for a given property at the same time. When setting multiple values in this manner, each value must be separated by a comma (,). If individual values for a specified property also contain a comma, the comma that is part of the property value must be preceded by a backslash (\). Commas within properties that only have a single value are not interpreted as delimiters and therefore do not need to be preceded by a backslash.

For example, you would set the ip-version property to use both IPv4 and IPv6 for the net0 NCU in the myncp NCP as follows:

$ netcfg "select ncp myncp; select ncu ip net0; set ip-version=ipv4,ipv6"