cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2642
Views
0
Helpful
9
Replies

how to send med to isp neighbour?

julxu
Level 1
Level 1

Hi

I need pass med from my end of asr1004 to my ebgp neighbour, and I have only found  commandnd 'set metric xxx" on route-map. but, I want pass the med value which routing table has. how can I do it?

#sh ip bgp
BGP table version is 555, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path

*>i 10.10.13.0/24 10.1.1.1 15 100 0 ? 

Can I pass metric 15 to my neighbour, and if the metric change to 20 on the system, I want it automatically change to 20, is it possible? if so, how can I do it?

Any comments will be appreciated

Thanks in advance

julxu

9 Replies 9

milan.kulik
Level 10
Level 10

Hi,

possibly

set metric-type internal

might help you?

http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_bgp/command/irg-cr-book/bgp-n1.html#wp8712179670

It's slightly different though: it's passing the IGP metric to the route next-hop in the MED value.

Best regards,

Milan

Hi Milan

I have put set metric-type internal to route-map without set metric xxx.

Command is ok, but my external support still can not see the med. 

route-map isp-IPv4-OUT permit 15
match ip address subnets-to-isp
set metric-type internal
set community 50   -> this is our current setting, - use community. 

am I did wrong?

Please advise.

julxu

Hi Julxu,

can you provide an example of one prefix?

What are you advertising to the neighbor and what does he see?

Sh ip bgp ..., sh ip route..., sh ip bgp nei ... advertised outputs would help.

Best regards,

Milan

Hi Milan

thanks for help troubleshooting.

sh ip bgp neighbors 1.1.1.1 advertised-routes
BGP table version is 578, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path

*>i 10.10.13.0/24 10.10.2.1 15 100 0 ?

#sh ip bgp | i 10.10.13
*>i 10.10.13.0/24 10.10.2.1 15 100 0 ?

#sh ip bgp neighbors 1.1.1.1
BGP neighbor is 1.1.1.1, remote AS xxxx, external link
Description: AARNet3 10G (UTS)
BGP version 4, remote router ID 1.1.1.2
BGP state = Established, up for 1y9w
Last read 00:00:00, last write 00:00:03, hold time is 10, keepalive interval is 3 seconds
Neighbor sessions:
1 active, is not multisession capable (disabled)
Neighbor capabilities:
Route refresh: advertised and received(new)
Four-octets ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Address family IPv4 Multicast: received
Graceful Restart Capability: received
Remote Restart timer is 120 seconds
Address families advertised by peer:
none
Enhanced Refresh Capability: advertised
Multisession Capability:
Stateful switchover support enabled: NO for session 1
Message statistics:
InQ depth is 0
OutQ depth is 0

.....
BGP table version 578, neighbor version 578/0
Output queue size : 0
Index 12, Advertise bit 2
12 update-group member
Community attribute sent to this neighbor
Inbound path policy configured
Outbound path policy configured
Route map for incoming advertisements is isp-IPv4-IN
Route map for outgoing advertisements is isp-IPv4-OUT

notice, the band-out is configure as:

Regards

Julie

Hi,

so you are advertising the prefix 10.10.13.0/24 to your neighbor with MED=15.

Does he receive it correctly and accept the MED value?

If not, which MED value does he see? Is he using any route-map to change the MED value of incoming prefixes?

Could you please also provide

sh ip route 10.10.13.1

sh ip route 10.10.2.1 

output for sure?

Best regards,

Milan

Additionally of what has been suggested by milan.kulik, many ISPs encourage the use of BGP Communities when looking to modify BGP Path Attributes on their networks.

I hope this helps.

Best Regards.

#sh ip route 10.10.13.1
Routing entry for 10.10.13.0/24
Known via "bgp private-number-for-ibgp", distance 200, metric 15, type internal
Last update from 10.10.2.1 1w0d ago
Routing Descriptor Blocks:
* 10.10.2.1, from 10.10.2.1, 1w0d ago
Route metric is 15, traffic share count is 1
AS Hops 0
MPLS label: none
#sh ip route 10.10.2.1
Routing entry for 10.10.2.0/24
Known via "static", distance 1, metric 0
Redistributing via bgp "bgp private-number-for-ibgp"
Routing Descriptor Blocks:
* 10.10.1.13
Route metric is 0, traffic share count is 1

I have called them, but, they can not see the metrix that total. and they told me they do allow to use metrix

Hi,

looking to the details deeper, I'm afraid the MED value received from your iBGP neighbor will not be forwarded to your ISP eBGP neighbor.

See here

http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/112965-bgpmed-attr-00.html#s1

for details.

As Hector Gustavo said, you might try to agree with your ISP how to use communities instead.

See some examples here:

http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/28784-bgp-community.html

Best regards,

Milan

Hello julxu,

BGP will automatically set the MED path attribute based on the route's metric shown in the Routing Table.

Remember that for BGP to be able to advertise a route, it should exist in the routing table via either Directly Connected, Static, or any Routing Protocol, when not received via BGP.

For instance:

R2#show ip route eigrp
<OMITTED FOR BREVITY>


      1.0.0.0/32 is subnetted, 1 subnets
D        1.1.1.1 [90/156160] via 10.1.2.1, 00:08:55, FastEthernet0/0
R2#

R2#show ip bgp
<OMITTED FOR BREVITY>


     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.1/32       10.1.2.1            156160         32768 i
R2#

Also, MED is included by default in the BGP advertisement  (R3# is BGP peer with R2#)

R3#show ip bgp  
<OMITTED FOR BREVITY>

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.1/32       10.2.3.2            156160             0 2 i
R3#

If BGP is locally originating an advertisement which exists in the Routing Table as Directly Connected or Static, BGP sets the MED to 0.

You can still manipulate the MED value using a Route-Map.

For example:

!
route-map SET-MED permit 10
 set metric 20000
!
router bgp 2
<OMITTED FOR BREVITY>
 neighbor 10.2.3.3 route-map SET-MED out
!

Do not forget to 'clear' the BGP peer in order to commit the change.

clear ip bgp * soft out

I hope this helps.

Best Regards.

PS: Be careful with changes you do in live networks.

Review Cisco Networking for a $25 gift card