cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
496
Views
1
Helpful
4
Replies

NXOS add configuration from file

Hi all

I would load to add a specific configuration from a txt-file to a running Cisco Nexus 3600/9000 switch. Not overwriting the whole current configuration, but add the configuration from the configuration file.

For example, I have a running nexus with some VLANs and interfaces configured and my config.txt is something like this:

 

interface Ethernet1/5
 switchport trunk allowed vlan remove 1234
interface Ethernet1/6
 switchport trunk allowed vlan remove 2222
no vlan 1234
no vlan 2222

 

Now I like to "execute" this config.txt, instead of copy-past it to "conf t". The reason I like to do this is that I have to add a large configuration to a lot of Nexus switches. And I like to avoid mistakes by copy-past. Of course I can use something like ansible, but it's a one-time-thing that I have to do, so the way over a config.txt would be the best way to do it.

Is this possible on NXOS?

4 Replies 4

M02@rt37
VIP
VIP

Hello @schwarzenbachcyb,

The correct command to add specific configuration from a txt-file to a running Cisco Nexus 3600/9000 switch without overwriting the entire current configuration is the "configure replace" command with the "force" option.

The "configure replace" command allows you to merge new configuration into the running configuration of the switch without overwriting the entire configuration. The "force" option allows the merge to occur even if there are errors or warnings in the new configuration.

 

Nexus 3000 series: series: https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus3000/sw/system_mgmt/7_x/b_Cisco_Nexus_3000_Series_NX-OS_System_Management_Configuration_Guide_7x/b_Cisco_Nexus_3000_Series_NX-OS_System_Management_Configuration_Guide_7x_chapter_011010.ht...

Nexus 9000 series:

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/7-x/system_management/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_System_Management_Configuration_Guide_7x/b_Cisco_Nexus_9000_Series_NX-OS_System_Management_Configuration_...

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

are you 100% sure?

But you links are helpful.

schwarzenbachcyb_0-1683120132004.png

 

@schwarzenbachcyb,

Do yo follow the official documentation?

 

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

Dawei
Cisco Employee
Cisco Employee

Try this:

# copy bootflash:config.txt running-config