From: Michael Snyder (msnyder@xxxxxxx)
Date: Sat Aug 18 2001 - 13:42:53 GMT-3
Hi Everyone,
Wanted to give an simple example, then ask if anyone has other math tricks
they can post.
My example comes from a igrp distribute list. I wanted to put a feedback
filter on a redistribute process. Before I even thought about redistribution
of igrp 130 I did a 'show ip route igrp 130' and a 'show ip route connected'.
I used those screens to make what I call a raw access-list. These are the
routes that should never come back into the process. I call it a feedback
filter, can you tell I come from a EE background :)
access-list 50 deny 10.248.18.0 0.0.0.255
access-list 50 deny 10.248.16.0 0.0.0.255
access-list 50 deny 10.248.17.0 0.0.0.255
access-list 50 deny 10.248.0.0 0.0.0.255
access-list 50 deny 10.248.1.0 0.0.0.255
access-list 50 deny 10.248.6.0 0.0.0.255
access-list 50 deny 10.248.4.0 0.0.0.255
access-list 50 deny 10.248.5.0 0.0.0.255
access-list 50 deny 10.248.10.0 0.0.0.255
access-list 50 deny 10.248.8.0 0.0.0.255
access-list 50 deny 10.248.9.0 0.0.0.255
access-list 50 deny 10.252.4.0 0.0.0.255
access-list 50 deny 10.252.0.0 0.0.0.255
access-list 50 deny 10.252.3.0 0.0.0.255
access-list 50 deny 10.252.5.0 0.0.0.255
access-list 50 permit any
While this list works well, it's way too big to leave on the router. I want
to condense it down. I'm going to use the logical operator 'OR' from the
windows calc. Note about logical operators, they don't care what base the
number is in. In other words forget about base conversion.
Lets do the 10.248.yyy.0 0.0.x.255 part first.
I'm going to 'or' all the yyy numbers in order to find what x should be.
18 or 16 or 17 or 0 or 1 or 6 or 4 or 6 or 10 or 8 or 9 = 31
Next I'm going to do the 10.252.yyy.0 0.0.x.255 part
The shortcut key for 'or', is '|' (shifted \ on my keyboard)
4 | 0 | 3 | 5 = 7
The condensed access list is
access-list 50 deny 10.248.0.0 0.0.31.255
access-list 50 deny 10.252.0.0 0.0.7.255
access-list 50 permit any
Note!!! This isn't a silver bullet. The access list has gained some subnets.
For example 10.248.15.0 is now included in this list, where it wasn't before.
Logical 'or' will never drop a subnet, but you will gain subnets.
Well that my math trick. Do you have one to post?
I'm trying to remember how to flip flop any permit list, to an deny list, with
the same functionality , and vice versa. There should be a math based
template to do so.
**Please read:http://www.groupstudy.com/list/posting.html
This archive was generated by hypermail 2.1.4 : Thu Jun 13 2002 - 10:31:53 GMT-3