Monday, 13 June 2011

BGP - Part3

Understanding MED













Local router: R1
ISP routers: R2 and R3
Speed of R1-R2 link: 1.544Mbps
Speed of R1-R3 link: 768 kbps
ျပဳလုပ္ၿပီး configuration မ်ား... All connections between routers, BGP on R2 and R3 (including iBGP peering), loopback0 interface on R1 (with IP address of 1.1.1.1 /24)
Objective: ISP မွ local သို႔လာေသာ traffic ေတြကို R1-R2 link ကိုသာသံုးေစၿပီး R1-R3 link ကို backup link ျဖစ္ေအာင္ျပဳလုပ္ျခင္း။

Firstly... Basic BGP configuration on R1:
R1(config)# router bgp 65065
R1(config-router)# network 1.1.1.0 mask 255.255.255.0
R1(config-router)# neighbor 172.16.12.1 remote-as 65001
R1(config-router)# neighbor 172.16.12.5 remote-as 65001
.....
.....
*Mar  1 03:52:45.519: %BGP-5-ADJCHANGE: neighbor 172.16.12.1 Up
*Mar  1 03:52:49.515: %BGP-5-ADJCHANGE: neighbor 172.16.12.5 Up

Checking R2 and R3...
R2# sh ip bgp
BGP table version is 2, local router ID is 172.16.12.9
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop         Metric  LocPrf   Weight   Path
* i1.1.1.0 /24     172.16.12.10        0       100           0       65065 i
*>                      172.16.12.2          0                        0       65065 i

R3# sh ip bgp
BGP table version is 2, local router ID is 172.16.12.10
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop         Metric  LocPrf   Weight   Path
* i 1.1.1.0 /24    172.16.12.9         0       100            0       65065 i
*>                      172.16.12.6         0                         0       65065 i

Start tuning MED on R1:
R1(config-router)# exit
R1(config)# ip access-list standard BGP_NETWORKS
R1(config-std-nacl)# permit 1.1.1.0 0.0.0.255

R1(config-std-nacl)# route-map MED_100 permit 10
R1(config-route-map)# match ip address BGP_NETWORKS
R1(config-route-map)# set metric 100

R1(config-router)# neighbor 172.16.12.5 route-map MED_100 out
R1(config-router)# do clear ip bgp *
.....
.....
*Mar  1 04:06:05.014: %BGP-5-ADJCHANGE: neighbor 172.16.12.1 Down User reset
*Mar  1 04:06:05.014: %BGP-5-ADJCHANGE: neighbor 172.16.12.5 Down User reset
*Mar  1 04:06:43.766: %BGP-5-ADJCHANGE: neighbor 172.16.12.5 Up
*Mar  1 04:06:48.154: %BGP-5-ADJCHANGE: neighbor 172.16.12.1 Up

See result on R3
R3# sh ip bgp
BGP table version is 6, local router ID is 172.16.12.10
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop       Metric   LocPrf   Weight   Path
*>i1.1.1.0 /24    172.16.12.9        0       100              0     65065 i
*                        172.16.12.6                  100             0     65065 i

13/6/2011

No comments:

Post a Comment