cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
149
Views
3
Helpful
4
Replies

ios_config missing from TCL on XR 7.7.21?

serkit
Level 1
Level 1

I'm running XR 7.7.21 and am scripting some repetitive processes, specifically trying to execute a config mode command ("load config.txt") via a TCL script. I know of "ios_config" in previous OS versions, but that throws an "invalid command name" error in 7.7.21. Is "ios_config" gone from 7.7.21? If so, is there another way to accomplish this? I'm still learning TCL on XE and XR seems to be an entirely different beast. Thanks in advance.

4 Replies 4

AshSe
VIP
VIP

Hello @serkit 

In Cisco IOS XR 7.7.21, the ios_config command is indeed not available. This command was used in older versions of IOS and IOS XE for executing configuration commands within a TCL script, but it is not supported in IOS XR. IOS XR has a different architecture and scripting environment compared to IOS and IOS XE, so some commands and methods differ.

To execute configuration commands in IOS XR using TCL, you can use the cfsys::execcommand to run CLI commands, including configuration commands. However, you need to be cautious when using this approach, as it may not provide the same level of error handling or feedback as ios_config in IOS or IOS XE.

Hope This Helps!!!

AshSe

 

Community Etiquette: 

  1. Insert photos/images inline - don't attach.
  2. Always mark helpful and correct answers, it helps others find what they need.
  3. For a prompt reply, kindly tag @name. An email will be automatically sent to the member.

Thanks for that! Can you please elaborate on this command, and maybe include an example?

Edit: I attempted this command from the tcl shell and received an "invalid command name" error.

M02@rt37
VIP
VIP

Hello @serkit 

Why not using python ? For IOS-XR I think it is a better option...since it seems to have limitation about TCL on IOS-XR.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

antisocial11224
Spotlight
Spotlight

@serkit wrote:

I'm running XR 7.7.21 and am scripting some repetitive processes, specifically trying to execute a config mode command ("load config.txt") via a TCL script. I know of "ios_config" in previous OS versions, but that throws an "invalid command name" error in 7.7.21. Is "ios_config" gone from 7.7.21? If so, is there another way to accomplish this jewellok? I'm still learning TCL on XE and XR seems to be an entirely different beast. Thanks in advance.


One option is to use the exec command within the script, allowing direct execution of CLI commands like exec("load config.txt"). Another approach is to use Embedded Event Manager (EEM) policies, which can trigger TCL scripts based on specific conditions, enabling automated configuration changes.

Additionally, for more advanced configuration management, you can implement NETCONF or gNMI, which offer programmatic interfaces to modify configurations and retrieve system state.

Review Cisco Networking for a $25 gift card