2.15. Configuring SmartConfig

Overview

Function Introduction

SmartConfig is a smart method of switch initial configuration. After enabling SmartConfig, switch will start to download configuration file or image file from tftp server if not finding startup-config file at startup. Then switch will install these file and it will reboot itself if had downloaded image file.

Note that we use deploy file to control the configuration file and image file downloaded by switch. Switch fetch these file according the deploy file, which is a XML-formatted file. The deploy file named smartdeploy.xml , while its content like below:

<SmartDeploy>
    <ftype>init</ftype>
    <hostprefix>Bruce</hostprefix>
    <defItem>
        <option>enable</option>
        <image>def.bin</image>
        <config>def.cfg</config>
    </defItem>
    <groups>
        <Item>
            <type>MAC</type> 
            <value>0058.3F08.9100</value> 
            <image>switchOs.bin</image>
            <config>startup.cfg</config>
        </Item>
        <Item>
            <type>productid</type>
            <value>AQ-N6000-48Y8C</value>
            <image>productid.bin</image>
            <config>productid.cfg</config>
        </Item>
        <Item>
            <type>SN</type>
            <value>2230918142402-00003</value>
            <image>sn.bin</image>
            <config>sn.cfg</config>
        </Item>
    </groups>
</SmartDeploy>

There are three kind of item used by switch to find out image file and configuration file fit itself. Switch will search fit item according sequence like MAC, SN , product-id. We just specify the file name in the deploy file, and place all these files on tftp server.

Principle Description

N/A

Configuration

/aqnos_ug_en/latest/_images/image93.png

Fig. 2.6 smart config

This figure is the network topology of testing SmartConfig function We need two switches and two linux boxes to construct the test bed. “switch” in the figure is the switch we enable SmartCofng on. Note that the address of TFTP server provided by DHCP server can be used by switch to connect to TFTP server directly or via routes.

Enable smartConfig

step 1 Enter the configure mode

Switch# configure terminal

step 2 Enable smartConfige

Switch(config)# smart-config initial-switch-deployment

step 3 Exit the configure mode

Switch(config)# exit

step 4 Validation

Use this command to check the smart-config settings:

Switch# show smart-config config
Smart-Config config:
initial-switch-deployment: on
hostname-prefix: on
Send log message to console: on

Using smartConfig

SmartConfig was enable default so we just make sure there is no startup-config.conf file. Then switch will start SmartConfig next boot. And we can delete startup-config.conf manually, so that Smartconfig will work after reboot. Procedure of configure SmartConfig as fallow

step 1:

Configure smartdeploy.xml file and place it with image file configuration file to tftp server. The directory must be like this (Configuration files should be in conf directory and images should be in images directory).

smartconfig/
    |--conf/
    |--images/
    |--smartdeploy.xml

step 2:

Configure DHCP server, so TFTP Server Address option must be set.

step 3:

Make sure there is no startup-config.conf file.

step 4:

Boot or reboot the system.

Application cases

N/A