If I understand the question correctly you have an IGP (or local) route to the network, and you annouce it over BGP. When the route vanishes in the IGP (or local) you want BGP to pull the route.
If that is the case you are doing stuff wrong(TM), and Quagga will not let you easily do this. From the manual for the network command:
BGP: network A.B.C.D/M
This command adds the announcement network.
router bgp 1
network 10.0.0.0/8
This configuration example says that network 10.0.0.0/8 will be announced
to all neighbors. Some vendors' routers don't advertise routes if they
aren't present in their IGP routing tables; bgp doesn't care about IGP
routes when announcing its routes.
This is due to the increased flapping you can easily get if you export IGP information in BGP. We have enough of a route churn on the internet allready, and it's considered bad practice to redistribute routing information from IGP into BGP. BGP is not an IGP, and don't abuse it as one ;)
Also I can't really see any good cases for pulling the route from the Internet (it will cause flapping and you risk getting dampened for hours or days), unless you are ending up in a split-AS situation if this specific route is gone and want to protect yourself from the weird routing issues this can cause. (In this case, you should consider if you want the router to stay online at all. Split-AS situations are nasty!)
The correct solution(TM) is to leave the route up and as stable as possible, regardless of what your IGP is doing. If you lose the connection to the network just drop the traffic locally. Make sure you don't loop it back to your transit provider if the IGP route to the network is down.
The basic rule is "never change your BGP announcements unless it's something the whole Internet has to know about". That your IGP is flapping is not something the rest of the Internet cares about.
Edit:
From what I understand your network looks like this:
Provider (AS 5555) --------------------- Provider (AS 5555)
(12.12.12.12) |
| eBGP |eBGP
| |
Router1---------15.15.15.0/24---------------Router2
172.16.14.1 172.16.14.2
| iBGP |
--------------------------------------------
And your problem is that if you take down the interface on Router1 towards 15.15.15.0/24 you want it to stop announcing the network so you shift the data over to 172.16.14.2. This type of automatic changes to your peering policy is not something you usually do, and is as far as I know not something supported by Quagga. Instead you are expected to reroute the data over the IGP and keep your peerings static. If you were to do changes to your peerings you would change the MED (MULTI_EXIT_DISC) to steer the traffic to the right router.
Note that if taking down 15.15.15.0/24 splits your AS you have additional failure modes, none of them good.
Best Answer
So, I'm still not quite sure what you are looking for, but are you looking for something similar to the below diagram? If so let me know and I can expand on an explaination, or let me know what is missing from this and I'll do my best to get you an example that would be helpful.
Best guess Image http://www.brokenhaze.com/sf_images/demo.png
Ok, so since this seems to be what you are looking to accomplish - I'll go into a little more detail as to what it says (Note as I said in a comment to the question I won't do the work for your but i'll explain it so that you can do it yourself)
First the basic pieces of the diagram. The grey boxes with arrows in them represent the routers, the lines connecting the routers to other pieces are some sort of physical medium - Ethernet, Serial, whatever. The Line with a bunch of little lines represents an Ethernet network which can have just about anything - clients, servers, embedded devices and the like attached to it.
I've used CIDR notation to describe the networks.
Now lets label the routers in the following way:
ROUTER1 - The router with the 192.168.1.1/24 and 192.168.2.1/30 and 192.168.2.5/30 IPs
ROUTER2 - The router with the 192.168.2.2/30 and 192.168.3.1/24 IPs
ROUTER3 - The router with the 192.168.2.6/30 and 192.168.4.1/24 IPs
And now I'll match them up to what you would see from the example you gave me of your
sh ip route
This is your output:
A
sh ip route
on ROUTER2 in my example would produce something similar:What this is telling me is that ROUTER2 knows the following:
So in a very brief summary, this diagram shows you how all the routers are connected and additionally what networks are behind them. You could also put another label on each of the interfaces showing which networks you announce to the other routers via RIP, OSPF, BGP, RIP2, etc.
I hope that helps you out and let me know if you need any more clarification on any of what is going on here.