Figure 1 shows the network of a residential community. SwitchD is an aggregation switch and connects to all devices newly deployed in the community. SwitchA, SwitchB, and SwitchC are three of the new devices and are used as an example here.
All the new devices in the community need to load the same system software, patch file, and configuration file. Since many new devices need to be configured, the customer requires batch configuration of all the new devices to reduce labor costs and device deployment time.
Before deploying zero touch devices, ensure that the DHCP server, file server, and zero touch devices (have obtained IP addresses) have reachable routes to each other.
Configure the file server according to the server manual.
After completing the configuration, save the required files on the file server.
<HUAWEI> system-view [HUAWEI] sysname DHCP_Server [DHCP_Server] dhcp enable [DHCP_Server] vlan batch 10 20 [DHCP_Server] interface gigabitethernet 0/0/1 [DHCP_Server-GigabitEthernet0/0/1] port link-type hybrid [DHCP_Server-GigabitEthernet0/0/1] port hybrid pvid vlan 10 [DHCP_Server-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [DHCP_Server-GigabitEthernet0/0/1] quit [DHCP_Server] interface gigabitethernet 0/0/2 [DHCP_Server-GigabitEthernet0/0/2] port link-type hybrid [DHCP_Server-GigabitEthernet0/0/2] port hybrid pvid vlan 10 [DHCP_Server-GigabitEthernet0/0/2] port hybrid untagged vlan 10 [DHCP_Server-GigabitEthernet0/0/2] quit [DHCP_Server] interface gigabitethernet 0/0/3 [DHCP_Server-GigabitEthernet0/0/3] port link-type hybrid [DHCP_Server-GigabitEthernet0/0/3] port hybrid pvid vlan 10 [DHCP_Server-GigabitEthernet0/0/3] port hybrid untagged vlan 10 [DHCP_Server-GigabitEthernet0/0/3] quit [DHCP_Server] interface gigabitethernet 0/0/4 [DHCP_Server-GigabitEthernet0/0/4] port link-type hybrid [DHCP_Server-GigabitEthernet0/0/4] port hybrid pvid vlan 20 [DHCP_Server-GigabitEthernet0/0/4] port hybrid untagged vlan 20 [DHCP_Server-GigabitEthernet0/0/4] quit [DHCP_Server] interface vlanif 10 [DHCP_Server-Vlanif10] ip address 192.168.2.6 255.255.255.0 [DHCP_Server-Vlanif10] dhcp select global [DHCP_Server-Vlanif10] quit [DHCP_Server] interface vlanif 20 [DHCP_Server-Vlanif20] ip address 192.168.1.1 255.255.255.0 [DHCP_Server-Vlanif20] quit [DHCP_Server] ip pool auto-config [DHCP_Server-ip-pool-auto-config] network 192.168.2.0 mask 255.255.255.0 [DHCP_Server-ip-pool-auto-config] gateway-list 192.168.2.6 [DHCP_Server-ip-pool-auto-config] option 67 ascii s_V200R019C10.cfg [DHCP_Server-ip-pool-auto-config] option 141 ascii user [DHCP_Server-ip-pool-auto-config] option 142 cipher huawei123 [DHCP_Server-ip-pool-auto-config] option 143 ip-address 192.168.1.6 [DHCP_Server-ip-pool-auto-config] option 145 ascii vrpfile=s_V200R019C10.cc;vrpver=V200R019C10SPC200;patchfile=s_V200R019C10.pat; [DHCP_Server-ip-pool-auto-config] quit
<HUAWEI> display startup MainBoard: Configured startup system software: flash:/s_V200R019C10.cc Startup system software: flash:/s_V200R019C10.cc Next startup system software: flash:/s_V200R019C10.cc Startup saved-configuration file: flash:/s_V200R019C10.cfg Next startup saved-configuration file: flash:/s_V200R019C10.cfg Startup paf file: NULL Next startup paf file: NULL Startup license file: NULL Next startup license file: NULL Startup patch package: flash:/s_V200R019C10.pat Next startup patch package: flash:/s_V200R019C10.pat
DHCP server configuration file
# sysname DHCP_Server # vlan batch 10 20 # dhcp enable # ip pool auto-config gateway-list 192.168.2.6 network 192.168.2.0 mask 255.255.255.0 option 67 ascii s_V200R019C10.cfg option 141 ascii user option 142 cipher %^%#%AC[/dp2*'%0FWN7]p{SWrB`$}i[:7VBPZQj5@)%%^%# option 143 ip-address 192.168.1.6 option 145 ascii vrpfile=s_V200R019C10.cc;vrpver=V200R019C10SPC200;patchfile=s_V200R019C10.pat; # interface Vlanif10 ip address 192.168.2.6 255.255.255.0 dhcp select global # interface Vlanif20 ip address 192.168.1.1 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 10 port hybrid untagged vlan 10 # interface GigabitEthernet0/0/4 port link-type hybrid port hybrid pvid vlan 20 port hybrid untagged vlan 20 # return