| System Administration Commands | nwamcfg(1M) |
nwamcfg (interactive mode) nwamcfg <subcommand> [options...] nwamcfg [-d] -f <command-file> nwamcfg help
The nwamcfg utility manipulates system network configuration profiles. nwamcfg can be invoked interactively, with an individual subcommand, or by specifying a command file that contains a series of subcommands.
nwamcfg commands are performed within a scope. There are three scopes: global, profile, and NCP. When nwamcfg is invoked without any arguments, the editing session begins in the global scope. In the global scope, NCPs and location and enm profiles are available to operate on. Selecting an NCP will move the editing session to the NCP scope; from there, individual NCUs may be created or selected to move into the profile scope. Also at the global scope, selecting or creating a Location or ENM will move the editing session to the profile scope.
Within a given profile scope, profile properties may be viewed and modified.
In interactive mode, changes are not stored to persistent storage until commit is invoked. Commit is implicitly invoked at "end" or "exit", or may be explicitly invoked by the user. When commit is invoked, the entire profile is committed. In order to maintain the consistency of persistent storage, the commit operation includes a verify step; if verification fails, the commit will also fail. If an implicit commit fails, the user will be given the option of ending/ exiting without committing the current changes, or remaining in the current scope to make further changes.
See nwam(5) for an overview of profiles, and their usage in the nwam framework.
The following subcommands are supported.
End the current profile without committing the current changes to persistent storage, and pop up to the next higher scope.
This subcommand is only meaningful in interactive mode.
Clear the value for the specified property.
Commit the current profile to persistent storage. Since a configuration must be correct to be committed, this operation automatically performs a verify on the object as well. The commit operation is attempted automatically upon leaving the current scope (with either the 'end' or 'exit' subcommand).
This subcommand is only meaningful in interactive mode. In non-interactive mode, the commit is implicit in any subcommand which changes a value.
Create an in-memory profile of the specified type and name. The -t <template> option specifies that the new object should be identical to <template>, where <template> is the name of an existing object of the same type. If the -t option is not used, the new object is created with the values specified for that object type in automatic mode.
Remove all or the specified profile from memory and persistent storage. This action is immediate; it does not need to be committed. A destroyed object cannot be reverted.
End the current profile specification, and pop up to the next higher scope. The current object is verified and committed before ending; if either the verify or commit fails, an appropriate error message is issued and the user is given the opportunity to end without committing the current changes, or to remain in the current scope and continue editing.
This subcommand is only meaningful in interactive mode.
Exit the nwamcfg session. The current profile is verified and committed before ending; if either fails, an appropriate error message is issued and the user is given the opportunity to exit without committing the current changes, or to remain in the current scope and continue editing.
This subcommand is only meaningful in interactive mode.
Print the current configuration to standard out, or to a file specified with the -f option. The -d option generates a "destroy -a" as the first output. This subcommand produces output in a form suitable for use in a command file.
Get the current (in-memory) value of the specified property.
Display general help or help about a specific subcommand.
List all property-value pairs that exist at the current or specified scope.
Delete any current changes to the current profile and revert to the values from persistent storage.
This subcommand is only meaningful in interactive mode.
Select one of the profiles available at the current scope level and jump down into that object's profiles scope. The selected object will be loaded into memory from persistent storage.
Set the current (in-memory) value of the specified property. If performed in non-interactive mode, the change is also committed to persistent storage.
The delimiter for values of multi-valued properties is "," (comma). If any of the individual values in such a property contains a comma, it must be escaped (i.e., written as "\,"). Commas within properties that can only have a single value are not interpreted as delimiters, and need not be escaped.
Verify that the current in-memory object has a valid configuration.
This subcommand is only meaningful in interactive mode.
Walk each property associated with the current profile. For each property, the name and current value are displayed, and a prompt is given to allow the user to change the current value.
The delimiter for values of multi-valued properties is "," (comma). If any of the individual values in such a property contains a comma, it must be escaped (i.e., written as "\,"). Commas within properties that can only have a single value are not interpreted as delimiters, and need not be escaped.
This subcommand is only meaningful in interactive mode.
Example 1: Set an NCU property from the command line (in non-interactive mode)
# nwamcfg "select ncp myncp; select ncu link net1; set mtu=1492"
#
Example 2: List all top-level profiles from the command line
# nwamcfg list
NCPs:
myncp
Locations:
home
office
ENMs:
myenm
enmtest
#
Example 3: Destroy a Location profile from the command line
# nwamcfg destroy loc home
Destroyed location:home.
#
Example 4: Interactively create an NCU profile. # nwamcfg nwamcfg> select ncp myncp nwamcfg:ncp:myncp> create ncu ip net1 nwamcfg:ncp:myncp:ncu:net1> walkprop activation (always) [always|never|manual|prioritized|conditional]> conditional condition ()> link:net1 under (link:net1)> ip-version (all) [ipv4|ipv6|all]> ipv4 ipv4-addr-src (dhcp) [static|dhcp]> static ipv4-static-addr ()> 168.1.2.3 nwamcfg:ncp:myncp:ncu:net1> list NCU:IP:net1 class: ip parent-ncp: myncp activation: conditional condition: link:net1 under: link:net1 ip-version: ipv4 ipv4-addr-src: static ipv4-static-addr: 168.1.2.3 nwamcfg:ncp:myncp:ncu:net1> commit nwamcfg:ncp:myncp:ncu:net1> end nwamcfg:ncp:myncp> exit #
Example 5: Select an existing enm, display its contents,
and change a property value
# nwamcfg
nwamcfg>select enm myenm
nwamcfg:enm:myenm>list
ENM:myenm
state disabled
activation manual
condition ""
fmri ""
start "/usr/local/bin/start_myenm"
stop "/usr/local/bin/stop_myenm"
nwamcfg:enm:myenm>set stop=/bin/alt_stop
nwamcfg:enm:myenm>list
ENM:myenm
state disabled
activation manual
condition ""
fmri ""
start "/usr/local/bin/start_myenm"
stop "/bin/alt_stop"
nwamcfg:enm:myenm>exit
nwamcfg:enm:myenm: committing changes...done
#