I have an issue of BGP inheriting the Metric value from my IGP into its MED attribute .I have an EBGP peering with my client . I send only specific routers to my ebgp peer using the network commands in BGP.i recieve those prefixes through ospf in in my route table.i dont redistribute those routes to bgp, but use network command to advertise in BGP.
My issue is when these prefixes are send out to my EBGP peer it takes the IGP metric value and attach it as MED value .This is affecting the route selection of my client who is in an MPLS cloud. Is this a normal behaviour ... or how can i stop BGP to send this MED value out.
Discovering that you are actually sending MEDs to an eBGP neighbor, although you never intended to, can come as a surprise, but it does happen. If the route injected into BGP (either using 'network' or 'redistribute' command) comes from an IGP, the MED is derived from the IGP metric, and the route is advertised to an eBGP neighbor with this MED. Guiseppe has already provided a solution for your problem. Another option is to inject routes into BGP using the 'aggregate-address' command, in which case the MED is not set. I personally prefer the 'network' command configuration combined with the solution that Guiseppe suggested.