Hi I need to create a script to update a cisco ASA firewall in a backup site. During the day admins modify the configuration on the main site and I need to update de backup site. So I should be able to take the configuration file from the main site, parse it, change the IP's and apply the differences to the backup site. The backup site is a copy of the main site but has different IP address namespace. The thing is that ASA has 3 kinds of settings:
in one line like
where I have to change the IP address that I need to map it so 172.20.20.125 became 172.10.10.125
access-list outside_access_in extended permit tcp any host 172.20.20.1
+25 eq www
access-list outside_access_in extended permit tcp any host 172.20.20.1
+25 eq smtp
several lines with a head
where there is a space in front of every statement and I have to change again de IP
interface GigabitEthernet0/1
nameif inside
security-level 100
ip address 172.20.0.1 255.255.0.0
ospf network point-to-point non-broadcast
several lines with multiple level of indentation
where IP address has to change according to the backup site
username prod_9847776 attributes
service-type remote-access
webvpn
url-list value _10.1.5.20_allow
Which would be the best way to treat this entries to compare the configuration from one site to the other and get the differences that has to be modified before being applied on the second site?
I can't just compare two files line by line, I need to compare in a way by block or something I can't get up with now and I kindly ask your enlightenment.