<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 4:04 PM, Ramon <span dir="ltr">&lt;<a href="mailto:ramonbatwork@gmail.com" target="_blank">ramonbatwork@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hello all, <br><br></div>
I am currently looking in to a way to implement rollback functionality using rancid. What would it take to reverse bad changes and restore the config of a cisco device back to a previous saved version?<br>
<br></div>I ask because just pushing the original config on top of the modified version would not remove or flush out certain statements, possibly leaving duplicates that would have to be removed manually.<br><br></div>My first idea was to create a negative file, by generating a &quot;no statement&quot; for every line in the new config that does not match the old config. After pushing the negative file and removing the changes I would push the old config to restore any of the deleted statements.<br>

<br></div>Feedback on any foreseeable issues such as possible hierarchical problems (interfaces, acls, bgp) would be very welcomed.<br><br>Thanks,<br>Ramon</div></blockquote><div><br></div><div style>A few problems that I thought of</div>
<div><br></div>If you&#39;re doing a &quot;conf t&quot; and then sending the updates, you need to be able to parse and escape &quot;special&quot; characters, such as the ? in line three below<br><br>1 ip ddns update method <a href="http://dyn.he.net">dyn.he.net</a><br>
2  HTTP<br>3   add <a href="http://dynamicrouter.domain.com:hjo97864hhj06hA@ipv4.dyn.dns.he.net/nic/update?hostname=">http://dynamicrouter.domain.com:hjo97864hhj06hA@ipv4.dyn.dns.he.net/nic/update?hostname=</a>&lt;h&gt;&amp;myip=&lt;a&gt;<br>
<br>The thought of escaping characters lead me onto motd lines...</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">banner motd ^C</div><div class="gmail_quote" style>This is not the router you are looking for</div>
<div class="gmail_quote">^C</div><div><br></div><div style>And finally, the order of NAT rules on an ASA can be critical, this would mean either removing all of them (affecting all traffic) and then adding all of them, or being able to parse all of the NAT rule lines to add the sequence to the rollback, such as <br>
</div><br>    no nat 14<br>    nat (inside,outside) 14 source static i-server <a href="http://i-server.domain.com">i-server.domain.com</a> service tcp-in-https tcp-in-https<br><br></div><div class="gmail_quote" style>I&#39;m sure there are lots of other similar cases</div>
<div class="gmail_quote" style><br></div><div class="gmail_quote" style>If you can cope with a reload, then would go with either a tftp boot, or erase startup, tftp copy to startup and then reload.</div><div class="gmail_quote" style>
<br></div><div class="gmail_quote" style>As well as rancid, I also like to archive to a FTP server, so when TFTP isn&#39;t an option (such as a remote site router, I can simply go</div><div class="gmail_quote" style><br></div>
<div class="gmail_quote" style> erase start</div><div class="gmail_quote" style> copy ftp://user:pass@host/path/file startup</div><div class="gmail_quote" style><br></div><div class="gmail_quote" style>And then reload</div>
<div class="gmail_quote" style><br></div><div class="gmail_quote" style>For a client that bought CSM, I manage their ASA firewalls with CSM, after a particularly bad experience with the built in CSM rollback, I now do the changes and deploy normally rather than a rollback deploy if changes need to be &quot;reverted&quot;.</div>
<div class="gmail_quote" style><br></div><div class="gmail_quote" style>Cheers</div></div></div>