JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Connecting Systems Using Reactive Network Configuration in Oracle Solaris 11.1     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Reactive Network Configuration (Overview)

2.  Creating and Configuring Reactive Network Profiles (Tasks)

3.  Administering Your Reactive Network Configuration (Tasks)

Switching Between Fixed and Reactive Network Configurations

How to Switch From Reactive Network Configuration to Fixed Network Configuration

How to Switch From Fixed Network Configuration to Reactive Network Configuration

Displaying Information About Profile States

Displaying the Current State of a Profile

Displaying Auxiliary State Values

Exporting and Restoring a Profile Configuration

Restoring a User-Defined Profile

Removing Profiles

Performing a Wireless Scan and Connecting to Available Wireless Networks

Troubleshooting Reactive Network Configuration Issues

Monitoring the Current State of All Network Connections

Troubleshooting Network Interface Configuration Issues

4.  Using the Network Administration Graphical User Interface

Index

Exporting and Restoring a Profile Configuration

You can use the export subcommand of the netcfg command 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 mode or command-line mode. Alternatively, you can use the command in command-file mode to specify a file as the output of the command.


Note - The export feature is of limited use for some configurations. You can only export or restore configuration objects that are initially created by the netcfg command. You cannot export the configuration objects of an NCP that were created by using the dladm or ipadm command, such as aggregations or IPMP groups. Also, you cannot export or restore the DefaultFixed NCP and Location profiles.


The command syntax for the export subcommand is as follows:

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

where output-file is the output file name, object-type is the profile type, class is the NCU class, and object-name is the profile name.

For information about the netcfg subcommands, see netcfg Subcommands.


Note - The -d and -f options of the export subcommand can be used independently of each other. The -f option prints the current configuration at the current or specified scope to standard output, or to a file specified. The -d option generates a destroy -a as the first line of output.


Example 3-2 Exporting a Profile Configuration in netcfg Interactive Mode

In the following example, the export subcommand of the netcfg command is used to display a system's profile configuration onscreen.

$ 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 mtu=5000
end
create ncu phys "wpi2"
set activation-mode=prioritized
set priority-group=1
set priority-mode=exclusive
set mac-address="13:10:73:4e:2"
set 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.example.com"
end
create loc "test-loc"
set activation-mode=conditional-all
set conditions="system-domain is example.com"
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.example.com"
end
create enm "myenm"
set activation-mode=conditional-all
set conditions="ip-address is-not-in-range 10.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 3-3 Exporting a Profile Configuration in netcfg Interactive Mode With the -d Option

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 mtu=5000
end
create ncu phys "wpi2"
set activation-mode=prioritized
set priority-group=1
set priority-mode=exclusive
set mac-address="13:10:73:4e:2"
set 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.example.com"
end
create loc "test-loc"
set activation-mode=conditional-all
set conditions="system-domain is example.com"
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.example.com"
end
create enm "myenm"
set activation-mode=conditional-all
set conditions="ip-address is-not-in-range 10.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 3-4 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 mtu=5000
end
create ncu phys "wpi2"
set activation-mode=prioritized
set priority-group=1
set priority-mode=exclusive
set mac-address="13:10:73:4e:2"
set 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.example.com"
end
create loc "test-loc"
set activation-mode=conditional-all
set conditions="system-domain is example.com"
set nameservices=dns
set nameservices-config-file="/etc/nsswitch.dns"
set dns-nameservice-configsrc=dhcp
set nfsv4-domain="domain.example.com"
end
create enm "myenm"
set activation-mode=conditional-all
set conditions="ip-address is-not-in-range 10.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 an exported configuration 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.