Extensible Markup Language (XML) is a powerful tool to use to configure a CSS switch. Anything that can be done from the Command Line Interface (CLI) can be done remotely using XML and any easy to XML editor of your choice
There are no specific requirements for this document.
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
For more information on document conventions, refer to the Cisco Technical Tips Conventions.
XML can be used for automating certain tasks, performing remote configurations, or as a enhancement to the GUI management interface available in 4.0. Currently, the GUI management interface does not support many of the features available from the CLI (for example, the commands save_config or write memory).
XML code loads a series of CLI commands without needing to respond to the prompts, similar to expert mode. The switch administrator has to spend time planning what kind of changes they want to implement and the consequences of these changes as they are performed. For example, if you wanted to configure interfaces, and you configured one to load the XML from another IP address or VLAN, this would cause the publishing process to hang, as the interface it was using would no longer be valid.
Any text editor can be used for creating the XML code. Syntax is not severe, but the first line must look as follows:
<?xml version="1.0" standalone="yes"?>
After that, the statements should be in this format:
<?xml version="1.0" standalone="yes" ?> <config> <action>command</action> <action>command</action> <action>command</action> <action>command</action> </config>
The word command represents the actual CLI commands. For example, these commands are used to configure an access list (ACL):
<?xml version="1.0" standalone="yes" ?> <config> <action>acl 98</action> <action>clause 10 permit any any dest any</action> <action>apply circuit-(VLAN3)</action> </config>
These commands configure an interface into a circuit:
<?xml version="1.0" standalone="yes" ?> <config> <action>interface ethernet-6</action> <action>bridge vlan 3</action> <action>circuit VLAN3</action> <action>ip address 10.10.104.1/16</action> </config>
The easiest way to parse to XML code to ensure that it is syntactically correct is to use Internet Explorer and load the file. Syntax errors will be flagged when the file is loaded.
There are many easy to use and simple XML editing software application packages available. While using your XML Editor of your choice, when the Publish button is clicked, the XML is pushed to the switch. An error code in the publishing process usually means that the no restrict xml (for 4.x) or the webmgmt-state enable (for 3.x) commands have not been issued on the switch prior to the file being published to it. When you publish XML files to the HTTP server in the CSS, the CSS requires a valid username and password as part of the user authentication process to publish the XML files. The username must have assigned SuperUser privileges to add XML files to the CSS.
You will need to test the output of the code by reviewing the configuration of the switch. Once the XML has been published to the switch, Telnet to the switch and issue the show running-configuration command to verify that the XML changes have occurred.
Note: Because XML management is scripted, it is not possible to run another script within this script.
The Cisco Support Community is a forum for you to ask and answer questions, share suggestions, and collaborate with your peers.
Refer to Cisco Technical Tips Conventions for information on conventions used in this document.