Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Administration: Network Interfaces and Network Virtualization Oracle Solaris 11 Express 11/10 |
2. NWAM Configuration and Administration (Overview)
3. NWAM Profile Configuration (Tasks)
Creating Profiles in Command-Line Mode
Interactively Creating Profiles
Creating NCUs for a User-Defined NCP
How to Interactively Create a User-Defined NCP
How to Interactively Create a Location Profile
Setting and Changing Property Values of 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
Managing the NWAM Service Through SMF
How to Switch From Autoconfiguration Mode to Traditional Networking Mode
How to Switch From Traditional Networking Mode to Autoconfiguration Mode
4. NWAM Profile Administration (Tasks)
5. About the NWAM Graphical User Interface
Part II Administering Single Interfaces
6. Overview of the Networking Stack
7. Datalink Configuration and Administration
8. Configuring an IP Interface
9. Configuring Wireless Interface Communications on Oracle Solaris
Part III Administering Interface Groups
11. Administering Link Aggregations
Part IV Network Virtualization and Resource Management
15. Introducing Network Virtualization and Resource Control (Overview)
16. Planning for Network Virtualization and Resource Control
17. Configuring Virtual Networks (Tasks)
18. Using Link Protection in Virtualized Environments
19. Managing Network Resources
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:
$ nwamcfg 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 3-13 Displaying a Profile Configuration
In the following example, the export subcommand is used to display a system's profile configuration to the screen.
$ nwamcfg nwamcfg> 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 "wpi0" set priority=0 set bssids="0:13:10:73:4e:2" end nwamcfg> end $
Example 3-14 Exporting a Profile Configuration in Interactive 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 export output.
$ nwamcfg nwamcfg> 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 "wpi0" set priority=0 set bssids="0:13:10:73:4e:2" end nwamcfg> end $
Example 3-15 Exporting a Profile Configuration in Command-File Mode
In the following example, the configuration information for the User NCP is written to a file by using the nwamcfg export command with the -f option. The -f option writes the output to a new file named user2.
$ nwamcfg export -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 .. drwx------ 3 root root 3 Oct 5 16:15 .sunw -rw-r--r-- 1 root root 352 Oct 14 10:53 user2 $
You can restore user-defined profiles by using the nwamcfg command with the -f option, as follows:
$ nwamcfg -f user2
This command executes the command file that contains the exported configuration by assuming that the profile that is to be restored no longer exists.