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.
The syntax for the set subcommand is as follows:
netcfg> set prop-name=value1[,value2,...]
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.
$ netcfg netcfg>
netcfg> select loc test-loc netcfg:loc:test-loc>
In the following example, the ipfilter-config-file property is set:
netcfg:loc:test-loc> set ipfilter-config-file = /path/to/ipf-file
netcfg:loc:test-loc> list loc:test-loc activation-mode manual enabled false nameservices dns dns-nameservice-configsrc dhcp nameservices-config-file "/etc/nsswitch.dns" ipfilter-config-file "/path/to/ipf-file"
netcfg:loc:test-loc> end Committed changes netcfg>
The end subcommand saves and moves the session to the global scope.
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"