Bildiğiniz gibi cisco cihazlar üzerinde bir yaptığımız bir konfigürasyonu kaydetmek için her ya "write memory" ya da "copy running-config startup-config" komutlarını kullanırız. Bu komutun yaptığı işlem kayıtlı olan startup konfigürasyonunu silmek, çalışan konfigürasyonun bir kopyasını alıp startup konfigürasyonu yapmaktır. Ancak bu komutun tersi bu şekilde çalışmaz. Eğer "copy start run" yaparsanız startup konfigürasyon ile running konfigürasyonu birleştirecektir. Eğer üretimde kullanılan bir cihazda running konfigürasyonu değiştirirseniz ve yaptığınız bazı değişikliklerin yanlış olduğuna karar verip tekrar eski konfigürasyona dönmek için copy start run" komutunu kullanırsanız, sonuç hayal kırıklığı olabilir. Bunu bir örnek ile açıklayalım.
Aşağıda gördüğünüz o anda router üzerinde çalışan konfigürasyonun bir parçası. Aynı zamanda startup konfigürasyona da kaydedilmiş durumda.
!
interface FastEthernet0/0
description *** INSIDE INTERFACE ***
ip address 10.10.10.1 255.255.255.0
speed 100
full-duplex
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/0
description *** INSIDE INTERFACE ***
ip address 10.10.10.1 255.255.255.0
speed 100
full-duplex
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
Şimdi isterseniz konfigürasyon üzerinde küçük değişiklikler yapalım ve running konfigürasyona tekrar bakalım.
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
description *** INSIDE INTERFACE ***
ip address 10.10.10.1 255.255.255.0
speed 100
full-duplex
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
description *** INSIDE INTERFACE ***
ip address 10.10.10.1 255.255.255.0
speed 100
full-duplex
!
Bu anda yaptığımız konfigürasyonun yanlış olduğunu fark edip, tekrar startup konfigürasyonu geri yüklemek isterseniz ve "copy start run" komutunu yazarsanız. konfigürasyon aşağıdaki hale gelecektir.
interface FastEthernet0/0
description *** INSIDE INTERFACE ***
ip address 10.10.10.1 255.255.255.0
shutdown
speed 100
full-duplex
!
interface FastEthernet0/1
description *** INSIDE INTERFACE ***
no ip address
shutdown
duplex auto
speed auto
description *** INSIDE INTERFACE ***
ip address 10.10.10.1 255.255.255.0
shutdown
speed 100
full-duplex
!
interface FastEthernet0/1
description *** INSIDE INTERFACE ***
no ip address
shutdown
duplex auto
speed auto
Burada gördüğünüz çok basit bir konfigürasyon olduğu için büyük bir sorun yok. Ancak çok daha karışık konfigürasyonlar ile uğraşıyorsanız ve böyle bir yanlışlık olursa iş içinden çıkılmaz bir hale gelebilir. Bu yüzden, çalışan ve startup'ta kayıtlı olan konfigürasyona dönmek için cihazı reload edebilirsiniz. Ancak cihazınız production'da çalışan ve kapatmanızın dahi sorun yaratacağı bir cihaz ise aşağıdaki komut oldukça işe yarar bir komut olacaktır.
R1#
R1#configure replace nvram:startup-config
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: y
*Mar 1 00:51:24.839: Rollback:Acquired Configuration lock.
*Mar 1 00:51:35.175: %PARSER-6-EXPOSEDLOCKRELEASED: Exclusive configuration lock released from terminal '0' -Process= "Exec", ipl= 0, pid= 165
*Mar 1 00:51:35.187: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
Total number of passes: 1
Rollback Done
*Mar 1 00:51:36.203: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Mar 1 00:51:36.207: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Mar 1 00:51:37.219: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
*Mar 1 00:51:39.763: %PARSER-3-CONFIGNOTLOCKED: Unlock requested by process '165'. Configuration not locked.
R1#
R1#configure replace nvram:startup-config
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: y
*Mar 1 00:51:24.839: Rollback:Acquired Configuration lock.
*Mar 1 00:51:35.175: %PARSER-6-EXPOSEDLOCKRELEASED: Exclusive configuration lock released from terminal '0' -Process= "Exec", ipl= 0, pid= 165
*Mar 1 00:51:35.187: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
Total number of passes: 1
Rollback Done
*Mar 1 00:51:36.203: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Mar 1 00:51:36.207: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
*Mar 1 00:51:37.219: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
*Mar 1 00:51:39.763: %PARSER-3-CONFIGNOTLOCKED: Unlock requested by process '165'. Configuration not locked.
R1#
Bu komut sonucunda startup ve runnig konfigürasyon birleştirilmeyecek, startup-config running-config ile yer değiştirecektir. Bundan dolayı cihaz aynen reload edilmiş gibi davranacaktır.
İyi çalışmalar
Hiç yorum yok:
Yorum Gönder