Automatic configuration using TFTP server

Network requirements

As shown in Figure 35, Router B does not have a configuration file.

Configure the servers so Router B can obtain a configuration file to complete the following configuration tasks:

Figure 35: Network diagram

Configuration procedure

  1. Configure the DHCP server:

    # Enable DHCP.

    <RouterA> system-view
    [RouterA] dhcp enable
    

    # Configure the address pool 1 to assign IP addresses on the subnet 192.168.1.0/24 to clients. Specify the TFTP server and configuration file name for the clients.

    [RouterA] dhcp server ip-pool 1
    [RouterA-dhcp-pool-1] network 192.168.1.0 24
    [RouterA-dhcp-pool-1] tftp-server ip-address 192.168.1.40
    [RouterA-dhcp-pool-1] bootfile-name device.cfg
    [RouterA-dhcp-pool-market] quit
    
  2. Configure the TFTP server:

    # On the TFTP server, create the configuration file device.cfg.

    #
    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 2/1/1
    port link-mode route
    ip address dhcp-alloc
    return
    

    # Start TFTP service software. (Details not shown.)

Verifying the configuration

  1. Power on Router B.

  2. After Router B starts up, display assigned IP addresses on Router A.

    <RouterA> display dhcp server ip-in-use
    IP address       Client identifier/    Lease expiration      Type
                     Hardware address
    192.168.1.2      0030-3030-632e-3239-  Dec 12 17:41:15 2013  Auto(C)
                     3035-2e36-3736-622d-
                     4574-6830-2f30-2f32
    
  3. Telnet to 192.168.1.2 from Router A.

    <RouterA> telnet 192.168.1.2
    
  4. Enter the username user and password abcabc as prompted. (Details not shown.)

    You are logged in to Router B.