07-System Volume

16-Automatic Configuration

Chapters Download  (108.81 KB)

16-Automatic Configuration


When configuring automatic configuration, go to these sections for information you are interested in:

l          Introduction to Automatic Configuration

l          Typical Networking of Automatic Configuration

l          How Automatic Configuration Works

Introduction to Automatic Configuration

Automatic configuration enables a device to automatically obtain and execute the configuration file when it starts up without loading the configuration file.

Automatic configuration simplifies network configuration, facilitating centralized management of devices. Currently, enterprise networks are facing the problems of large distribution of devices and less administrators, resulting in the huge cost for administrators to manually configure each device. With the automatic configuration function, network administrators can save the configuration files on a specified server and the device can automatically obtain and execute the configuration files, therefore greatly reducing the workload of administrators.

Typical Networking of Automatic Configuration

Figure 1-1 Network diagram for automatic configuration

 

As shown in Figure 1-1, the device implements automatic configuration with the cooperation of a DHCP server, TFTP server and DNS server:

l          DHCP server: Assigns an IP address, configure file name, TFTP server IP address, and DNS server IP address for the device that performs automatic configuration.

l          TFTP server: Saves files needed in automatic configuration. A device obtains files needed from a TFTP server, for example, network intermediate file and the configuration file of the device.

l          DNS server: Used for IP address-to-host name resolution. A device that performs automatic configuration can resolve an IP address to a host name through a DNS server to get the configuration file with the name hostname.cfg from a TFTP server; if the device gets the domain name of the TFTP server from a DHCP response, the device can also resolve the domain name of the TFTP server to the IP address of the TFTP server through the DNS server.

If the DHCP server, TFTP server, DNS server, and the device that performs automatic configuration are not in the same segment, you need to configure DHCP relay on a device working as a gateway.

How Automatic Configuration Works

Basically, automatic configuration works in the following ways:

1)        When a device starts up without loading any configuration file, the system sets the first active interface as the DHCP client to request from the DHCP server for parameters, such as an IP address and name of a TFTP server, IP address of a DNS server, and the configuration file name.

2)        After getting related parameters, the device will send a TFTP request to obtain the configuration file from the specified TFTP server for system initialization. If the client cannot get such parameters, it performs system initialization without loading any configuration file.

 

l          To implement auto-configuration, you need to configure some parameters on the DHCP server, DNS server and TFTP server, but you do not need to perform any configuration on the device that starts up without loading any configuration file. The configuration mode depends on the device model; it is omitted here.

l          If you need to use the automatic configuration function, you are recommended to connect only the interfaces needed in automatic configuration to the network.

 

Work Flow of Automatic Configuration

The work flow of automatic configuration is as shown in Figure 1-2.

Figure 1-2 Work flow of automatic configuration

 

Obtaining the IP Address of an Interface and Related Information Through DHCP

Obtaining an IP address

When a device starts up without loading the configuration file, the system automatically configures the first active interface of the device as obtaining its IP address through DHCP. The device broadcasts a DHCP request through this interface. The Option 55 field specifies the information (for example, the configuration file name, domain name and IP address of the TFTP server and DNS server needed for obtaining the automatic configuration files) that the device can obtain from the DHCP server.

Upon successfully obtaining its IP address through DHCP, the device resolves the Option 67 (or the file field, configuration file name) field, Option 66 (domain name of the TFTP server) field, Option 150 (IP address of the TFTP server) field and Option 6 (IP address of the DNS server) field. If failing to obtain its IP address, the device removes the temporary configuration and starts up without loading the configuration file.

 

l          The configuration file name is saved in the Option 67 or file field of the DHCP response. The device first resolves the Option 67 field; if this field contains the configuration file name, the device does not resolve the file field; otherwise, it resolves the file field.

l          Temporary configuration contains two parts: the configuration on the interface where automatic configuration is performed when the device starts up with default configuration; and the executed ip host command when the device is resolving the network intermediate file (For the detailed description of the ip host command, refer to Domain Name Resolution Commands in the IP Services Volume.). Removal of the temporary configuration is to execute the undo commands.

 

Principles for selecting an address pool on the DHCP server

The DHCP server selects IP addresses and other network configuration parameters from an address pool when assigning an IP address to a client. DHCP supports two mechanisms for IP address allocation.

l          Dynamic address allocation: The DHCP server assigns an IP address and other configuration parameters in an address pool to a client.

l          Manual address allocation: The DHCP server will select an address pool where an IP address is statically bound to the MAC address or ID of the client and assign the statically bound IP address and other configuration parameters to the client.

You can configure an address allocation mode as needed:

l          Different devices with the same configuration file: You can configure dynamic address allocation on the DHCP server to assign IP addresses and the same configuration parameters (for example, configuration file name) to the devices. If this address allocation mode is adopted, the configuration file can only contain common configurations of the devices, and the specific configurations of each device need to be performed in other ways. For example, you need to specify to enable Telnet on a device through the configuration file obtained in automatic configuration and create a local user to facilitate the administrator to Telnet to each device to perform specific configurations (for example, configure the IP address of each interface).

l          Different devices with different configuration files: You need to configure an address pool where an IP address is statically bound to the MAC address or ID of the client, to ensure that a specific client can be assigned with a fixed IP address and other configuration parameters. Through this address allocation mode, you can specify different configuration commands for each device, without the need to configure the device through other modes.

 

You need to configure a client ID (when a device works as the DHCP client, it uses the client ID as its ID) of the static binding when you configure manual address allocation. Therefore, you need to obtain the client ID in this way: start the device that performs automatic configuration, enable the interface that performs automatic configuration to obtain its IP address through DHCP, after the IP address is successfully obtained, use the display dhcp server ip-in-use command to display address binding information on the DHCP server, thus to obtain the client ID of the device.

 

Obtaining the Configuration File from the TFTP Server

Configuration file type

The device can obtain the following types of configuration file from the TFTP server with the automatic configuration function enabled:

l          The configuration file specified by the Option 67 or file field in the DHCP response

l          The intermediate file, with the file name as network.cfg, used to save the mapping between the IP address and the host name. The mapping is defined in the following format:

ip host hostname ip-address

For example, the intermediate file can include the following:

 ip host host1 101.101.101.101

 ip host host2 101.101.101.102

 ip host client1 101.101.101.103

 ip host client2 101.101.101.104

 

l          There must be a space before the keyword ip host.

l          The host name saved in the intermediate file must be the same with the configuration file name of the host. This host name is not the one saved in the DNS server, and their names can be the same or different.

 

l          The configuration file corresponding with the host name of the device, with its file name as hostname.cfg. For example, if the host name of the device is aaa, then the configuration file name is aaa.cfg.

l          Default configuration file, with the name as device.cfg.

Obtaining the configuration file

Figure 1-3 Obtain the configuration file

 

The device obtains the configuration file from the TFTP server based on its resolution of the configuration file name in the DHCP response:

l          If the DHCP response contains information such as configuration file name, the device requests the specified configuration file from the TFTP server.

l          If no information such as configuration file name is contained in the DHCP response, the device should obtain its host name first and then requests the configuration file corresponding with the host name. The device can obtain its host name in two steps: obtaining the intermediate file from the TFTP server and then searching in the intermediated file for its host name corresponding with the IP address of the device; if fails, the device obtains the host name from the DNS server.

l          If the device fails to obtain the specified configuration file and resolve its host name or fails to obtain the configuration file corresponding with the host name, it requests the default configuration file from the TFTP server.

Sending mode of a TFTP request

The device selects the sending mode of the TFTP request based on its resolution of the TFTP server’s domain name and IP address in the DHCP response:

l          If a legitimate TFTP server IP address is contained in the DHCP response, the device unicasts a TFTP request to the TFTP server and does not resolve the domain name of the TFTP server. Otherwise, the device resolves the TFTP domain name.

l          If a legitimate TFTP server domain name is contained in the DHCP response, the device resolves the IP address of the TFTP server through DNS server. If succeeds, the device unicasts a TFTP request to the TFTP server; if fails, the device broadcasts a TFTP request to the TFTP server.

l          If the IP address and the domain name of the TFTP server are not contained in the DHCP response or they are illegitimate, the device broadcasts a TFTP request to the TFTP server.

 

l          When broadcasting a TFTP request, the device obtains the configuration file from the TFTP server who responds the first. If the required configuration file does not exist on the TFTP server, then obtaining the configuration file fails, and the device removes the temporary configuration and starts up without loading the configuration file.

l          When the device broadcasts a TFTP request to the TFTP server, you need to configure the UDP Helper function on a gateway to transfer broadcasts to unicasts and forwards the unicasts to the specified TFTP server if the device performs the automatic configuration and the TFTP server are not in the same segment because broadcasts can only be transmitted in a segment. For the detailed description of the UDP Helper function.

 

Executing the Configuration File

Upon successfully obtaining the configuration file, the device removes the temporary configuration and executes the obtained configuration file; otherwise, it removes the temporary configuration and starts up without loading the configuration file.

 

After the device executes the configuration file obtained, the configuration file will be deleted. Therefore, you are recommended to save the configuration using the save command; otherwise, the device needs to perform the automatic configuration function after system reboot. For the detailed description of the save command, refer to File System Management Configuration in the System Volume.

H3C reserves the right to modify its collaterals without any prior notice. For the latest information of the collaterals, please consult H3C sales or call 400 hotline.