weird BGP cisco-ism?

if the primary route becomes unavailable and routing falls over to the "nailed
up" route, a bgp update is still sent. (if dampening is enabled) this update
is recorded by ebgp peers as a "flap". i'd guess from your message below that
when this occurs your router(s) are also changing the med attached to the
prefix, which seems normal to me...

i'd suggest you have a look at the stability of the interface to which the
primary route is attached (?carrier transitions, interface resets, etc...?).
you might also consider breaking the primary route (/20) into 2 /21 blocks
internally and allowing the longer "nailed up" route to be the permanent
source of the /20 advertisement. for example:

rather than:

ip route 204.147.224.0 255.255.240.0 <interface> !"primary" route
ip route 204.147.224.0 255.255.240.0 null0 254 !"nailed up" route
!
router bgp <as>
network 204.147.224.0 mask 255.255.240

try this:

ip route 204.147.224.0 255.255.248.0 <interface> !"primary" route
ip route 204.147.232.0 255.255.248.0 <interface> !"primary" route
ip route 204.147.224.0 255.255.240.0 null0 <admin. distance> !"nailed up"
route
!
router bgp <as>
network 204.147.224.0 mask 255.255.240

although correcting the stability problem is the correct solution.

-danny