Figure 1 shows a network of an enterprise on which the file server, DHCP server, and SwitchA have reachable routes to each other. New devices Client1, Client2, and Client3 need to be deployed on the enterprise network. The new devices are located on a different network segment from the DHCP server. To reduce labor costs and save time on device deployment, the enterprise wants to realize automatic batch configuration and maintenance of the new devices.
The address of VLANIF 20 on SwitchA is 192.168.4.2/24 and its peer address is 192.168.4.1/24.
The address of VLANIF 30 on SwitchB is 192.168.3.2/24 and its peer address is 192.168.3.1/24.
Table 1 lists information about the new devices to be configured.
Configure the Commander on SwitchA so that the new devices can be configured using the Commander.
Configure the file server according to the server manual.
After completing the configuration, save the required files on the file server.
# Configure a DHCP server based on the global address pool.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] dhcp enable [SwitchB] vlan batch 30 [SwitchB] interface vlanif 30 [SwitchB-Vlanif30] ip address 192.168.3.2 24 [SwitchB-Vlanif30] dhcp select global [SwitchB-Vlanif30] quit [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type hybrid [SwitchB-GigabitEthernet0/0/1] port hybrid pvid vlan 30 [SwitchB-GigabitEthernet0/0/1] port hybrid untagged vlan 30 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] ip pool easy-operation [SwitchB-ip-pool-easy-operation] network 192.168.1.0 mask 255.255.255.0 [SwitchB-ip-pool-easy-operation] gateway-list 192.168.1.6 [SwitchB-ip-pool-easy-operation] option 148 ascii ipaddr=192.168.1.6; [SwitchB-ip-pool-easy-operation] quit
# Configure a default route on SwitchB.
[SwitchB] ip route-static 0.0.0.0 0.0.0.0 192.168.3.1
# Configure DHCP relay on SwitchA (Commander).
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10 20 [SwitchA] dhcp enable [SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address 192.168.1.6 24 [SwitchA-Vlanif10] quit [SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 192.168.4.2 24 [SwitchA-Vlanif20] quit [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type hybrid [SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/1] quit [SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type hybrid [SwitchA-GigabitEthernet0/0/2] port hybrid pvid vlan 10 [SwitchA-GigabitEthernet0/0/2] port hybrid untagged vlan 10 [SwitchA-GigabitEthernet0/0/2] quit [SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type hybrid [SwitchA-GigabitEthernet0/0/3] port hybrid pvid vlan 20 [SwitchA-GigabitEthernet0/0/3] port hybrid untagged vlan 20 [SwitchA-GigabitEthernet0/0/3] quit [SwitchA] interface vlanif 10 [SwitchA-Vlanif10] dhcp select relay [SwitchA-Vlanif10] dhcp relay server-ip 192.168.3.2 [SwitchA-Vlanif10] quit
# Configure a default route on SwitchA.
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 192.168.4.1
[SwitchA] easy-operation commander ip-address 192.168.1.6 [SwitchA] easy-operation commander enable
[SwitchA] easy-operation [SwitchA-easyoperation] sftp-server 192.168.2.2 username admin password EasyOperation [SwitchA-easyoperation] backup configuration interval 2
# On the Commander, configure a built-in group based on the device type of Client1 and Client2, and specify information about the files to be downloaded in the group.
[SwitchA-easyoperation] group build-in S5700-HI [SwitchA-easyoperation-group-build-in-S5700-HI] configuration-file s5700-hi.cfg [SwitchA-easyoperation-group-build-in-S5700-HI] custom-file header1.txt [SwitchA-easyoperation-group-build-in-S5700-HI] quit [SwitchA-easyoperation] client auto-join enable Warning: The commander will create the client information in database automatica lly when received message from unknown client. Continue? [Y/N]: y [SwitchA-easyoperation]
# Specify information about the files to be downloaded to Client3.
[SwitchA-easyoperation] client 3 mac-address 5489-9875-edff
[SwitchA-easyoperation] client 3 configuration-file s5700-x-li.cfg custom-file header2.txt
# In the Easy-Operation view of the Commander, set the file activation delay time to 15 minutes (900 seconds) based on the size of files that Client3 needs to download.
[SwitchA-easyoperation] activate-file delay 900 [SwitchA-easyoperation] quit
# Check global configuration of the Commander.
[SwitchA] display easy-operation configuration --------------------------------------------------------------------------- Role : Commander Commander IP address : 192.168.1.6 Commander UDP port : 60000 IP address of file server : 192.168.2.2 Type of file server : SFTP Username of file server : admin Default system-software file : - Default system-software version : - Default configuration file : - Default patch file : - Default WEB file : - Default license file : - Default custom file 1 : - Default custom file 2 : - Default custom file 3 : - Auto clear up : Disable Auto join in : Disable Topology collection : Disable Activating file time : Delay 900s Activating file method : Default Aging time of lost client(hours): - Backup configuration file mode : Default Backup configuration file interval(hours): 2 ---------------------------------------------------------------------------
# Check the file downloading progress on each client after the zero touch device deployment process starts.
[SwitchA] display easy-operation download-status The total number of client in downloading files is : 3 ---------------------------------------------------------------------------- ID Mac address IP address Method Phase Status ---------------------------------------------------------------------------- 1 00E0-FC12-A34B 192.168.1.254 Zero-touch Config-file Upgrading 2 00E0-FC34-3190 192.168.1.253 Zero-touch Config-file Upgrading 3 5489-9875-edff 192.168.1.252 Zero-touch Config-file Upgrading
SwitchA configuration file
# sysname SwitchA # vlan batch 10 20 # dhcp enable # interface Vlanif10 ip address 192.168.1.6 255.255.255.0 dhcp select relay dhcp relay server-ip 192.168.3.2 # interface Vlanif20 ip address 192.168.4.2 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/3 port link-type hybrid port hybrid pvid vlan 20 port hybrid untagged vlan 20 # ip route-static 0.0.0.0 0.0.0.0 192.168.4.1 # easy-operation commander ip-address 192.168.1.6 easy-operation commander enable # easy-operation sftp-server 192.168.2.2 username admin password %^%#=.X8C_TN##%&9P>3RK503O@w-=Fr%>naT#E3P4{0%^%# backup configuration interval 2 activate-file delay 900 client 3 mac-address 5489-9875-EDFF client 3 configuration-file s5700-x-li.cfg client 3 custom-file header2.txt group build-in S5700-HI configuration-file s5700-hi.cfg custom-file header1.txt # return
SwitchB configuration file
# sysname SwitchB # vlan batch 30 # dhcp enable # ip pool easy-operation gateway-list 192.168.1.6 network 192.168.1.0 mask 255.255.255.0 option 148 ascii ipaddr=192.168.1.6; # interface Vlanif30 ip address 192.168.3.2 255.255.255.0 dhcp select global # interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 30 port hybrid untagged vlan 30 # ip route-static 0.0.0.0 0.0.0.0 192.168.3.1 # return