{"id":31,"date":"2009-07-03T12:55:32","date_gmt":"2009-07-03T11:55:32","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=31"},"modified":"2009-07-04T10:30:51","modified_gmt":"2009-07-04T09:30:51","slug":"ios-configuration-lock","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=31","title":{"rendered":"IOS Configuration Lock"},"content":{"rendered":"<p>How to avoid two people making changes to the configuration at the same time<\/p>\n<p>The only command you need to use is the configuration mode exclusive {auto | manual} from global configuration mode.<\/p>\n<ul>\n<li> The auto keyword automatically locks the configuration session whenever the configure terminal command is used and this is the default option.<\/li>\n<li>The inverse manual keyword allows you to choose to lock the configuration session manually or simply leave it unlocked.<\/li>\n<\/ul>\n<p>Here is how to do it:<!--more--><\/p>\n<p>In the configuration example below I will first enable manual configuration lock mode.<\/p>\n<p>R1#config t<br \/>\nEnter configuration commands, one per line. End with CNTL\/Z.<br \/>\nR1(config)#configuration mode exclusive manual<br \/>\nR1(config)#end<br \/>\nR1#<\/p>\n<p>Once I enable configuration lock mode, I can view its status using the show configuration lock command. This is shown below:<\/p>\n<p>R1#sh config lock<br \/>\nParser Configure Lock<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br \/>\nOwner PID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : -1<br \/>\nUser\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 6200networks<br \/>\nTTY\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : -1<br \/>\nType\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : NO LOCK<br \/>\n<strong>State\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : FREE<\/strong><br \/>\nClass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : unknown<br \/>\nCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 0<br \/>\nPending Requests\u00a0\u00a0\u00a0\u00a0\u00a0 : 0<br \/>\nUser debug info\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 :<br \/>\nSession idle state\u00a0\u00a0\u00a0 : TRUE<br \/>\nNo of exec cmds getting executed\u00a0\u00a0 : 0<br \/>\nNo of exec cmds blocked\u00a0\u00a0 : 0<br \/>\nConfig wait for show completion\u00a0\u00a0 : FALSE<br \/>\nRemote ip address\u00a0\u00a0\u00a0 : Unknown<br \/>\nLock active time (in Sec)\u00a0\u00a0 : 0<br \/>\nLock Expiration timer (in Sec)\u00a0\u00a0 :0<br \/>\nR1#<\/p>\n<p>Notice the status displays free and the type display that no lock is in place because no user has initiated the feature yet. I will next initiate the configuration lock feature and then run the same command again, this time expecting different results.<\/p>\n<p>R1#config terminal ?<br \/>\nlock\u00a0\u00a0\u00a0\u00a0 Lock configuration mode<br \/>\nrevert\u00a0\u00a0 Parameters for reverting the configuration<\/p>\n<p>R1#config terminal lock<br \/>\n<strong>Configuration mode locked exclusively. The lock will be cleared once you exit out of configuration mode using end\/exit. <\/strong><\/p>\n<p>Enter configuration commands, one per line. End with CNTL\/Z.<br \/>\nR1(config)#<br \/>\n<strong>*Sep 9 17:22:31.531: %PARSER-6-EXPOSEDLOCKACQUIRED: Exclusive configuration lock acquired by user \u20186200networks\u2019 from terminal \u20180? -Process= \u201cExec\u201d, ipl= 0, pid= 184<\/strong><br \/>\nR1(config)#<\/p>\n<p>Notice that after enable configuration lock and move into configuration lock mode, the parser tells me that exculsive lock has been acquired for my configuration session. Once I\u2019m in configuration lock mode I will view the status of the lock session:<\/p>\n<p>R1(config)#do sh config lock<br \/>\nParser Configure Lock<br \/>\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br \/>\nOwner PID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 184<br \/>\nUser\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 6200networks<br \/>\nTTY\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 0<br \/>\n<strong>Type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : EXCLUSIVE<br \/>\nState\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : LOCKED<\/strong><br \/>\nClass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : EXPOSED<br \/>\nCount\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 1<br \/>\nPending Requests\u00a0\u00a0\u00a0\u00a0\u00a0 : 0<br \/>\nUser debug info\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : configure terminal lock<br \/>\nSession idle state\u00a0\u00a0\u00a0 : TRUE<br \/>\nNo of exec cmds getting executed\u00a0\u00a0 : 0<br \/>\nNo of exec cmds blocked\u00a0\u00a0 : 0<br \/>\nConfig wait for show completion\u00a0\u00a0 : FALSE<br \/>\nRemote ip address\u00a0\u00a0 : Unknown<br \/>\nLock active time (in Sec)\u00a0\u00a0 : 47<br \/>\nLock Expiration timer (in Sec)\u00a0\u00a0 : 599<br \/>\nR1(config)#<\/p>\n<p>Upon moving into configuration mode, the parser diplays that the sesion is exclusively locked and this time when I view the status of the lock mode it displays that there is an exclusive lock on the terminal session. Now lets examine what happens when I try and telnet into R1 from R2 while I have the configuration session locked on R1 and I attempt to move into configuration mode.<\/p>\n<p>R2#telnet 192.168.10.1<br \/>\nTrying 192.168.10.1 \u2026 Open<br \/>\n\u2026<br \/>\nUser Access Verification<br \/>\n\u2026<br \/>\nPassword:<br \/>\nR1&gt;en<br \/>\nPassword:<br \/>\nR1#config t<br \/>\n<strong>Configuration mode locked exclusively by user \u20186200network\u2019 process \u2018184? from terminal \u20180?. Please try later. Rollback confirmed change timer is canceled due to configuration lock error.<\/strong><br \/>\nR1#<\/p>\n<p>Obviously the router performed as expected and denied my request to move into configuration mode because of the locked session via the console on R1. Upon exiting the configuration session on R1 you will receive the following display painted via the parser informing you that the session lock has been released.<\/p>\n<p><strong><br \/>\n*Sep 9 17:33:19.647: %PARSER-6-EXPOSEDLOCKRELEASED: Exclusive configuration lock released from terminal \u20180? -Process= \u201cExec\u201d, ipl= 0, pid= 184<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to avoid two people making changes to the configuration at the same time The only command you need to use is the configuration mode exclusive {auto | manual} from global configuration mode. The auto keyword automatically locks the configuration session whenever the configure terminal command is used and this is the default option. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[3],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/31"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=31"}],"version-history":[{"count":4,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":79,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/31\/revisions\/79"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}