| System Administration Commands | | nwamcfg(1M) |
NAME
SYNOPSIS
nwamcfg (interactive mode)
nwamcfg <subcommand> [options...]
nwamcfg [-d] -f <command-file>
nwamcfg help [<subcommand>]
DESCRIPTION
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, location and enm profiles, and Known WLAN entries 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, ENM, or Known WLAN 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.
Properties
NCU Properties
Properties common to all NCUs
The type, class, and parent properties are set when the NCU is created and cannot be changed later.
nwamadm
Properties of Interface NCUs
Properties common to all LINK NCUs
- exclusive: at least one NCU must be available to make the group available; and only one NCU will be activated. If more than one member NCU is available, nwamd will randomly choose one to activate.
- shared: at least one NCU must be available to make the group available; all available NCUs will be activated.
- all: all group member NCUs must be available to make the group available; all member NCUs will be activated.
Note that the range of allowed MTU values depends on the underlying hardware. Because NCUs may be created before the underlying hardware is present with driver attached, it is not possible to verify the value set at the time the NCU is edited. If an NCU fails to activate because of an invalid MTU size, this will be indicated in the system log, and the NCU will be placed in maintenance state.
Location Properties
nwamadm
domainname
ENM Properties
nwamadm
domainname
Known WLAN Properties
dladm
Condition Expressions
Locations and ENMs can be activated based on a set of user-specified conditions. The following table summarizes the syntax of those condition expressions.
| Object Type | Object | Condition |
|---|
| ncu | enm | loc | name | is/is-not active |
| Object Type | Condition | Object |
|---|
| essid | is/is-not/contains/does-not-contain | name string |
| bssid | is/is-not | bssid string |
| ip-address | is/is-not | IPv4 or IPv6 address |
| ip-address | is-in-range/is-not-in-range | IPv4 or IPv6 address plus netmask/prefixlen |
| advertised-domain | is/is-not/contains/does-not-contain | name string |
| system-domain | is/is-not/contains/does-not-contain | name string |
OPTIONS
SUBCOMMANDS
The following subcommands are supported.
- cancel
:
End the current profile specification without committing the current changes to persistent storage, and pop up to the next higher scope.
This subcommand is valid in the NCP and profile scopes. - clear <prop-name>
:
Clear the value for the specified property.
This subcommand is valid in the profile scope. - commit
:
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 valid in the profile scope.
Note that in non-interactive mode a commit is not required, as the commit is implicit for any subcommand which changes a value. - create [ -t <template> ] <object-type> [ <class> ] <object-name>
:
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 default values. For NCPs, only a "User" NCP can be created.
This subcommand is valid in the global and NCP scopes. - destroy { -a | <object-type> [ <class> ] <object-name> }
:
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.
This subcommand is valid in the global and NCP scopes if a specific object is specified; the -a option is only valid in the global scope. - end
:
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 valid in any scope. - exit
:
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 valid in any scope. - export [ -d ] [ -f <output-file> ] [ <object-type> [ <class> ] <object-name> ]
:
Print the current configuration at the current or specified scope to standard out, or to a file specified with the -f option. The -d option generates a "destroy -a" as the first line of output. This subcommand produces output in a form suitable for use in a command file. System created objects, including the Automatic NCP and the Automatic, NoNet, and Legacy locations, cannot be exported.
This subcommand is valid in any scope. - get [ -V ] <prop-name>
:
Get the current (in-memory) value of the specified property. By default, both the property name and value are printed; if the -V option is specified, only the property value is printed.
This subcommand is valid in the profile scope. - help [ <subcommand> ]
:
Display general help or help about a specific subcommand.
This subcommand is valid in any scope. - list [ <object-type> [ <class> ] <object-name> ]
:
List all profiles, property-value pairs and resources that exist at the current or specified scope.
This subcommand is valid in any scope. - revert
:
Delete any current changes to the current profile and revert to the values from persistent storage.
This subcommand is valid in the profile scope. - select <object-type> [ <class> ] <object-name>
:
Select one of the profiles available at the current scope level and jump down into that object's scope. The selected object will be loaded into memory from persistent storage.
This subcommand is valid in the global and NCP scopes. - set <prop-name>=<value1>[,<value2>...]
:
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.
This subcommand is valid in the profile scope. - verify
:
Verify that the current in-memory object has a valid configuration.
This subcommand is valid in the profile scope. - walkprop
:
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 valid in the profile scope.
This subcommand is only meaningful in interactive mode.
SEE ALSO
netcfgd(1M)nwamadm(1M)nwamd(1M)
EXAMPLES
Example 1: Set an NCU property from the command line (in non-interactive mode)
# nwamcfg "select ncp User; select ncu phys net1; set mtu=1492"
#
Example 2: List all top-level profiles from the command line
# nwamcfg list
NCPs:
Automatic
User
Locations:
Automatic
NoNet
home
office
ENMs:
myenm
enmtest
WLANs:
sunwifi
coffeeshop
linksys
#
Example 3: Destroy a Location profile from the command line
# nwamcfg destroy loc home
Destroyed loc 'home'
#
Example 4: Interactively create an NCU profile.
# nwamcfg
nwamcfg> select ncp User
nwamcfg:ncp:User> create ncu ip net1
Created ncu 'net1'. Walking properties ...
ip-version (ipv4,ipv6) [ipv4|ipv6]> ipv4
ipv4-addr-src (dhcp) [static|dhcp]> static
ipv4-static-addr ()> 168.1.2.3
nwamcfg:ncp:User:ncu:net1> list
NCU:IP:net1
type: interface
class: ip
parent-ncp: "User"
ip version: ipv4
ipv4-addr-src: static
ipv4-static-addr: 168.1.2.3
nwamcfg:ncp:User:ncu:net1> commit
Committed changes
nwamcfg:ncp:User:ncu:net1> end
nwamcfg:ncp:User> 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
activation-mode manual
enabled true
start "/usr/local/bin/myenm start"
stop "/usr/local/bin/myenm stop"
nwamcfg:enm:myenm>set stop="/bin/alt_stop"
nwamcfg:enm:myenm>list
ENM:myenm
activation-mode manual
enabled true
start "/usr/local/bin/myenm start"
stop "/bin/alt_stop"
nwamcfg:enm:myenm>exit
Committed changes
#