JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Administration: Network Interfaces and Network Virtualization     Oracle Solaris 11 Information Library
search filter icon
search icon

Document Information

Preface

1.  Overview of the Networking Stack

Network Configuration in This Oracle Solaris Release

The Network Stack in Oracle Solaris

Network Devices and Datalink Names

Administration of Other Link Types

Part I Network Auto-Magic

2.  Introduction to NWAM

3.  NWAM Configuration and Administration (Overview)

4.  NWAM Profile Configuration (Tasks)

Creating Profiles

Creating Profiles in Command-Line Mode

Interactively Creating Profiles

Creating an NCP

Creating NCUs for an NCP

How to Interactively Create an NCP

Creating a Location Profile

How to Interactively Create a Location Profile

Creating an ENM Profile

Creating WLANs

Removing Profiles

Setting and Changing Property Values for a Profile

Querying the System for Profile Information

Listing All of the Profiles on a System

Listing All Property Values for a Specific Profile

Obtaining Values of a Specific Property

How to Interactively Obtain a Single Property Value

Interactively Viewing and Changing Property Values by Using the walkprop Subcommand

Exporting and Restoring a Profile Configuration

Restoring a User-Defined Profile

Managing Network Configuration

How to Switch From Automatic Network Configuration Mode to Manual Network Configuration Mode

How to Switch From Manual Network Configuration Mode to Automatic Network Configuration Mode

5.  NWAM Profile Administration (Tasks)

6.  About the NWAM Graphical User Interface

Part II Datalink and Interface Configuration

7.  Using Datalink and Interface Configuration Commands on Profiles

8.  Datalink Configuration and Administration

9.  Configuring an IP Interface

10.  Configuring Wireless Interface Communications on Oracle Solaris

11.  Administering Bridges

12.  Administering Link Aggregations

13.  Administering VLANs

14.  Introducing IPMP

15.  Administering IPMP

16.  Exchanging Network Connectivity Information With LLDP

Part III Network Virtualization and Resource Management

17.  Introducing Network Virtualization and Resource Control (Overview)

18.  Planning for Network Virtualization and Resource Control

19.  Configuring Virtual Networks (Tasks)

20.  Using Link Protection in Virtualized Environments

21.  Managing Network Resources

22.  Monitoring Network Traffic and Resource Usage

Glossary

Index

Querying the System for Profile Information

The netcfg command can be used with the list subcommand to list all of the profiles, property-value pairs, and resources that exist at the current or specified scope. Use the list subcommand to query the system for general information about all profiles or to retrieve specific information about a particular profile. The list subcommand can be used in either interactive mode or command-line mode.

If you need to obtain information about profiles and their current state, use the netadm command with the list subcommand. For more information, see Displaying the Current State of a Profile.

Listing All of the Profiles on a System

The netcfg list command lists all of the system-defined and user-defined profiles on a system. Note that using the list subcommand without any options displays all of the top-level profiles that are on a system. The command does not list the state of each profile. To display a list of the profiles and their state (online or offline), use the netadm list command.

To list all of the top level profiles on a system, type the following command:

$ netcfg list
NCPs:
        Automatic
        User
Locations:
        Automatic
        NoNet
        home
        office
ENMs:
        myvpn
        testenm
WLANs:
        workwifi
        coffeeshop
        homewifi

In this example, the following profiles are listed:


Note - Only user-defined profiles can be created, modified, or removed.


Listing All Property Values for a Specific Profile

Use the netcfg command with the list subcommand to list all of the property values for a specified profile.

The syntax for the list subcommand is as follows:

$ netcfg list [ object-type [ class ] object-name ] 

Example 4-11 Listing All of the Property Values of an NCU

For example, to list all of the property values for an IP NCU in the User NCP, you would type the following command:

$ netcfg "select ncp User; list ncu ip net0"
NCU:net0
        type                    interface
        class                   ip
        parent                  "User"
        enabled                 true
        ip-version              ipv4
        ipv4-addrsrc            dhcp
        ipv6-addrsrc            dhcp,autoconf

Example 4-12 Listing All of the Property Values of an ENM

In the following example, all of the properties for an ENM named myenm are listed.

$ list enm myenm
ENM:myenm
activation-mode manual
enabled         true
start           "/usr/local/bin/myenm start"
stop            "/bin/alt_stop"

In this example, the output of the list subcommand displays the following information:

Obtaining Values of a Specific Property

You can use the netcfg command with the get subcommand to obtain the specific value for a specified property. This subcommand can be used in either interactive mode or command-line mode.

The syntax for the get subcommand is as follows:

netcfg get [ -V ] prop-name

To obtain the value of the ip-version property of an NCU named myncu, which is a part of the User NCP, you would type the following command. For example:

$ netcfg "select ncp User; select ncu ip myncu; get -V ip-version"
ipv4

If the -V option is used with the get subcommand, only the property value is displayed, as shown here:

netcfg:ncp:User:ncu:net0> get -V activation-mode
manual

Otherwise, both the property and its value are displayed. For example:

netcfg:ncp:User:ncu:net0> get activation-mode
activation-mode        manual

How to Interactively Obtain a Single Property Value

This procedure describes how to obtain a single property value by using the netcfg get command while in the netcfg interactive mode. In this particular procedure, some of the examples show how to obtain a single property value for an NCU in the User NCP. These examples are used for demonstration purposes only. The information that you provide when using this command would vary, depending on the profile and the property value that you attempt to retrieve.

If you want to view all of the property values for a profile, you can alternately use the walkprop subcommand. This subcommand walks you through all of the properties of a given profile, one at a time, enabling you to modify one or all of the profile's properties. For more information, see Interactively Viewing and Changing Property Values by Using the walkprop Subcommand .

  1. Initiate an netcfg interactive session.
    $ netcfg
    netcfg>
  2. Select the profile or configuration object that contains the property value that you want to obtain.
    netcfg> select object-type [ class ] object-name

    Note - The class parameter is applicable only if you are selecting an NCU. Also, the class parameter must be specified if both the phys and ip class NCU share the same name. However, if the NCU name is unique, the class parameter is not required.


    For example, to select the User NCP, you would type:

    netcfg> select User NCP

    In this example, selecting the User NCP moves the interactive session into the selected object's scope.

  3. (Optional) Display the components of the profile.
    netcfg:ncp:User> list
    NCUs:
            phys    net0
            ip      net0
  4. Select the object that contains the property value that you want to obtain.

    In the following example, the link (phys) NCU net0 in the User NCP is selected:

    netcfg:ncp:User> select ncu phys net0

    Selecting the NCU net0 moves the interactive session to that object's scope and loads the current properties for the NCU from memory.

  5. Obtain the specified property value.
    netcfg:ncp:User:ncu:net0> get property-value

    For example, to obtain the value of the activation-mode property, you would type:

    netcfg:ncp:User:ncu:net0> get activation-mode
            activation-mode         manual

Next Steps

At this point, you can set a new value for the property by using the set subcommand, or you can exit the interactive session without making any changes. Note that if you modify a property value while in interactive mode, you must use the commit or exit subcommand to save your changes. For information about setting a property value in netcfg interactive mode, see Setting and Changing Property Values for a Profile.

Interactively Viewing and Changing Property Values by Using the walkprop Subcommand

The walkprop subcommand can be used interactively to view the properties of a profile. This subcommand “walks” you through a profile, one property at a time, displaying the name and current value for each property. An interactive command prompt is also displayed, that you can use to change the current value of the specified property. The delimiter for multi-valued properties is a comma (,). If an individual value for a given property contains a comma, it must be preceded it with a backslash (\). Commas within properties that only have a single value are not interpreted as delimiters and do not need to be preceded by a backslash.


Note - The walkprop subcommand is meaningful when used in interactive mode only.


Example 4-13 Viewing and Changing Property Values for a Specific Profile

In the following example, the activation-mode property for the location foo is viewed and then changed by using the walkprop subcommand. Note that when using the walkprop subcommand, you do not need to use the set subcommand to set the property value.

$ netcfg
netcfg> select loc foo
netcfg:loc:foo> list
loc:foo
        activation-mode                 manual
        enabled                         false
        nameservices                    dns
        nameservices-config-file        "/etc/nsswitch.dns"
        dns-nameservice-configsrc       dhcp
        nfsv4-domain                    "Central.oracle.com"
netcfg:loc:foo> walkprop
activation-mode (manual) [manual|conditional-any|conditional-all]> conditional-all
conditions> advertised-domain is oracle.com 
nameservices (dns) [dns|files|nis|ldap]>
nameservices-config-file ("/etc/nsswitch.dns")>
dns-nameservice-configsrc (dhcp) [manual|dhcp]>
nfsv4-domain ("Central.oracle.com")>
ipfilter-config-file>
ipfilter-v6-config-file>
ipnat-config-file>
ippool-config-file>
ike-config-file>
ipsecpolicy-config-file>
netcfg:loc:foo> list
loc:foo
        activation-mode                 conditional-all
        conditions                      "advertised-domain is oracle.com"
        enabled                         false
        nameservices                    dns
        nameservices-config-file        "/etc/nsswitch.dns"
        dns-nameservice-configsrc       dhcp
        nfsv4-domain                    "Central.oracle.com"
netcfg:loc:foo> commit
Committed changes
netcfg:loc:foo> end
netcfg> exit
$

Note - Only relevant properties are walked. For example, if the ipv4-addrsrc property is set to static, the ipv4-addr property is included in the walk. However, if ipv4-addrsrc is set to dhcp, the ipv4-addr property is not walked.