Configuring and Administering Network Components in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014

Creating NCUs for an NCP

The NCP is essentially a container that consists of a set of NCUs that are configured with properties that define the network configuration for the NCP. All NCPs contain both link and interface NCUs.

Link NCUs specify both the link configuration and the link selection policy for the NCP. Interface NCUs specify the interface configuration policy for the NCP. If IP connectivity is required, both a link and an interface NCU are required. NCUs must be explicitly added or removed by using the netcfg command or by using the Network Administration GUI. For more information about adding and removing NCUs by using the Network Administration GUI, see the Administering Network Configuration From the Desktop.

You create NCUs by using the netcfg command either interactively or in command-line mode. Because creating an NCU involves several operations, it is easier and more efficient to create NCUs interactively, rather than trying to construct a single-line command that creates the NCU and all of its properties. NCUs can be created when you initially create an NCP or afterward. The process of creating or modifying an NCU involves setting general NCU properties, as well as setting properties that specifically apply to each NCU type.

When you create an NCU interactively, the netcfg command walks you through each relevant property for the NCU, displaying both the default value (when a default exists) and all possible values. For example, if you specify dhcp for the ipv4-addrsrc property of an interface NCU, you are not prompted to specify a value for the ipv4-addr property because this property is used for a static IP address configuration only. You can specify alternate values for each property at the interactive prompt. Pressing Return without specifying a value re-applies the default value or leaves the property empty if there is no default value.

There are several NCU properties that you can specify when creating or modifying an NCU. Some properties apply to both NCU types, while others apply to either a link NCU or an interface NCU. For a complete description of all of the NCU properties, including rules and conditions that might apply when specifying these properties, see the netcfg(1M) man page.

How to Create NCUs for an NCP Interactively

The following procedure describes how to select an existing NCP and then create NCUs for the NCP interactively.

Note -  The “walk” process that is performed during the initial profile creation ensures that when modifying the NCP you are prompted for only those properties that are applicable, given the choices you made during its creation.
  1. Initiate the netcfg interactive session.
    $ netcfg
  2. Select an existing NCP.

    In the following example, the NCP myncp is selected:

    netcfg> select ncp myncp

    Selecting the NCP automatically takes you into that NCP's scope. For a Location, an ENM, or a WLAN object, the command prompt would take you into the profile scope for that profile.

  3. Create the link and interface NCUs for the NCP.

    In the following example, a link NCU is created:

    netcfg:ncp:myncp> create ncu phys net0
    Created ncu `net0'. Walking properties ...
    activation-mode (manual) [manual|prioritized]>
    mtu> 1600

    where ncu is the object type, phys is the class of NCU, and net0 is the object name.

    Creating an NCU moves you into that object's scope and walks you through the default properties for the object.

      In this example, the following properties are specified:

    • The activation-mode property, which defaults to manual, is accepted by pressing Return.

    • The mac-address and autopush properties are left empty.

    • The mtu property is set to a value of 1600.

    The following example shows how to create an interface NCU:

    netcfg:ncp:myncp> create ncu ip net0
    Created ncu `net0'. Walking properties ...
    ip-version (ipv4,ipv6) [ipv4|ipv6]> ipv4
    ipv4-addrsrc (dhcp) [dhcp|static]> dhcp

    where ncu is the object type, ip is the object class, and net0 is the object name.

    Creating an NCU moves you into that object's scope and walks you through the default properties for the object.

      In this example, the following properties are specified:

    • The ip-version property is set to ipv4.

    • The ipv4-addrsrc property is set to dhcp.

    During the creation of an NCU, the class option is used to differentiate between the two types of NCUs.

  4. (Optional) Verify that the configuration is correct as follows:
    netcfg:ncp:myncp:ncu:net0> verify
    All properties verified

    The verify subcommand verifies the configuration and notifies you if any of the required values are missing.

  5. Save each NCU that you create.
    • Use the commit subcommand:
      netcfg:ncp:myncp:ncu:net0> commit
      Committed changes

      The commit subcommand implicitly verifies the properties.

    • Use the end subcommand:
      netcfg:ncp:myncp:ncu:net0> end
      Committed changes

      The end subcommand implicitly commits the changes.

      In this instance, if you are done adding NCUs to the NCP, the end subcommand moves the session to the NCP scope.

    In the interactive mode, changes are not saved to persistent storage until you commit them. When you use the commit subcommand, the entire profile is committed. To maintain the consistency of persistent storage, the commit operation also includes a verification step. If the verification fails, the commit operation also fails. If an implicit commit fails, you are given the option of ending or exiting the interactive session without committing the current changes. Alternatively, you can remain in the current scope and continue making changes to the profile.

    Note -  To cancel the changes that you made, use the cancel or the revert subcommand.

    The cancel subcommand ends the current profile configuration without committing the current changes to persistent storage, then moves the interactive session up one scope level. The revert subcommand undoes the changes that you made and rereads the previous configuration. When you use the revert subcommand, the interactive session stays within the same scope.

  6. When you are finished, exit the interactive session.
    netcfg:ncp:myncp> exit

    The exit subcommand is similar to the end subcommand but also exits the interactive session.