151
Automatic configuration using HTTP server and Tcl script
Network requirements
As shown in Figure 41, the device does not have a configuration file.
Configure the servers so the device can obtain a Tcl script to complete the following configuration
tasks:
• Enable the administrator to Telnet to the device to manage the device.
• Require the administrator to enter the correct username and password at login.
Figure 41 Network diagram
Configuration procedure
1. Configure the DHCP server:
# Enable DHCP.
<RouterA> system-view
[RouterA] dhcp enable
# Configure address pool 1 to assign IP addresses on subnet 192.168.1.0/24 to clients.
[RouterA] dhcp server ip-pool 1
[RouterA-dhcp-pool-1] network 192.168.1.0 24
# Specify the URL of the script file for the clients.
[RouterA-dhcp-pool-1] bootfile-name http://192.168.1.40/device.tcl
2. Configure the HTTP server:
# Edit the configuration file device.tcl on the HTTP server.
return
system-view
telnet server enable
local-user user
password simple abcabc
service-type telnet
quit
user-interface vty 0 4
authentication-mode scheme
user-role network-admin
quit
interface gigabitethernet 1/0/1
ip address dhcp-alloc
return