I have a pair of layer 3 switches which are talking OSPF. On each switch there are a few static routes which I want to advertise to the other switch. I've redistributed these into OSPF for this purpose.
However there is a third switch to which each of my two switches has an OSPF adjacency. I want to advertise all the routes known to my pair of switches to the third switch, EXCEPT those statics.
My first thought was a simple distribute-list - filtering which routes were advertised out. It turns out this isn't allowed by the software.
As a second option I configured inbound distribute-lists on Switch 3. This didn't work - I'm guessing it's because Switch 3 is an ABR, and my two switches are in a non-backbone area.
How can I do this? All switches are running 12.2 IOS.
An inbound distribute list on a router/switch running OSPF will not prevent the LSAs getting into the Link State Database, but it can prevent the routes getting into the local routing table. From your description I would have thought that this would accomplish what you want. When you say that you configured a distribute list and that it did not work, how were you determining whether it worked or not? If the routes were in the routing table then there was something not correct in your distribute list.
 another possibility to consider: configure 2 OSPF processes on switches 1 and 2. Configure 1 process to talk to switch 1 or 2 and the other process to talk to switch 3. You would need to redistribute routes between the processes and the redistribution can be filtered. This is more complex but if it is important to you to be able to filter routes (and LSAs) being advertised to switch 3 then this approach will work.
Without knowing a bit more about the topology of the network it is difficult to properly evaluate the configuration and operation of the distribute list. Is Gig1/1 the interface that connects to both switch 1 and switch 2? The distribute list as configured only operates on updates received from interface Gig1/1. What happens if you change the distribute list like this:
We are pleased to announce availability of Beta software for 16.6.3. 16.6.3 will be the second rebuild on the 16.6 release train targeted towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are looking for early feedback from custome...