Solaris DHCP Administration Guide

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'