netadm - administer network configuration profiles
netadm enable [ -p profile-type ] [ -c ncu-class ] profile-name
netadm disable [ -p profile-type ] [ -c ncu-class ] profile-name
netadm list [ -x ] [ -p profile-type ] [ -c ncu-class ] [ profile-name ]
netadm scan-wifi linkname
netadm select-wifi linkname
The netadm utility is used to administer network profiles and interact with the NWAM daemon.
There are three types of network profiles: Network Configuration Profiles (NCPs), Locations, and External Network Modifiers (ENMs).
At any given time, there is one active NCP and one active Location on a system. Enabling a different NCP or Location (with activation-mode manual) will implicitly disable the current active NCP or Location. The current Location (if its activation-mode is manual) can also be disabled, though the effect of this will be to “turn off” some aspects of the system's networking capabilities, such as name services. Explicitly disabling an NCP is not permitted, as that would effectively shut down the basic network connectivity of the system. An NCP is only disabled implicitly when a different NCP is enabled.
An NCP is only disabled implicitly when a different NCP is enabled; the disable/enable process first shuts down all network connectivity, and then restores it according to the configuration specified in the new NCP.
Conversely, there can be zero or more active ENMs at any given time. Thus enabling or disabling one ENM has no effect on other active ENMs.
Enabling and disabling of individual NCUs is also allowed; the specified NCU must be part of the currently active NCP, and must have its activation mode set to manual. If an NCU class is not specified, all NCUs (one link and/or one interface) with the given name will be enabled or disabled.
Enabling and disabling of objects is performed asynchronously. Thus, the request to enable or disable can succeed, while the action itself fails. A failure of this sort will be reflected in the object state; maintenance state indicates that the last action taken failed. Note that enabling NCPs and locations in particular can be time-consuming, depending on the configuration. Completion can be verified by checking the state of the appropriate SMF service (svc:network/physical:default for NCPs, and svc:network/location:default for locations). The state of the individual NCUs that make up an NCP may also be verified with the netadm list command.
There are two system-defined NCPs: DefaultFixed, and Automatic. The DefaultFixed NCP represents a manually configured network environment, while Automatic is the default NWAM-managed environment, which attempts to configure all connected physical interfaces using DHCP. You can use netcfg(1M) to create additional NWAM-managed NCPs.
The following subcommands are supported:
Enable the specified profile. If the profile name is not unique, the profile type must be specified to identify the profile to be enabled. If the profile type is NCU and the name is not unique (that is, there is both a link and interface NCU with the same name), both NCUs will be enabled, unless the –c option is used to specify the NCU class. Profile type must be one of ncp, ncu, loc, or enm; NCU class must be one of phys or ip.
Disable the specified profile. If the profile name is not unique, the profile type must be specified to identify the profile to be disabled. If the profile type is NCU and the name is not unique (that is, there is both a link and interface NCU with the same name), both NCUs will be disabled, unless the –c option is used to specify the NCU class. Profile type must be one of ncu, loc, or enm; NCU class must be one of phys or ip.
List all available profiles and their current state. If a particular profile is specified by name, list only the current state of that profile. If the profile name is not unique, all profiles with the given name will be listed; or the profile type and/or NCU class can be included to identify a specific profile. If only a type is provided, list all profiles of that type. Listing the active NCP will include the NCUs that make up that NCP.
The –x option causes the list subcommand to display a fourth column of output, headed AUXILIARY STATE, after the first three column headings in the default display, TYPE, PROFILE, and STATE. The AUXILIARY STATE column shows why a profile is in a given state.
Possible STATE values are:
A manually-activated profile that has not been activated.
A conditionally- or system-activated profile that has not been activated. It might not be active because its conditions have not been satisfied; or it might be that another profile has more specific conditions that are met and has been activated instead (in the case of profile types that must be activated one at a time, such as Locations).
A conditionally- or system-activated profile whose conditions have been met and that has been successfully activated; or a manually-activated profile that has been successfully activated at the request of the user.
Activation of the profile was attempted, but failed.
The profile represents a valid configuration object for which no action has yet been taken.
The profile represents a configuration object not present in the system; for example, an NCU corresponding to a physical link that has been removed.
Listen for stream of events from the NWAM daemon and display them.
Initiate a wireless scan on link linkname.
Select a wireless network to connect to from scan results on link linkname. Prompts for selection, WiFi key, and so forth, if necessary.
Display a usage message with short descriptions for each subcommand.
The following command enables a user-specified location.
# netadm enable -p loc office Disabled loc 'home'. Enabled loc 'office'Example 2 Disabling an ENM
The following command disables an ENM.
# netadm disable -p enm myvpn Disabled enm 'myvpn'.Example 3 Listing All NCPs
The following command lists all NCPs.
# netadm list -xp ncp TYPE PROFILE STATE AUXILIARY STATE ncp Automatic disabled disabled by administrator ncp User online active ncu:phys nge0 online interface/link is up ncu:ip nge0 online interface/link is up ncu:phys nge1 offline interface/link is down ncu:ip nge1 offline conditions for activation are unmetExample 4 Listing NCUs in Active NCP
The following command lists all ip NCUs in the active NCP.
# netadm list -c ip TYPE PROFILE STATE ncu:ip bge0 online ncu:ip bge1 disabledExample 5 Forcing a Scan
The following command forces a scan on the wireless interface wpi0.
# netadm scan-wifi wpi0Example 6 Selecting a WiFi Network
The following command selects a WiFi network that is broadcasting its ESSID.
# netadm select-wifi wpi0 1: ESSID testing BSSID 0:40:96:29:e9:d8 2: ESSID sunwifi BSSID 0:b:e:9f:b5:80 3: ESSID sunwifi BSSID 0:b:e:85:26:c0 4: ESSID sunwifi BSSID 0:b:e:49:2f:80 5: Other Choose WLAN to connect to [1-5]: 2 #Example 7 Selecting a WiFi Network (Alternative)
The following command selects a WiFi network that is not broadcasting its ESSID.
# netadm select-wifi wpi0 1: ESSID testing BSSID 0:40:96:29:e9:d8 2: ESSID sunwifi BSSID 0:b:e:85:26:c0 3: ESSID sunwifi BSSID 0:b:e:9f:b5:80 4: ESSID sunwifi BSSID 0:b:e:49:2f:80 5: ESSID sunwifi BSSID 0:b:e:49:62:c0 6: Other Choose WLAN to connect to [1-6]: 6 Enter WLAN name: oraclewifi 1: None 2: WEP 3: WPA Enter security mode: 2 Enter WLAN key for ESSID oraclewifi: 123456 Enter key slot [1-4]: 1 #Example 8 Monitoring nwamd
The following command monitors nwamd(1M) when switching locations.
# netadm show-events EVENT DESCRIPTION OBJECT_ACTION loc Automatic -> action refresh OBJECT_STATE loc Automatic -> state offline*, method/service executi OBJECT_STATE loc Automatic -> state online, active OBJECT_ACTION loc home -> action refresh OBJECT_ACTION loc NoNet -> action refresh OBJECT_ACTION loc User -> action refresh OBJECT_ACTION loc home -> action enable OBJECT_STATE loc home -> state offline*, method/service executing OBJECT_STATE loc Automatic -> state offline, conditions for activati OBJECT_STATE loc home -> state online, active ^C #
See attributes(5) for descriptions of the following attributes:
See also nwam-manager(1M), available in the JDS/GNOME man page collection.