Upload
son-tran-hong-nam
View
217
Download
1
Embed Size (px)
DESCRIPTION
How to configure BGP MED Attribute
Citation preview
How to configure BGP MED AttributeMED (or metric) is the sixth BGP attribute:
MED can be used to advertise to your neighbors how they should enter your AS. MED is exchanged between autonomous systems. The lowest MED is the preferred path. MED is propagated to all routers within the neighbor AS but not passed along any
other autonomous systems.
Let’s look at an example:
MED (also called metric) is exchanged between autonomous systems and you can use it to let the other AS know which path they should use to enter your AS. Router Julian is sending a MED of 200 towards AS 3. Router Jacob is sending a MED of 300 to AS 3. AS 3 will prefer the lower metric and send all traffic for AS 1 through AS 1. Let me show you how to configure this on a Cisco router:
Above we have two autonomous systems. Router Jim and John will both advertise network 1.1.1.0 /24 in BGP. We can use MED to tell AS 1 which path to use to reach this network.
Jim(config)#router bgp 1Jim(config-router)#neighbor 192.168.12.2 remote-as 2Jim(config-router)#network 1.1.1.0 mask 255.255.255.0John(config)#router bgp 1John(config-router)#neighbor 192.168.23.2 remote-as 2John(config-router)#network 1.1.1.0 mask 255.255.255.0Jack(config)#router bgp 2Jack(config-router)#neighbor 192.168.12.1 remote-as 1Jack(config-router)#neighbor 192.168.23.3 remote-as 1
This is the BGP configuration, nothing special so far.
Jack#show ip bgp BGP table version is 2, local router ID is 192.168.23.2Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 192.168.23.3 0 0 1 i*> 192.168.12.1 0 0 1 i
You have seen the example above before. Router Jack prefers the path through 192.168.12.1. Note that the metric (MED) is 0. Let’s play with the MED now: