As shown in Figure 1, newly delivered devices SwitchA, SwitchB, and SwitchC are deployed in a branch and connect to GE0/0/1, GE0/0/2, and GE0/0/3 of SwitchD, respectively. SwitchD is the egress gateway of the branch and connects to the headquarters network across a Layer 3 network.
SwitchA, SwitchB, and SwitchC are different device models and need to load different system software packages, patch files, and configuration files. The enterprise wants the new devices to automatically download required version files to save labor costs of onsite configuration.
# Create a file and name it lswnet.cfg. Write the following content in the file:
mac=0025-9e1e-773b;vrpfile=s57li_easy_V200R019C10.cc;vrpver=V200R019C10SPC100;patchfile=s57li_easy_V200R019C10.pat;cfgfile=s57li_easy_V200R019C10.cfg;
mac=0025-9e1e-773c;vrpfile=s5720ei_easy_V200R019C10.cc;vrpver=V200R019C10SPC100;patchfile=s5720ei_easy_V200R019C10.pat;cfgfile=s5720ei_easy_V200R019C10.cfg;
mac=0025-9e1e-773d;vrpfile=s57li_easy_V200R019C10.cc;vrpver=V200R019C10SPC100;patchfile=s57li_easy_V200R019C10.pat;cfgfile=s57li_easy_V200R019C10.cfg;
Configure the file server according to the server manual.
After completing the configuration, save the required files on the file server.
# Configure DHCP relay.
<HUAWEI> system-view [HUAWEI] sysname DHCP_Relay [DHCP_Relay] dhcp enable [DHCP_Relay] vlan 10 [DHCP_Relay-vlan10] quit [DHCP_Relay] interface gigabitethernet 0/0/1 [DHCP_Relay-GigabitEthernet0/0/1] port link-type hybrid [DHCP_Relay-GigabitEthernet0/0/1] port hybrid pvid vlan 10 [DHCP_Relay-GigabitEthernet0/0/1] port hybrid untagged vlan 10 [DHCP_Relay-GigabitEthernet0/0/1] quit [DHCP_Relay] interface gigabitethernet 0/0/2 [DHCP_Relay-GigabitEthernet0/0/2] port link-type hybrid [DHCP_Relay-GigabitEthernet0/0/2] port hybrid pvid vlan 10 [DHCP_Relay-GigabitEthernet0/0/2] port hybrid untagged vlan 10 [DHCP_Relay-GigabitEthernet0/0/2] quit [DHCP_Relay] interface gigabitethernet 0/0/3 [DHCP_Relay-GigabitEthernet0/0/3] port link-type hybrid [DHCP_Relay-GigabitEthernet0/0/3] port hybrid pvid vlan 10 [DHCP_Relay-GigabitEthernet0/0/3] port hybrid untagged vlan 10 [DHCP_Relay-GigabitEthernet0/0/3] quit [DHCP_Relay] interface vlanif 10 [DHCP_Relay-Vlanif10] ip address 192.168.1.6 255.255.255.0 [DHCP_Relay-Vlanif10] dhcp select relay [DHCP_Relay-Vlanif10] dhcp relay server-ip 192.168.2.6 [DHCP_Relay-Vlanif10] quit
# Configure a static route. Set the destination IP address of the route to the PC's IP address, and the next hop to the IP address of the interface on the Layer 3 network directly connected to SwitchD.
# Configure the DHCP server.
<HUAWEI> system-view [HUAWEI] sysname DHCP_Server [DHCP_Server] dhcp enable [DHCP_Server] vlan batch 20 30 [DHCP_Server] interface gigabitethernet 0/0/1 [DHCP_Server-GigabitEthernet0/0/1] port link-type trunk [DHCP_Server-GigabitEthernet0/0/1] port trunk allow-pass vlan 20 [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 30 [DHCP_Server-GigabitEthernet0/0/2] port hybrid untagged vlan 30 [DHCP_Server-GigabitEthernet0/0/2] quit [DHCP_Server] interface vlanif 20 [DHCP_Server-Vlanif20] ip address 192.168.2.6 255.255.255.0 [DHCP_Server-Vlanif20] dhcp select global [DHCP_Server-Vlanif20] quit [DHCP_Server] interface vlanif 30 [DHCP_Server-Vlanif30] ip address 192.168.4.1 255.255.255.0 [DHCP_Server-Vlanif30] quit [DHCP_Server] ip pool easy-operation [DHCP_Server-ip-pool-easy-operation] network 192.168.1.0 mask 255.255.255.0 [DHCP_Server-ip-pool-easy-operation] gateway-list 192.168.1.6 [DHCP_Server-ip-pool-easy-operation] option 141 ascii user [DHCP_Server-ip-pool-easy-operation] option 142 cipher huawei [DHCP_Server-ip-pool-easy-operation] option 143 ip-address 192.168.4.6 [DHCP_Server-ip-pool-easy-operation] option 146 ascii opervalue=1;delaytime=0;netfile=lswnet.cfg; [DHCP_Server-ip-pool-easy-operation] quit
# Configure a static route. Set the destination IP address of the route to the network segment in the IP address pool configured on SwitchD, and the next hop to the IP address of the interface on the Layer 3 network directly connected to SwitchE.
<HUAWEI> display startup MainBoard: Configured startup system software: flash:/s5720ei_easy_V200R019C10.cc Startup system software: flash:/s5720ei_easy_V200R019C10.cc Next startup system software: flash:/s5720ei_easy_V200R019C10.cc Startup saved-configuration file: flash:/s5720ei_easy_V200R019C10.cfg Next startup saved-configuration file: flash:/s5720ei_easy_V200R019C10.cfg Startup paf file: NULL Next startup paf file: NULL Startup license file: NULL Next startup license file: NULL Startup patch package: flash:/s5720ei_easy_V200R019C10.pat Next startup patch package: flash:/s5720ei_easy_V200R019C10.pat
DHCP relay agent configuration file
# sysname DHCP_Relay # vlan batch 10 # dhcp enable # interface Vlanif10 ip address 192.168.1.6 255.255.255.0 dhcp select relay dhcp relay server-ip 192.168.2.6 # 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 # return
DHCP server configuration file
# sysname DHCP_Server # vlan batch 20 30 # dhcp enable # ip pool easy-operation gateway-list 192.168.1.6 network 192.168.1.0 mask 255.255.255.0 option 141 ascii user option 142 cipher %^%#2RC4@B`rZ/{##$1x03%Eh&S.)l7zcQUDl6MLPS"$%^%# option 143 ip-address 192.168.4.6 option 146 ascii opervalue=1;delaytime=0;netfile=lswnet.cfg; # interface Vlanif20 ip address 192.168.2.6 255.255.255.0 dhcp select global # interface Vlanif30 ip address 192.168.4.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 30 port hybrid untagged vlan 30 # return