Sorting NAT Statements... producing useless diffs...
Ed Ravin
eravin at panix.com
Sat Jun 11 20:16:13 UTC 2005
On Sat, Jun 11, 2005 at 12:16:28PM -0700, Roderick B. Greening wrote:
> I think what I'd like to see is the NAT lines get sorted alphabetically.
> That should prevent the lines jumping around I would guess.
>
> Is there a routine/sort in RANCID that I can use to test this theory out?
Play around with this code in rancid:
1459 # order ip host statements
1460 /^ip host (\S+) / &&
1461 ProcessHistory("IPHOST","keysort","$1","$_") && next;
1462 # order ip nat source static statements
1463 /^ip nat (\S+) source static (\S+)/ &&
1464 ProcessHistory("IP NAT $1","ipsort","$2","$_") && next;
And note that "keysort" and "ipsort" evaluate to subroutines elsewhere
in rancid - you can write your own subroutine for the sorting if needed.
More information about the Rancid-discuss
mailing list