Solaris DHCP Administration Guide

Moving Configuration Data Between DHCP Servers

The DHCP Manager and dhcpconfig utilities enable you to move some or all the DHCP configuration data from one Solaris DHCP server to another. You can move entire networks and all the addresses, macros, and options associated with it, or select specific IP addresses, macros, and options to move. You can also copy useful macros or options without removing them from the first server when you specify to keep the data on the server.

You might want to move data if you are going to do any of the following tasks:

Moving DHCP configuration data is a three-part process in which you:

  1. Export the data from the first server

  2. Import the data to the second server

  3. Modify the imported data for the new server environment

In DHCP Manager, you use the Export Data wizard and Import Data wizard to move the data from one server to the other, and modify macros in the Macros tab, as explained in How to Move Configuration Data Between DHCP Servers (DHCP Manager). The following figures show the initial dialog boxes for the wizards.

Figure 4–20 Export Data Wizard Dialog Box

Graphic

Figure 4–21 Import Data Wizard Dialog Box

Graphic

If you prefer to use commands, export the data by using dhcpconfig -E, then import by using dhcpconfig -I. Modify the network tables by using pntadm and macros by using dhtadm as explained in How to Move Configuration Data Between DHCP Servers (dhcpconfig).

How to Move Configuration Data Between DHCP Servers (DHCP Manager)

  1. Become superuser on the server from which you want to move or copy data.

  2. Choose Export Data on the Service menu.

  3. Answer the wizard's prompts.

    If you have difficulty, click Help for detailed information about the prompts.

  4. Move the export file to a file system that is accessible to the DHCP server to which you want to move the data.

  5. Become superuser on the server to which you want to move the data.

  6. In DHCP Manager, choose Import Data from the Service menu.

  7. Answer the wizard's prompts.

    If you have difficulty, click Help for detailed information about the prompts.

  8. When the data is imported, examine imported data for network–specific information that needs modification.

    For example, if you moved networks, you must open the Addresses tab and change the owning server of addresses in the imported networks. You might also need to open the Macros tab to specify the correct domain names for NIS, NIS+ or DNS in the macros that specify them.

  9. Open the Addresses tab and select a network that you imported.

  10. To select all the addresses, click the first address, press and hold the Shift key, and click the last address.

  11. From the Edit menu, choose Properties.

    The Modify Multiple Addresses dialog box opens.

  12. At the Managing Server prompt, select the new server's name.

  13. At the Configuration Macro prompt, select the macro that should be used for all clients on this network.

  14. Click OK.

  15. Open the Macros tab.

  16. Use the Find facility at the bottom of the window to locate the options that are likely to need modified values.

    DNSdmain, DNSserv, NISservs, NIS+serv, and NISdmain are examples of options that might need modification on the new server.

  17. When you locate an option that needs to be changed, select the macro name and choose Properties from the Edit menu and change its value.

How to Move Configuration Data Between DHCP Servers (dhcpconfig)

  1. Become superuser on the server from which you want to move or copy data.

  2. Type a command of the following format:


    # /usr/sbin/dhcpconfig -X filename -a network-addresses -m macros -o options
    

    where filename is the full path name you want to use to store the compressed exported data. You can use the keyword ALL with the command options to export all the networks, macros, or options. For example:

    # /usr/sbin/dhcpconfig -X dhcp2465_data -a ALL -m ALL -o ALL
    

    Alternatively, you can specify particular network addresses, macros, and configuration options in comma-separated lists. For example:

    # /usr/sbin/dhcpconfig -X dhcp2465_data -a 24.63.0.0,24.62.0.0 \
    -m 24.63.0.0,24.62.0.0,SUNW.Ultra-5_10 -o Sterm
    

    See the dhcpconfig man page for more information about the dhcpconfig command.

  3. Move the file that contains the exported data to a location that is accessible to the server to which you want to move the data.

  4. Become superuser on the server to which you want to import the data.

  5. Type a command of the following format:


    # /usr/sbin/dhcpconfig -I filename
    

    where filename is the name of the file that contains the data exported from the first server.

  6. When the import is completed, examine the network tables for data that needs to be modified.

    If you moved networks, use pntadm -P network_address to print out the network tables for the networks you moved. You might need to change the owning server and the configuration macro used for these addresses. For example, to change the owning server (24.60.3.4) and macro (dhcpsrv-2460) for address 24.63.0.2, you would use the following command:

    pntadm -M 24.63.0.2 -s 24.60.3.4 -m dhcpsrv-2460 24.60.0.0

    If you have a large number of addresses, you should create a script file that contains commands to modify each address, and then execute the script with the pntadm -B command, which runs pntadm in batch mode. See the pntadm man page.

  7. Examine the dhcptab macros for options with values that need modification.

    Use dhtadm -P to print the entire dhcptab, and use grep or some other tool to search for particular options or values that you might want to change. Then use dhtadm -M to modify values. For example, you might need to modify some macros to specify the correct domain names and servers for NIS, NIS+ or DNS. For example, the following command changes the values of DNSdmain and DNSserv in the macro mymacro:

    dhtadm -M -m mymacro -e 'DNSserv=dnssrv2:DNSdmain=blue.net'