|Skip Navigation Links|
|Exit Print View|
|Connecting Systems Using Reactive Network Configuration in Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library|
Property values for new and existing user-defined profiles are set or modified by using the netcfg command with the set subcommand. This subcommand can be used in interactive mode 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 can modify the DefaultFixed location by directly changing the relevant SMF properties or by using the tools provided by a given subsystem, such as nscfg. The property changes are directly saved in the SMF repository and are propagated to the network repository only when the DefaultFixed location is disabled. You can view the modified DefaultFixed location properties by using the netcfg command that accesses the network repository, only when the DefaultFixed location is disabled. The property values stored in the SMF repository are the authoritative values when the DefaultFixed location is active.
The syntax for the set subcommand is as follows:
$ netcfg set prop-name=value1[,value2...]
For information about the netcfg subcommands, see netcfg Subcommands.
If you need to retrieve a specific property value, use the netcfg get command. For more information, see Obtaining the Value of a Specific Property.
Example 2-6 Setting Property Values in netcfg Command-Line Mode
If you are using the netcfg command to set a property value in command-line mode, multiple subcommands can be typed on the command-line.
For example, to set the mtu property for a link NCU named net1, you would type the following command:
$ netcfg "select ncp User; select ncu phys net1; set mtu=1492"
In this example, the select subcommand is used to select the top-level profile, then again to select the NCU that contains the mtu property value that is modified.
From the command-line, multiple values can be set for a given property at the same time. When setting multiple values, 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.
In the following example, the ip-version property value for the NCU, myncu, in the NCP User is set:
$ netcfg "select ncp User; select ncu ip myncu; set ip-version=ipv4,ipv6"
When interactively setting property values, you must first select a profile at the current scope, which moves the interactive session into that profile's scope. From this scope, you can select the object whose property you want to modify. The selected profile is then loaded into memory from persistent storage. At this scope, you can modify the profile or its properties.
The following procedure describes how to set property values by taking an example to set the ipfilter-config-file property of the location test-loc.
$ netcfg netcfg>
netcfg> list NCPs: DefaultFixed Automatic User Locations: Automatic NoNet test-loc DefaultFixed
netcfg> select loc test-loc
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"
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
The end subcommand saves the change and ends the session.
Example 2-7 Interactively Setting Property Values for a Profile
$ netcfg netcfg> select ncp User netcfg:ncp:User> select ncu ip iwk0 netcfg:ncp:User:ncu:iwk0> set ipv4-default-route = 172.24.1.1
In the above example, the ipv4-default-route property of the NCP User is set. For more information about configuring an IPv4 router, see Configuring an IPv4 Router in Configuring and Administering Oracle Solaris 11.1 Networks.
In the following example, the mtu property of the NCU net0 in the NCP User is modified interactively:
$ netcfg netcfg> select ncp User netcfg:ncp:User> select ncu phys net0 netcfg:ncp:User:ncu:net0> list NCU:net0 type link class phys parent "User" enabled true activation-mode prioritized priority-mode exclusive priority-group 1 netcfg:ncp:User:ncu:net0> set mtu = 5000 netcfg:ncp:User:ncu:net0> list NCU:net0 type link class phys parent "User" enabled true activation-mode prioritized priority-mode exclusive priority-group 1 mtu 5000 netcfg:ncp:User:ncu:net0> commit Committed changes netcfg:ncp:User:ncu:net0> exit $