cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2380
Views
5
Helpful
2
Replies

TCL to generate vlan/name configuration

cgrodde
Level 1
Level 1

Hi,

I'm looking for a way to automate vlan and vlan name configuration with tcl!

e.g.

vlan x

  name xxx

vlan y

  name yyy

Unfortunately the tcl command "ios_config" let me configure vlans but vlan sub-commands, like "name xxx", are not possible!

ios_config does only in interface sub-mode a good job...

Any ideas how this works? Is there a better way to automate vlan configuration within ios?

Thanks for any suggestion

Christian

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

I don't understand what you mean by ios_config is not working.  It seems to work fine for me:

ios_config "vlan 10" "name test_10" "end"

An alternative to tclsh is to use the Embedded Event Manager Tcl.  This gives you a more flexible CLI interface.

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

I don't understand what you mean by ios_config is not working.  It seems to work fine for me:

ios_config "vlan 10" "name test_10" "end"

An alternative to tclsh is to use the Embedded Event Manager Tcl.  This gives you a more flexible CLI interface.

uups, ok...with the "end" parameter ios_config command works fine for vlan/name configuration!

Within interface configuration i never used the "end" before.

I didn't understand the exactly reason behind the difference, but it works and i'm fine!

Vlan config needs an end

ios_config "vlan 100" "name test" "end"

If-config works without end:

ios_config "interface gig 1/0/12" "description free"

Many thanks for the fast solution!