- Table of Contents
-
- 01-Fundamentals Configuration Guide
- 00-Preface
- 01-CLI configuration
- 02-RBAC configuration
- 03-Login management configuration
- 04-FTP and TFTP configuration
- 05-File system management configuration
- 06-Configuration file management configuration
- 07-Software upgrade configuration
- 08-ISSU configuration
- 09-Emergency shell configuration
- 10-Automatic configuration
- 11-Device management configuration
- 12-MDC configuration
- 13-TCL configuration
- 14-License management
- Related Documents
-
Title | Size | Download |
---|---|---|
10-Automatic configuration | 170.78 KB |
Contents
Understanding automatic configuration
Overall automatic configuration process
Automatic-configuration parameter acquisition process
Configuration file acquisition process
Deploying and configuring servers for automatic configuration
DHCP server configuration guidelines
TFTP server configuration guidelines
With the automatic configuration feature, the device can automatically obtain a set of configuration settings from some servers when it starts up without a configuration file. This feature simplifies network configuration, facilitates centralized management, and reduces maintenance workload.
Understanding automatic configuration
The automatic configuration feature requires the cooperation of the following servers: a DHCP server, a TFTP server, and a DNS server, as shown in Figure 1.
Figure 1 Typical automatic configuration network diagram
When the device is powered on without a configuration file, it automatically starts the automatic configuration process to try to obtain a set of configuration settings. If one attempt fails, the device waits for two minutes and then automatically starts the process again for another attempt. The device continues to make attempts until it gets a set of configuration settings or it is powered off.
Overall automatic configuration process
Overall, the automatic configuration process includes the following steps:
1. The device selects an interface for automatic configuration.
The device selects an interface according to the following rules:
¡ If one or more Layer 2 Ethernet interfaces are in up state, the device selects the VLAN interface of the default VLAN.
¡ If no Layer 2 Ethernet interface is in up state, the device sorts all Layer 3 Ethernet interfaces in up state first by the dictionary order of the interface types and then in ascending order of interface numbers, and selects the one with the smallest interface number among the interfaces of the first interface type.
2. After finding a qualified interface, the device enables the DHCP client on the interface and tries to locate a DHCP server and obtain a set of parameters for automatic configuration, which might include a temporary IP address, a configuration file name, a TFTP server domain name, a TFTP server IP address, and a DNS server IP address. For more information, see "Automatic-configuration parameter acquisition process."
3. After getting automatic configuration parameters, the device tries to download a configuration file from a TFTP server. For more information, see "Configuration file acquisition process."
4. If the device gets a configuration file, it deletes its temporary settings to restore the factory defaults and then executes the configuration file. Otherwise, the device deletes its temporary settings, select another qualified interface, and repeats Step 2 to Step 4.
|
IMPORTANT: · To ensure quick and successful automatic configuration of a device, connect only the interface used for automatic configuration to the network. · The configuration file is deleted after being executed. After the device completes the automatic configuration process, save the configuration by using the save command. Otherwise, the device has to perform automatic configuration again after reboot. For more information about the save command, see Fundamentals Command Reference. |
Figure 2 shows the automatic configuration workflow.
Figure 2 Automatic configuration workflow
Automatic-configuration parameter acquisition process
After the device finds an interface for automatic configuration, it enables the DHCP client on the interface. Then, the DHCP client broadcasts a DHCP request to locate a DHCP server and request configuration settings. The DHCP request contains DHCP Option 55, which indicates the configuration settings the device requires, including the configuration file name, the TFTP server domain name, the TFTP server IP address, and the DNS server IP address.
After the device obtains an IP address, it resolves the received DHCP reply to examine the following fields:
· Option 67 or the file field—Carries the configuration file name. The device resolves Option 67 first. If Option 67 does not contain the configuration file name, the device resolves the file field.
· Option 150—Carries the TFTP server IP address. If this option contains a valid TFTP server IP address, the device starts the configuration file acquisition process. Otherwise, the device resolves Option 66.
· Option 66—Carries the TFTP server domain name. If Option 150 does not contain a TFTP server IP address, the device resolves this option for a TFTP server domain name and tries to communicate with the DNS server indicated by Option 6 to get the TFTP server IP address.
· Option 6—Carries the DNS server IP address.
For more information about DHCP, see Layer 3—IP Services Configuration Guide.
Configuration file acquisition process
During the automatic-configuration parameter acquisition process, the device might or might not get a TFTP server IP address:
· If the device gets a TFTP server IP address, it starts the configuration file acquisition process by unicasting a request to the TFTP server.
· If not, the device starts the configuration file acquisition process by broadcasting a request. In this case, the device resolves only the first reply.
As shown in Figure 3, the device determines what to request from the TFTP server based on whether or not it got a configuration file name during the automatic-configuration parameter acquisition process:
· If the device got a configuration file name, it requests the specified configuration file.
· If not, it requests a configuration file named in the format host name.cfg from the TFTP server, where host name represents the host name of the device. To do so , the device first requests the host name file network.cfg, which contains mappings between IP addresses and host names. If the device fails to get the host name file or the file contains no entry for the device's temporary IP address, it tries to communicate with a DNS server to resolve the temporary IP address to a host name. After the device gets the host name, it tries to obtain the configuration file for the host name.
If the device fails to get a configuration file specific for itself, it requests the default configuration file device.cfg from the TFTP server.
Figure 3 Configuration file acquisition process
Deploying and configuring servers for automatic configuration
To implement automatic configuration, you do not need to perform any configuration on the device. However, you must deploy DHCP, TFTP, and DNS servers and properly configure the servers to cooperate with the device as follows:
· DHCP server—Assigns the device a set of parameters for automatic configuration, which might include a temporary IP address, a configuration file name, a TFTP server domain name, a TFTP server IP address, and a DNS server IP address. For more information about the DHCP server, see Layer 3—IP Services Configuration Guide.
· TFTP server—Stores files needed for device automatic configuration, including the configuration files and host name files. For more information about TFTP, see "Configuring TFTP."
· DNS server—Resolves the device's temporary IP address to its host name so the device can request a configuration file named in the format host name.cfg from the TFTP server. The DNS server might also need to resolve the TFTP server domain name to the TFTP server IP address. For more information about the DNS server, see Layer 3—IP Services Configuration Guide.
If the DHCP server, the TFTP server, the DNS server, and the device are not in the same network segment, configure the DHCP relay agent on the gateway, and configure routing protocols to make sure the servers have routes to the device and vice versa.
DHCP server configuration guidelines
DHCP server configuration requirements vary depending on whether the devices use the same configuration file:
· If all devices that need to be automatically configured share the same configuration file, configure the dynamic address allocation mechanism on the DHCP server. To allow these devices to have some different configurations, you can put the configurations that the devices share to the configuration file and provide a way for device administrators to change the configurations after the devices start up. For example, you can configure a configuration file that enables the Telnet service and creates a local user so administrators can Telnet to their devices to perform specific configurations after their devices start up.
· If different devices need different configurations, configure the static address and parameter allocation mechanism on the DHCP server so the server assigns pre-configured IP addresses and parameters to the devices. With this method, you can configure all configuration items required for each device on the DHCP server.
Before you configure a static binding for a device, you must obtain the client ID of the device. To do so, ask the device administrator to turn on the device and, after the device starts up, execute the display dhcp server ip-in-use command on the DHCP server to view the client ID of the device.
After you complete the static binding configuration, ask the device administrator to turn off the device and then turn on it again so the device gets the IP address and configuration parameters you configured for it.
TFTP server configuration guidelines
You must configure the configuration files and host name files required for device automatic configuration on the TFTP server, including the default configuration file named device.cfg.
To use the host name file network.cfg, configure a configuration file for each device on the TFTP server, name the file in the format host name.cfg, and configure a mapping entry in the format ip host host-name ip-address for the host name file. For example, you can configure the following entries for the host name file:
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
If a device resides in a network different than the TFTP server, configure the UDP helper function on the gateway so the gateway changes the broadcast TFTP request from the device to a unicast packet and forwards the unicast packet to the TFTP server. For more information about UDP helper, see Layer 3—IP Services Configuration Guide.