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

Exporting and Restoring a Profile Configuration

You can use the export subcommand to save and restore profile configurations. Exporting a profile can be useful for system administrators who are responsible for maintaining multiple servers that require identical network configurations. The export subcommand can be used in either interactive or command-line mode. Or, you can use the command in command-file mode to specify a file as the output of the command.

The command syntax for the export subcommand is as follows:

$ netcfg export [ -d ] [ -f output-file ] [ object-type [ class ] object-name ]

Note - The -d and -f options of the export subcommand can be used independently of each other.


Example 4-14 Exporting a Profile Configuration

In the following example, the export subcommand is used to display a system's profile configuration on the screen.

$ netcfg
netcfg> export
create ncp "User"
create ncu ip "net2"
set ip-version=ipv4
set ipv4-addrsrc=dhcp
set ipv6-addrsrc=dhcp,autoconf
end
create ncu phys "net2"
set activation-mode=manual
set link-mtu=5000
end
create ncu phys "wpi2"
set activation-mode=prioritized
set priority-group=1
set priority-mode=exclusive
set link-mac-addr="13:10:73:4e:2"
set link-mtu=1500
end
end
create loc "test"
set activation-mode=manual
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domainl.oracle.com"
end
create loc "foo"
set activation-mode=conditional-all
set conditions="system-domain is oracle.com"
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.oracle.com"
end
create enm "myenm"
set activation-mode=conditional-all
set conditions="ip-address is-not-in-range 1.2.3.4"
set start="/my/start/script"
set stop="/my/stop/script"
end
create wlan "mywlan"
set priority=0
set bssids="0:13:10:73:4e:2"
end
netcfg> end
$

Example 4-15 Exporting a Profile Configuration in netcfgInteractive Mode

In the following example, the -d option is used with the export subcommand. The -d option adds the destroy -a command as the first line of the netcfg export output.

$ netcfg
netcfg> export -d
destroy -a
create ncp "User"
create ncu ip "net2"
set ip-version=ipv4
set ipv4-addrsrc=dhcp
set ipv6-addrsrc=dhcp,autoconf
end
create ncu phys "net2"
set activation-mode=manual
set link-mtu=5000
end
create ncu phys "wpi2"
set activation-mode=prioritized
set priority-group=1
set priority-mode=exclusive
set link-mac-addr="13:10:73:4e:2"
set link-mtu=1500
end
end
create loc "test"
set activation-mode=manual
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.oracle.com"
end
create loc "foo"
set activation-mode=conditional-all
set conditions="system-domain is oracle.com"
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.oracle.com"
end
create enm "myenm"
set activation-mode=conditional-all
set conditions="ip-address is-not-in-range 1.2.3.4"
set start="/my/start/script"
set stop="/my/stop/script"
end
create wlan "mywlan"
set priority=0
set bssids="0:13:10:73:4e:2"
end
netcfg> end
$

Example 4-16 Exporting a Profile Configuration in netcfg Command-File Mode

In the following example, the configuration information for the User NCP is written to a file by using the netcfg export command with the -f option. The -f option writes the output to a new file named user2. The -d option adds the destroy -a command as the first line of the netcfg export output.

$ netcfg export -d -f user2 ncp User
$ ls -al
drwx------   3 root     root           4 Oct 14 10:53 .
drwxr-xr-x  37 root     root          40 Oct 14 10:06 ..

-rw-r--r--   1 root     root         352 Oct 14 10:53 user2
$
$ cat user2
destroy -a
create ncp "User"
create ncu ip "net2"
set ip-version=ipv4
set ipv4-addrsrc=dhcp
set ipv6-addrsrc=dhcp,autoconf
end
create ncu phys "net2"
set activation-mode=manual
set link-mtu=5000
end
create ncu phys "wpi2"
set activation-mode=prioritized
set priority-group=1
set priority-mode=exclusive
set link-mac-addr="13:10:73:4e:2"
set link-mtu=1500
end
end
create loc "test"
set activation-mode=manual
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.oracle.com"
end
create loc "foo"
set activation-mode=conditional-all
set conditions="system-domain is oracle.com"
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.oracle.com"
end
create enm "myenm"
set activation-mode=conditional-all
set conditions="ip-address is-not-in-range 1.2.3.4"
set start="/my/start/script"
set stop="/my/stop/script"
end
create wlan "mywlan"
set priority=0
set bssids="0:13:10:73:4e:2"
end
$

Restoring a User-Defined Profile

You can restore a user-defined profile by using the netcfg command with the -f option, as follows:

$ netcfg [ -f ] profile-name

For example:

$ netcfg -f user2

This command executes the command file that contains the exported configuration.