Vous êtes sur la page 1sur 49

Gio trnh thc hnh BSCI

Chng 6 - BGP

Chng 6 -

BGP

Bi 6.1 Cu hnh BGP vi default routing 6.1.1 S lun l


4 .0 /2

19 16 2.

8. 0

8.

16

1.

2.

24 0/

19

Router1 S1 AS 100 S0

10.0.0.0/30

172.16.0.0/30

S0

S1

ISP1 AS 200 12.0.1.0/24


Hnh 6.1.1-1: Hnh v s lun l

ISP2 AS 300 172.16.1.0/24

6.1.2

Mc tiu ca bi thc hnh Bi lab ny cu hnh BGP trao i thong tin nh tuyn vi 2 ISP.

6.1.3

Hng dn cu hnh Bc 1: Cu hnh c bn cho Router1, ISP1, ISP2.

Router1 Router(config)#hostname Router1 Router1(config)#enable password cisco Router1(config)#no ip domain-lookup


197

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router1(config)#banner motd ^C Router1^C Router1(config)#line console 0 Router1(config-line)# logging synchronous Router1(config-line)# password cisco Router1(config-line)# login Router1(config)#line vty 0 4 Router1(config-line)# password cisco Router1(config-line)# login Router1(config)#interface Serial 1 Router1(config-if)#ip address 10.0.0.2 255.255.255.252 Router1(config-if)#no shutdown Router1(config-if)#exit Router1(config)#interface loopback 0 Router1(config-if)#ip address 192.168.0.1 255.255.255.0 Router1(config-if)#exit Router1(config)#interface loopback 1 Router1(config-if)#ip address 192.168.1.1 255.255.255.0 Router1(config-if)#exit ISP1 Router(config)#hostname ISP1 ISP1(config)#enable password cisco ISP1(config)#no ip domain-lookup ISP1(config)#banner motd ^C ISP1^C ISP1(config)#line console 0 ISP1(config-line)# logging synchronous ISP1(config-line)# password cisco ISP1(config-line)# login ISP1(config)#line vty 0 4 ISP1(config-line)# password cisco ISP1(config-line)# login IPS1(config)#interface Serial 0 IPS1(config-if)#ip address 10.0.0.1 255.255.255.252 IPS1(config-if)#clock rate 64000 IPS1(config-if)#no shutdown IPS1(config)#int loopback 0 IPS1(config-if)#ip address 12.0.1.1 255.255.255.0

198

Gio trnh thc hnh BSCI

Chng 6 - BGP

IPS2 Router(config)#hostname ISP2 ISP2(config)#enable password cisco ISP2(config)#no ip domain-lookup ISP2(config)#banner motd ^C ISP2^C ISP2(config)#line console 0 ISP2(config-line)# logging synchronous ISP2(config-line)# password cisco ISP2(config-line)# login ISP2(config)#line vty 0 4 ISP2(config-line)# password cisco ISP2(config-line)# login ISP2(config)#interface serial 1 ISP2(config-if)#ip address 172.16.0.1 255.255.255.252 ISP2(config-if)#no shutdown ISP2(config)#interface loopback 0 ISP2(config-if)#ip address 172.16.1.1 255.255.255.0 Bc 2 : Cu hnh BGP trn Router1, ISP1, ISP2. Cu hnh BGP trn Router1 Router1(config)#router bgp 100 Router1(config-router)#neighbor 10.0.0.1 remote-as 200 Router1(config-router)#neighbor 172.16.0.1 remote-as 300 Router1(config-router)#network 192.168.0.0 Router1(config-router)#network 192.168.1.0 Router1(config-router)#exit Cu hnh BGP trn ISP1 IPS1(config)#router bgp 200 IPS1(config-router)#neighbor 10.0.0.2 remote-as 100 IPS1(config-router)#network 12.0.1.0 mask 255.255.255.0 IPS1(config-router)#exit Cu hnh BGP trn ISP2 ISP2(config)#router bgp 300 ISP2(config-router)#neighbor 172.16.0.2 remote-as 100 ISP2(config-router)#network 172.16.1.0 mask 255.255.255.0 IPS2(config-router)#exit Bc 3: kim tra BGP. Kim tra BGP trn Router1
199

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router1#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.0.0/30 is directly connected, Serial0 B 172.16.1.0/24 [20/0] via 172.16.0.1, 00:01:31 10.0.0.0/30 is subnetted, 1 subnets C 10.0.0.0 is directly connected, Serial1 C 192.168.0.0/24 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnets B 12.0.1.0 [20/0] via 10.0.0.1, 00:01:31 C 192.168.1.0/24 is directly connected, Loopback1 Router1#show ip bgp BGP table version is 5, local router ID is 192.168.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 12.0.1.0/24 10.0.0.1 0 0 200 i *> 172.16.1.0/24 172.16.0.1 0 0 300 i *> 192.168.0.0 0.0.0.0 0 32768 i *> 192.168.1.0 0.0.0.0 0 32768 i Kim tra BGP trn ISP1 IPS1#show ip route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 1 subnets B 172.16.1.0 [20/0] via 10.0.0.2, 00:03:07 10.0.0.0/30 is subnetted, 1 subnets C 10.0.0.0 is directly connected, Serial0 B 192.168.0.0/24 [20/0] via 10.0.0.2, 00:03:36 12.0.0.0/24 is subnetted, 1 subnets C 12.0.1.0 is directly connected, Loopback0 B 192.168.1.0/24 [20/0] via 10.0.0.2, 00:02:37 IPS1#show ip bgp BGP table version is 5, local router ID is 10.0.0.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete

200

Gio trnh thc hnh BSCI

Chng 6 - BGP

Network Next Hop Metric LocPrf Weight Path *> 12.0.1.0/24 0.0.0.0 0 32768 i *> 172.16.1.0/24 10.0.0.2 0 100 300 i *> 192.168.0.0 10.0.0.2 0 0 100 i *> 192.168.1.0 10.0.0.2 0 0 100 i Kim tra BGP trn ISP2 ISP2#show ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.0.0/30 is directly connected, Serial1 C 172.16.1.0/24 is directly connected, Loopback0 B 192.168.0.0/24 [20/0] via 172.16.0.2, 00:02:53 12.0.0.0/24 is subnetted, 1 subnets B 12.0.1.0 [20/0] via 172.16.0.2, 00:02:53 B 192.168.1.0/24 [20/0] via 172.16.0.2, 00:02:00 ISP2#show ip bgp BGP table version is 5, local router ID is 172.16.1.1 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 *> 12.0.1.0/24 172.16.0.2 0 100 200 i *> 172.16.1.0/24 0.0.0.0 0 32768 i *> 192.168.0.0 172.16.0.2 0 0 100 i *> 192.168.1.0 172.16.0.2 0 0 100 i

201

Gio trnh thc hnh BSCI

Chng 6 - BGP

Bi 6.2 BGP & The AS_Path Attribute 6.2.1 S lun l


202.0.0.0/24

ISP S0/3/0 AS 300 S0/3/1

192.168.1.4/30

172.25.1.16/30

S0/3/1

S0/0/0

Router1 AS 100 12.0.1.0/24


Hnh 6.2.1-1: Hnh v s lun l

Router2 AS 65000 172.16.1.0/24

6.2.2

Mc tiu ca bi thc hnh

dng AS_PATH Attribute to Filter Routes 6.2.3 Hng dn cu hnh v hnh v minh ha Bc 1: Cu hnh c bn cho ISP, Router1, Router2 Router1 Router(config)#hostname Router1 Router1(config)#enable password cisco Router1(config)#no ip domain-lookup Router1(config)#banner motd ^C Router1^C Router1(config)#line console 0 Router1(config-line)# logging synchronous Router1(config-line)# password cisco
202

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router1(config-line)# login Router1(config)#line vty 0 4 Router1(config-line)# password cisco Router1(config-line)# login Router1(config)#interface serial 0/3/1 Router1(config-if)#ip address 192.168.1.5 255.255.255.252 Router1(config-if)#no shutdown Router1(config)#interface loopback 0 Router1(config-if)#ip address 12.0.1.1 255.255.255.0 Router1(config-if)#exit Router2 Router(config)#hostname Router2 Router2(config)#enable password cisco Router2(config)#no ip domain-lookup Router2(config)#banner motd ^C Router2^C Router2(config)#line console 0 Router2(config-line)# logging synchronous Router2(config-line)# password cisco Router2(config-line)# login Router2(config)#line vty 0 4 Router2(config-line)# password cisco Router2(config-line)# login Router2(config)#interface Serial 0/0/0 Router2(config-if)#ip address 172.24.1.17 255.255.255.252 Router2(config-if)#clock rate 64000 Router2(config-if)#no shutdown Router2(config)#interface loopback 0 Router2(config-if)#ip address 172.16.1.1 255.255.255.0 ISP Router(config)#hostname ISP1 ISP(config)#enable password cisco ISP(config)#no ip domain-lookup ISP(config)#banner motd ^C ISP1^C ISP(config)#line console 0 ISP(config-line)# logging synchronous ISP(config-line)# password cisco ISP(config-line)# login ISP(config)#line vty 0 4

203

Gio trnh thc hnh BSCI

Chng 6 - BGP

ISP(config-line)# password cisco ISP(config-line)# login IPS(config)#interface Serial 0/3/0 IPS(config-if)#ip address 192.168.1.6 255.255.255.252 IPS(config-if)#clock rate 64000 IPS(config-if)#no shutdown IPS(config)#interface interface Serial 0/3/1 IPS(config-if)#ip address 172.25.1.18 255.255.255.252 IPS(config-if)#no shutdown IPS(config)#int loopback 0 IPS(config-if)#ip address 202.0.0.1 255.255.255.0 Bc 2: Cu hnh BGP Cu hnh BGP trn Router1 Router1(config)#router bgp 100 Router1(config-router)#neighbor 192.168.1.6 remote-as 300 Router1(config-router)#network 12.0.1.0 mask 255.255.255.0 Router1(config-router)#exit Router1#show ip route Gateway of last resort is not set B 202.0.0.0/24 [20/0] via 192.168.1.6, 00:00:39 172.16.0.0/24 is subnetted, 1 subnets B 172.16.1.0 [20/0] via 192.168.1.6, 00:00:39 12.0.0.0/24 is subnetted, 1 subnets C 12.0.1.0 is directly connected, Loopback0 192.168.1.0/30 is subnetted, 1 subnets C 192.168.1.4 is directly connected, Serial0/3/1 Cu hnh BGP trn Router2 Router2(config)#router bgp 65000 Router2(config-router)#neighbor 172.25.1.18 remote-as 300 Router2(config-router)#network 172.16.1.0 mask 255.255.255.0 Router2(config-router)#exit Router2#show ip route Gateway of last resort is not set

204

Gio trnh thc hnh BSCI

Chng 6 - BGP

B 202.0.0.0/24 [20/0] via 172.25.1.18, 00:01:55 172.16.0.0/24 is subnetted, 1 subnets C 172.16.1.0 is directly connected, Loopback0 172.25.0.0/24 is subnetted, 1 subnets C 172.25.1.0 is directly connected, Serial0/0/0 12.0.0.0/24 is subnetted, 1 subnets B 12.0.1.0 [20/0] via 172.25.1.18, 00:01:24 Cu hnh BGP trn ISP ISP(config)#router bgp 300 ISP(config-router)#neighbor 192.168.1.5 remote-as 100 ISP(config-router)#neighbor 172.26.1.17 remote-as 65000 ISP(config-router)#network 202.0.0.0 mask 255.255.255.0 ISP(config-router)#exit ISP#show ip route Gateway of last resort is 10.11.6.2 to network 0.0.0.0 C 202.0.0.0/24 is directly connected, Loopback0 172.16.0.0/24 is subnetted, 1 subnets B 172.16.1.0 [20/0] via 172.25.1.17, 00:00:37 172.25.0.0/30 is subnetted, 1 subnets C 172.25.1.16 is directly connected, Serial0/3/1 10.0.0.0/24 is subnetted, 1 subnets C 10.11.6.0 is directly connected, GigabitEthernet0/0 12.0.0.0/24 is subnetted, 1 subnets B 12.0.1.0 [20/0] via 192.168.1.5, 00:00:02 192.168.1.0/30 is subnetted, 1 subnets C 192.168.1.4 is directly connected, Serial0/3/0 Bc 3: Remove the Private AS ISP(config)#router bgp 300 ISP(config-router)#neighbor 192.168.1.5 remove-private-as

205

Gio trnh thc hnh BSCI

Chng 6 - BGP

Kim tra trn Router1

Hnh 6.2.3-1: Show ip bgp trn Router1 kim tra

Bc 4: dng AS_PATH Attribute to Filter Routes ISP(config)#ip as-path access-list 1 deny ^100$ ISP(config)#ip as-path access-list 1 permit .* ISP(config)#router bgp 300 ISP(config-router)#neighbor 172.25.1.17 filter-list 1 out

Hnh 6.2.3-2: Show ip route trn Router1

Hnh 6.2.3-3: Show ip route trn Router2

206

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.2.3-4: Show ip bgp regexp ^100$

207

Gio trnh thc hnh BSCI

Chng 6 - BGP

Bi 6.3 eBGP multihop 6.3.1 S lun l

Fa0/0 BGP AS 1 R1 Fa0/1

10.0.0.0/30 10.0.0.4/30

Fa0/0 BGP AS 2 Fa0/1 R2

1.1.1.1/32

Lo0 : 2.2.2.2/32 Lo1 : 192.168.1.1/24

Hnh 6.3.1-1: S lun l

6.3.2

Mc tiu ca bi thc hnh eBGP multihop c th dng peers. loadshare traffic qua nhiu link eBGP

6.3.3

Hng dn cu hnh v hnh v minh ha Bc 1: Cu hnh c bn R1, R2

R1 Router(config)#hostname R1 R1(config)#enable password cisco R1(config)#no ip domain-lookup R1(config)#banner motd ^C Router1^C R1(config)#line console 0 R1(config-line)# logging synchronous R1(config-line)# password cisco R1(config-line)# login R1(config)#line vty 0 4 R1(config-line)# password cisco R1(config-line)# login R1(config)# interface FastEthernet0/0 R1(config-if)#ip address 10.0.0.1 255.255.255.252 R1(config-if)#no shutdown R1(config)# interface FastEthernet0/1 R1(config-if)#ip address 10.0.0.5 255.255.255.252
208

Gio trnh thc hnh BSCI

Chng 6 - BGP

R1(config-if)#no shutdown R1(config)#interface loopback 0 R1(config-if)#ip address 1.1.1.1 255.255.255.255 R1(config-if)#exit R2 Router(config)#hostname R2 R2(config)#enable password cisco R2(config)#no ip domain-lookup R2(config)#banner motd ^C Router2^C R2(config)#line console 0 R2(config-line)# logging synchronous R2(config-line)# password cisco R2(config-line)# login R2(config)#line vty 0 4 R2(config-line)# password cisco R2(config-line)# login R2(config)# interface FastEthernet0/0 R2(config-if)#ip address 10.0.0.2 255.255.255.252 R2(config-if)#no shutdown R2(config)# interface FastEthernet0/0 R2(config-if)#ip address 10.0.0.6 255.255.255.252 R2(config-if)#no shutdown R2(config)#interface loopback 0 R2(config-if)#ip address 2.2.2.2 255.255.255.0 R2(config)#interface loopback 1 R2(config-if)#ip address 192.168.1.1 255.255.255.0 Bc 2: Cu hnh eBGP multihop trn R1, R2 Cu hnh eBGP multihop trn Router1 R1(config)#router bgp 1 R1(config-router)# neighbor 2.2.2.2 remote-as 2 R1(config-router)# neighbor 2.2.2.2 ebgp-multihop 2 R1(config-router)# neighbor 2.2.2.2 update-source Loopback0 R1(config-router)#exit R1(config)#ip route 2.2.2.2 255.255.255.255 10.0.0.2 R1(config)#ip route 2.2.2.2 255.255.255.255 10.0.0.6 Cu hnh eBGP multihop trn Router2 R2(config)#router bgp 2

209

Gio trnh thc hnh BSCI

Chng 6 - BGP

R2(config-router)#network 192.168.1.0 R2(config-router)# neighbor 1.1.1.1 remote-as 1 R2(config-router)# neighbor 1.1.1.1 ebgp-multihop 2 R2(config-router)#neighbor 1.1.1.1 update-source Loopback0 R2(config-router)#exit R2(config)#ip route 1.1.1.1 255.255.255.255 10.0.0.1 R2(config)#ip route 1.1.1.1 255.255.255.255 10.0.0.5 Bc 3: Kim tra cu hnh

Hnh 6.3.3-1: Show ip route trn R1

Hnh 6.3.3-2: Show ip cef 192.168.1.0

210

Gio trnh thc hnh BSCI

Chng 6 - BGP

Bi 6.4 Cu hnh IBGP v EBGP, Local Preference v MED (MultiExit Discriminator) 6.4.1 S lun l
Lo0: 172.16.64.0/24 EIGRP

R1 S0/3/1 S0/3/0 AS 64512 192.168.1.4/30 EBGP iBGP 172.16.1.0/24

S0/3/0 EBGP ISP S0/3/1 192.168.1.0/30 S0/0/0

S0/0/1

R2

Lo0: 192.168.100.0/24

Lo0: 172.16.32.0/24

Hnh 6.4.1-1: Hnh v s lun l

6.4.2

Mc tiu ca bi thc hnh Cu hnh IBGP v EBGP, Local Preference v MED (Multi-Exit Discriminator)

6.4.3

Hng dn cu hnh v hnh v minh ha Bc 1: Cu hnh c bn trn Router1, Router2, ISP

Router1 Router(config)#hostname Router1 Router1(config)#enable password cisco Router1(config)#no ip domain-lookup


211

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router1(config)#banner motd ^C Router1^C Router1(config)#line console 0 Router1(config-line)# logging synchronous Router1(config-line)# password cisco Router1(config-line)# login Router1(config)#line vty 0 4 Router1(config-line)# password cisco Router1(config-line)# login Router1(config)#interface Serial 0/3/0 Router1(config-if)#ip address 172.16.1.1 255.255.255.0 Router1(config-if)#clock rate 64000 Router1(config-if)#no shutdown Router1(config)#interface serial 0/3/1 Router1(config-if)#ip address 192.168.1.6 255.255.255.252 Router1(config-if)#no shutdown Router1(config)#interface loopback 0 Router1(config-if)#ip address 172.16.64.1 255.255.255.0 Router1(config-if)#exit Router2 Router(config)#hostname Router2 Router2(config)#enable password cisco Router2(config)#no ip domain-lookup Router2(config)#banner motd ^C Router2^C Router2(config)#line console 0 Router2(config-line)# logging synchronous Router2(config-line)# password cisco Router2(config-line)# login Router2(config)#line vty 0 4 Router2(config-line)# password cisco Router2(config-line)# login Router2(config)#interface Serial 0/0/0 Router2(config-if)#ip address 192.168.1.2 255.255.255.252 Router2(config-if)#clock rate 64000 Router2(config-if)#no shutdown Router2(config)#interface Serial 0/0/1 Router2(config-if)#ip address 172.16.1.2 255.255.255.0 Router2(config-if)#no shutdown Router2(config)#interface loopback 0

212

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router2(config-if)#ip address 172.16.32.1 255.255.255.0 ISP Router(config)#hostname ISP ISP(config)#enable password cisco ISP(config)#no ip domain-lookup ISP(config)#banner motd ^C ISP^C ISP(config)#line console 0 ISP(config-line)# logging synchronous ISP(config-line)# password cisco ISP(config-line)# login ISP(config)#line vty 0 4 ISP(config-line)# password cisco ISP(config-line)# login IPS(config)#interface Serial 0/3/0 IPS(config-if)#ip address 192.168.1.5 255.255.255.252 IPS(config-if)#clock rate 64000 IPS(config-if)#no shutdown IPS(config)#interface interface Serial 0/3/1 IPS(config-if)#ip address 192.168.1.1 255.255.255.252 IPS(config-if)#no shutdown IPS(config)#int loopback 0 IPS(config-if)#ip address 192..168.100.1 255.255.255.0 Bc 2 : Cu hnh EIGRP trn Router1 v Router2 Cu hnh EIGRP trn Router1 Router1(config)#router eigrp 64512 Router1(config-router)#network 172.16.1.1 0.0.0.0 Router1(config-router)#network 172.16.64.1 0.0.0.0 Router1(config-router)#no auto-summary

Hnh 6.4.3-1: Show ip eirgp neighbors trn Router1

Cu hnh EIGRP trn Router2 Router2(config)#router eigrp 64512 Router2(config-router)#network 172.16.1.2 0.0.0.0 Router2(config-router)#network 172.16.32.1 0.0.0.0 Router2(config-router)#no auto-summary
213

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.4.3-2: Show ip eirgp neighbors trn Router1

Bc 3: Cu hnh iBGP trn Router1 v Router2 Cu hnh iBGP trn Router1 Router1(config)#router bgp 64512 Router1(config-router)#neighbor 172.16.32.1 remote-as 64512 Router1(config-router)#neighbor 172.16.32.1 update-source loopback 0 Router1(config-router)#end

Hnh 6.4.3-3: Show ip bgp neighbors trn Router1

Cu hnh iBGP trn Router2 Router2(config)#router bgp 64512 Router2(config-router)#neighbor 172.16.64.1 remote-as 64512 Router2(config-router)#neighbor 172.16.64.1 update-source loopback 0 Router2(config-router)#end

Hnh 6.4.3-4: Show ip bgp neighbors trn Router2

Bc 4: Cu hnh EBGP (ISP run EBGP vi Router1 v Router2) Cu hnh EBGP trn ISP ISP(config)#router bgp 200 ISP(config-router)#neighbor 192.168.1.6 remote-as 64512 ISP(config-router)#neighbor 192.168.1.2 remote-as 64512 ISP(config-router)#network 192.168.100.0 mask 255.255.255.0 ISP(config-router)#network 192.168.1.4 mask 255.255.255.252 ISP(config-router)#network 192.168.1.0 mask 255.255.255.252 ISP(config-router)#end Cu hnh EBGP trn Router1 Router1(config)#router bgp 64512 Router1(config-router)#neighbor 192.168.1.5 remote-as 200 Router1(config-router)#network 172.16.64.0 mask 255.255.255.0 Router1(config-router)#network 172.16.1.0 mask 255.255.255.0 Router1(config-router)#end

214

Gio trnh thc hnh BSCI

Chng 6 - BGP

Cu hnh EBGP trn Router2 Router2(config)#router bgp 64512 Router2(config-router)#neighbor 192.168.1.1 remote-as 200 Router2(config-router)#network 172.16.32.0 mask 255.255.255.0 Router2(config-router)#network 172.16.1.0 mask 255.255.255.0 Router2(config-router)#end Bc 5: Kim tra BGP Neighbors

Hnh 6.4.3-5: Show ip bgp neighbors trn ISP

Hnh 6.4.3-6: Show ip bgp neighbors trn Router1

Hnh 6.4.3-7: Show ip bgp neighbors trn Router2

Bc 6 Kim tra Which Path Traffic Takes

Hnh 6.4.3-8: Show ip bgp trn ISP

215

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.4.3-9: Show ip bgp trn Router1

Hnh 6.4.3-10: Show ip bgp trn Router2

Bc 7: BGP Next-Hop-Self Kim tra trc khi s dng Next-Hop-Seft

Hnh 6.4.3-11: Show ip bgp Router1 trc khi dng Next-Hop-Self

216

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.4.3-12: Show ip route Router1 trc khi dng Next-Hop-Self

Hnh 6.4.3-13: Show ip bgp Router2 trc khi dng Next-Hop-Self

Hnh 6.4.3-14: Show ip route Router2 trc khi dng Next-Hop-Self

Cu hnh Next-Hop-Self trn Router1 Router1(config)#router bgp 64512 Router1(config-router)#neighbor 172.16.32.1 next-hop-self Cu hnh Next-Hop-Self trn Router2 Router2(config)#router bgp 64512
217

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router2(config-router)#neighbor 172.16.64.1 next-hop-self Kim tra sau khi s dng Next-Hop-Self

Hnh 6.4.3-15: Show ip route Router1 sau khi dng Next-Hop-Self

Hnh 6.4.3-16: Show ip route Router2 sau khi dng Next-Hop-Self

Bc 8: Set BGP Local Preference Set BGP Local Preference trn Router1 Router1(config)#route-map PRIMARY_LocPrf_IN permit 10 Router1(config-route-map)#set local-preference 150 Router1(config-route-map)#exit Router1(config)#router bgp 64512 Router1(config-router)#neighbor 192.168.1.5 route-map PRIMARY_ LocPrf_IN in Router1(config-router)#end Router1#clear ip bgp * soft Set BGP Local Preference trn Router2 Router2(config)#route-map SECONDARY_ LocPrf_IN permit 10 Router2(config-route-map)#set local-preference 125 Router2(config-route-map)#exit Router2(config)#router bgp 64512

218

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router2(config-router)#neighbor 192.168.1.1 route-map LocPrf_IN in Router2(config-router)#end Router2#clear ip bgp * soft Kim tra kt qu sau khi set BGP Local Preference

SECONDARY_

Hnh 6.4.3-17: Show ip bgp sau khi set BGP Local Preference trn Router1

Hnh 6.4.3-18: Show ip bgp sau khi set BGP Local Preference trn Router2

Bc 9: Set BGP MED Set BGP MED trn Router1 Router1(config)#route-map PRIMARY_MED_OUT permit 10 Router1(config-route-map)#set metric 50 Router1(config-route-map)#exit Router1(config)#router bgp 64512 Router1(config-router)#neighbor 192.168.1.5 PRIMARY_MED_OUT out Router1(config-router)#end Router1#clear ip bgp * soft Set BGP MED trn Router2 Router2(config)#route-map SECONDARY_MED_OUT permit 10 Router2(config-route-map)#set metric 100 Router2(config-route-map)#exit

route-map

219

Gio trnh thc hnh BSCI

Chng 6 - BGP

Router2(config)#router bgp 64512 Router2(config-router)#neighbor SECONDARY_MED_OUT out Router2(config-router)#end Router2#clear ip bgp * soft Kim tra kt qu sau khi set BGP MED

192.168.1.1

route-map

Hnh 6.4.3-19: Show ip bgp trn ISP sau khi set BGP MED

Bc 10: Establish a Default Network Router1(config)#ip default-network 192.168.100.0 Router1(config)#router bgp 64512 Router1(config-router)#neighbor 172.16.32.1 default-originate Router1(config-router)#end Kim tra cu hnh trn Router1 v Rout2

Hnh 6.4.3-20: Show ip route trn Router1 sau khi c default network

220

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.4.3-21: Show ip route tren Router2 sau khi c default network

221

Gio trnh thc hnh BSCI

Chng 6 - BGP

Bi 6.5 BGP v EIGRP 6.5.1 S lun l

BGP AS 65001 & EIGRP AS 65001

Lo0 : 10.2.2.2/24 Lo1 : 10.20.0.1/24 Lo2 : 10.20.1.1/24 Lo3 : 10.20.2.1/24 Lo4 : 10.20.3.1/24

International R2 S0/0/1 S0/0/0

10.1.102.0/29

10.1.203.0/29

Lo0: 10.3.3.3/24

S0/3/0 Lo0: 10.1.1.1/24 R1 Gi0/0 S0/3/1 10.1.103.0/29 S0/0

S0/1

R3 S0/2

192.168.34.0/30 BGP AS 65002 & EIGRP AS 65002 192.168.14.0/30 Fa0/1 SW1 Providers Lo1 : 172.16.0.1/22 Lo2 : 172.16.4.1/22 Lo3 : 172.16.8.1/22 Lo4 : 172.16.12.1/22 Fa0/2 Fa0/0 R4

S0/3/0

Hnh 6.5.1-1: Hnh v s lun l

6.5.2

Mc tiu ca bi thc hnh Cu hnh Provider network vi EIGRP AS 65002 (Tt chc nng automatic summarization trn c 2 domain ca EIGRP)

222

Gio trnh thc hnh BSCI

Chng 6 - BGP

Cu hnh International network vi BGP AS 65001 v Provider network vi BGP 65002 Qung b mng 192.168.14.0/30 v 192.168.34.0/30 trn c 2 AS ca EIGRP Tt c router tham gia vo BGP. Cu hnh tt c router dng full mest iBGP. Qung b tt c interface loopback vo BGP, ngoi tr R2, ch qun b loopback 10.2.2.0/24. Trn R2, to mt static summary route cho cc interface loopback cn li v qun b static route ny vo BGP. R4 gi mt summary route ca tt c interface loopback ti vng International. Nhng Router trong vng International s dng ng i ti vng Provider thng qua lin kt Ethernet gia R1 v R4. hon thnh vic ny, cn phi chnh sa thng s Local Preference ca cc ng route qun b t Providers. 6.5.3 Hng dn cu hnh v hnh v minh ha Bc 1: Cu hnh c bn cho R1, R2, R3, R4 R1 Router(config)#hostname R1 R1(config)#enable password cisco R1(config)#no ip domain-lookup R1(config)#banner motd ^C R1^C R1(config)#line console 0 R1(config-line)# logging synchronous R1(config-line)# password cisco R1(config-line)# login R1(config)#line vty 0 4 R1(config-line)# password cisco R1(config-line)# login R1(config)#interface Serial 0/3/0 R1(config-if)#ip address 10.1.102.1 255.255.255.248 R1(config-if)#clock rate 64000 R1(config-if)#no shutdown

223

Gio trnh thc hnh BSCI

Chng 6 - BGP

R1(config-if)#exit R1(config)#interface Serial 0/3/1 R1(config-if)#ip address 10.1.103.1 255.255.255.248 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#interface loopback 0 R1(config-if)#ip address 10.1.1.1 255.255.255.0 R1(config-if)#exit R1(config)#interface GigabitEthernet 0/0 R1(config-if)#ip add 192.168.14.1 255.255.255.252 R1(config-if)#no shutdown R1(config-if)#exit R2 Router(config)#hostname R2 R2(config)#enable password cisco R2(config)#no ip domain-lookup R2(config)#banner motd ^C R2^C R2(config)#line console 0 R2(config-line)# logging synchronous R2(config-line)# password cisco R2(config-line)# login R2(config)#line vty 0 4 R2(config-line)# password cisco R2(config-line)# login R2(config)#interface serial 0/0/0 R2(config-if)#ip address 10.1.203.2 255.255.255.248 R2(config-if)#clock rate 64000 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#interface serial 0/0/1 R2(config-if)#ip address 10.1.102.2 255.255.255.248 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#interface loopback 0 R2(config-if)#ip address 10.2.2.2 255.255.255.0 R2(config-if)#exit R2(config)#interface loopback 1 R2(config-if)#ip address 10.20.0.1 255.255.255.0 R2(config-if)#exit

224

Gio trnh thc hnh BSCI

Chng 6 - BGP

R2(config)#interface loopback 2 R2(config-if)#ip address 10.20.1.1 255.255.255.0 R2(config-if)#exit R2(config)#interface loopback 3 R2(config-if)#ip address 10.20.2.1 255.255.255.0 R2(config-if)#exit R2(config)#interface loopback 4 R2(config-if)#ip address 10.20.3.1 255.255.255.0 R2(config-if)#exit R3 Router(config)#hostname R3 R3(config)#enable password cisco R3(config)#no ip domain-lookup R3(config)#banner motd ^C R3^C R3(config)#line console 0 R3(config-line)# logging synchronous R3(config-line)# password cisco R3(config-line)# login R3(config)#line vty 0 4 R3(config-line)# password cisco R3(config-line)# login R3(config)#interface Serial 0/0 R3(config-if)#ip address 10.1.103.3 255.255.255.248 R3(config-if)#clock rate 64000 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface Serial 0/1 R3(config-if)#ip address 10.1.203.3 255.255.255.248 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface Serial 0/3 R3(config-if)#ip address 192.168.34.1 255.255.255.252 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface loopback 0 R3(config-if)# ip address 10.3.3.3 255.255.255.0 R3(config-if)#exit R4 Router(config)#hostname R4

225

Gio trnh thc hnh BSCI

Chng 6 - BGP

R4(config)#enable password cisco R4(config)#no ip domain-lookup R4(config)#banner motd ^C R4^C R4(config)#line console 0 R4(config-line)# logging synchronous R4(config-line)# password cisco R4(config-line)# login R4(config)#line vty 0 4 R4(config-line)# password cisco R4(config-line)# login R4(config)#interface Serial 0/3/0 R4(config-if)# ip address 192.168.34.2 255.255.255.252 R4(config-if)#clock rate 64000 R4(config-if)#no shutdown R4(config-if)#exit R4(config)#interface FastEthernet 0/0 R4(config-if)#ip add 192.168.14.2 255.255.255.252 R4(config-if)#no shut R4(config-if)#no shutdown R4(config-if)#exit R4(config)#interface loopback 0 R4(config-if)# ip address 10.4..4.4 255.255.255.0 R4(config-if)#exit R4(config)#interface loopback 1 R4(config-if)# ip address 172.16.0.1 255.255.252.0 R4(config-if)#exit R4(config)#interface loopback 2 R4(config-if)# ip address 172.16.4.1 255.255.252.0 R4(config-if)#exit R4(config)#interface loopback 3 R4(config-if)# ip address 172.16.8.1 255.255.252.0 R4(config-if)#exit R4(config)#interface loopback 4 R4(config-if)# ip address 172.16.12.1 255.255.252.0 R4(config-if)#exit Bc 2 : Cu hnh International network vi EIGRP AS 65001 Cu hnh EIGRP trn R1 R1(config)#router eigrp 65001
226

Gio trnh thc hnh BSCI

Chng 6 - BGP

R1(config-router)#network 10.1.1.1 0.0.0.0 R1(config-router)#network 10.1.102.1 0.0.0.0 R1(config-router)#network 10.1.103.1 0.0.0.0 R1(config-router)#no auto-summary R1(config-router)#exit Cu hnh EIGRP trn R2 R2(config)#router eigrp 65001 R2(config-router)#network 10.2.2.2 0.0.0.0 R2(config-router)#network 10.1.102.2 0.0.0.0 R2(config-router)#network 10.1.203.2 0.0.0.0 R2(config-router)#network 10.20.0.1 0.0.0.0 R2(config-router)#network 10.20.1.1 0.0.0.0 R2(config-router)#network 10.20.2.1 0.0.0.0 R2(config-router)#network 10.20.3.1 0.0.0.0 R2(config-router)#no auto-summary R2(config-router)#exit Cu hnh EIGRP trn R3 R3(config)#router eigrp 65001 R3(config-router)#network 10.3.3.3 0.0.0.0 R3(config-router)#network 10.1.103.3 0.0.0.0 R3(config-router)#network 10.1.203.3 0.0.0.0 R3(config-router)#no auto-summary R3(config-router)#exit Kim tra cu hnh

Hnh 6.5.3-1: Show ip eigrp neighbors trn R1

Hnh 6.5.3-2: Show ip route eigrp trn R1

227

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-3: Show ip eigrp neighbors trn R2

Hnh 6.5.3-4: Show ip route eigrp trn R2

Hnh 6.5.3-5: Show ip eigrp neighbors trn R3

Hnh 6.5.3-6: Show ip route eigrp trn R3

Bc 3: Cu hnh Provider network vi EIGRP AS 65002 (Tt chc nng automatic summarization trn c 2 domain ca EIGRP) Cu hnh EIGRP trn R1 R1(config)#router eigrp 65002 R1(config-router)#network 192.168.14.1 0.0.0.0 R1(config-router)#no auto-summary R1(config-router)#exit Cu hnh EIGRP trn R3 R3(config)#router eigrp 65002 R3(config-router)#network 192.168.34.1 0.0.0.0 R3(config-router)#no auto-summary R3(config-router)#exit Cu hnh EIGRP trn R4 R4(config)#router eigrp 65002 R4(config-router)#network 192.168.14.2 0.0.0.0 R4(config-router)#network 192.168.34.2 0.0.0.0 R4(config-router)#network 10.4.4.4 0.0.0.0
228

Gio trnh thc hnh BSCI

Chng 6 - BGP

R4(config-router)#no auto-summary R4(config-router)#exit Bc 4: Cu hnh International network vi BGP AS 65001 v Provider network vi BGP 65002 Cu hnh BGP trn R1 R1(config)#router bgp 65001 R1(config-router)#neighbor 10.2.2.2 remote-as 65001 R1(config-router)#neighbor 10.3.3.3 remote-as 65001 R1(config-router)#neighbor 10.2.2.2 update-source loopback 0 R1(config-router)#neighbor 10.3.3.3 update-source loopback 0 R1(config-router)#neighbor 192.168.14.2 remote-as 65002 R1(config-router)#exit Cu hnh BGP trn R2 R2(config)#router bgp 65001 R2(config-router)#neighbor 10.1.1.1 remote-as 65001 R2(config-router)#neighbor 10.3.3.3 remote-as 65001 R2(config-router)#neighbor 10.1.1.1 update-source loopback 0 R2(config-router)#neighbor 10.3.3.3 update-source loopback 0 R2(config-router)#exit Cu hnh BGP trn R3 R3(config)#router bgp 65001 R3(config-router)#neighbor 10.1.1.1 remote-as 65001 R3(config-router)#neighbor 10.2.2.2 remote-as 65001 R3(config-router)#neighbor 10.1.1.1 update-source loopback 0 R3(config-router)#neighbor 10.2.2.2 update-source loopback 0 R3(config-router)#neighbor 192.168.34.2 remote-as 65002 R3(config-router)#exit Cu hnh BGP trn R4 R4(config)#router bgp 65002 R4(config-router)#neighbor 192.168.14.1 remote-as 65001 R4(config-router)#neighbor 192.168.34.1 remote-as 65001 R4(config-router)#exit Kim tra cu hnh

Hnh 6.5.3-7: Show ip bgp neighbors trn R1

229

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-8: Show ip bgp neighbors trn R2

Hnh 6.5.3-9: Show ip bgp neighbors trn R3

Hnh 6.5.3-10: Show ip bgp neighbors trn R4

Bc 5: Qung b mng 192.168.14.0/30 v 192.168.34.0/30 trn c 2 AS ca EIGRP Cu hnh EIGRP trn R1 R1(config)#router eigrp 65001 R1(config-router)#network 192.168.14.1 0.0.0.0 R1(config-router)#exit Cu hnh EIGRP trn R3 R3(config)#router eigrp 65001 R3(config-router)#network 192.168.34.1 0.0.0.0 R3(config-router)#exit Kim tra cu hnh

Hnh 6.5.3-11: Show ip route eigrp trn R1

230

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-12: Show ip route eigrp trn R3

Bc 6: Tt c router tham gia vo BGP. Cu hnh tt c router dng full mest iBGP. Qung b tt c interface loopback vo BGP, ngoi tr R2, ch qun b loopback 10.2.2.0/24. Cu hnh BGP trn R1 R1(config)#router bgp 65001 R1(config-router)#network 10.1.1.0 mask 255.255.255.0 R1(config-router)#network 10.1.102.0 mask 255.255.255.248 R1(config-router)#network 10.1.103.0 mask 255.255.255.248 R1(config-router)#exit Cu hnh BGP trn R2 R2(config)#router bgp 65001 R2(config-router)#network 10.2.2.0 mask 255.255.255.0 R2(config-router)# network 10.1.102.0 mask 255.255.255.248 R2(config-router)# network 10.1.203.0 mask 255.255.255.248 R2(config-router)#network 10.20.0.0 mask 255.255.255.0 R2(config-router)#network 10.20.1.0 mask 255.255.255.0 R2(config-router)#network 10.20.2.0 mask 255.255.255.0 R2(config-router)#network 10.20.3.0 mask 255.255.255.0 R2(config-router)#exit Cu hnh BGP trn R3 R3(config)#router bgp 65001 R3(config-router)#network 10.3.3.0 mask 255.255.255.0 R3(config-router)#network 10.1.203.0 mask 255.255.255.248 R3(config-router)#network 10.1.103.0 mask 255.255.255.248 R3(config-router)#exit Cu hnh BGP trn R4 R4(config)#router bgp 65002 R4(config-router)#network 10.4.4.0 mask 255.255.255.0
231

Gio trnh thc hnh BSCI

Chng 6 - BGP

R4(config-router)#network 192.168.14.0 mask 255.255.255.252 R4(config-router)#network 192.168.34.0 mask 255.255.255.252 R4(config-router)#network 172.16.0.0 mask 255.255.252.0 R4(config-router)#network 172.16.4.0 mask 255.255.252.0 R4(config-router)#network 172.16.8.0 mask 255.255.252.0 R4(config-router)#network 172.16.12.0 mask 255.255.252.0 R4(config-router)#exit Kim tra cu hnh

Hnh 6.5.3-13: Show ip bgp trn R1

Hnh 6.5.3-14: Show ip route bgp trn R1

232

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-15: Show ip bgp trn R2

Hnh 6.5.3-16: Show ip route bgp trn R2

233

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-17: Show ip bgp trn R3

Hnh 6.5.3-18: Show ip route bgp trn R3

234

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-19: Show ip bgp trn R4

Hnh 6.5.3-20: Show ip route bgp trn R4

Bc 7: Trn R2, to mt static summary route cho cc interface loopback cn li v qun b static route ny vo BGP. R2(config)#router bgp 65001 R2(config-router)#aggregate-address 10.20.0.0 255.255.252.0 R2(config-router)#exit

235

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-21: Show ip bgp trn R2

236

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-22: Show ip bgp trn R4

Hnh 6.5.3-23: show ip route bgp trn R4

Bc 8: R4 gi mt summary route ca tt c interface loopback ti vng International. R4(config)#router bgp 65002 R4(config-router)#aggregate-address 172.16.0.0 255.255.240.0 R4(config-router)#end

237

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-24: Show ip bgp trn R4

238

Gio trnh thc hnh BSCI

Chng 6 - BGP

Hnh 6.5.3-25: Show ip bgp trn R2

Hnh 6.5.3-26: Show ip route bgp trn R2

Bc 9: R4 s dng ng n vng International bng lin kt gia R1 v R4. Hon thnh vic ny bng vic thay i thng s MED qun b ti v Providers. R4(config)#route-map PRIMARY_MED_OUT permit 10 R4(config-route-map)#set metric 50 R4(config-route-map)#exit R4(config)#route-map SECONDARY_MED_OUT permit 10 R4(config-route-map)#set metric 100 R4(config-route-map)#exit R4(config)#router bgp 65002
239

Gio trnh thc hnh BSCI

Chng 6 - BGP

R4(config-router)#neighbor 192.168.14.1 route-map PRIMARY_MED_OUT out R4(config-router)#neighbor 192.168.34.1 SECONDARY_MED_OUT out R4(config-router)#end R4#clear ip bgp * soft Kim tra kt qu sau khi set BGP MED route-map

Bc 10: Nhng Router trong vng International s dng ng i ti vng Provider thng qua lin kt Ethernet gia R1 v R4. hon thnh vic ny, cn phi chnh sa thng s Local Preference ca cc ng route qun b t Providers. Set BGP Local Preference trn Router1 R1(config)#route-map PRIMARY_LocPrf_IN permit 10 R1(config-route-map)#set local-preference 150 R1(config-route-map)#exit R1(config)#router bgp 65001 R1(config-router)#neighbor 192.168.14.2 route-map PRIMARY_ LocPrf_IN in R1(config-router)#end R1#clear ip bgp * soft Set BGP Local Preference trn Router2 R3(config)#route-map SECONDARY_ LocPrf_IN permit 10 R3(config-route-map)#set local-preference 50 R3(config-route-map)#exit R3(config)#router bgp 64512 R3(config-router)#neighbor 192.168.34.2 route-map SECONDARY_ LocPrf_IN in R3(config-router)#end R3#clear ip bgp * soft

240

Gio trnh thc hnh BSCI

Chng 6 - BGP

Bi 6.6 BGP Route Reflectors & Filters 6.6.1 S lun l


200.100.50.0/24

R2 S0/3/1 S0/3/0

192.168.1.4/30

172.24.1.0/24 AS 100

S0/3/0 R1

S0/0/1 R3 199.9.9.0/24

Hnh 6.6.1-1: Hnh v s lun l

6.6.2

Mc tiu bi thc hnh Bi lab ny cu hnh IBGP routers dng route reflector v route filter

6.6.3

Hng dn cu hnh v hnh v minh ha Bc 1: Cu hnh c bn cho R1, R2, R3

R1 Router(config)#hostname R1 R1(config)#enable password cisco R1(config)#no ip domain-lookup R1(config)#banner motd ^C R1^C R1(config)#line console 0 R1(config-line)# logging synchronous R1(config-line)# password cisco R1(config-line)# login R1(config)#line vty 0 4 R1(config-line)# password cisco

241

Gio trnh thc hnh BSCI

Chng 6 - BGP

R1(config-line)# login R1(config)#interface Serial 0/3/0 R1(config-if)#ip address 192.168.1.5 255.255.255.252 R1(config-if)#clock rate 64000 R1(config-if)#no shutdown R1(config)#int loopback 0 R1(config-if)#ip address 192..168.100.1 255.255.255.0 R2 Router(config)#hostname R2 R2(config)#enable password cisco R2(config)#no ip domain-lookup R2(config)#banner motd ^C R2^C R2(config)#line console 0 R2(config-line)# logging synchronous R2(config-line)# password cisco R2(config-line)# login R2(config)#line vty 0 4 R2(config-line)# password cisco R2(config-line)# login R2(config)#interface Serial 0/3/0 R2(config-if)#ip address 172.24.1.1 255.255.255.0 R2(config-if)#clock rate 64000 R2(config-if)#no shutdown R2(config)#interface serial 0/3/1 R2(config-if)#ip address 192.168.1.6 255.255.255.252 R2(config-if)#no shutdown R2(config)#interface loopback 0 R2(config-if)#ip address 200.100.50.1 255.255.255.0 R2(config-if)#exit R3 Router(config)#hostname R3 R3(config)#enable password cisco R3(config)#no ip domain-lookup R3(config)#banner motd ^C R3^C R3(config)#line console 0 R3(config-line)# logging synchronous R3(config-line)# password cisco R3(config-line)# login

242

Gio trnh thc hnh BSCI

Chng 6 - BGP

R3(config)#line vty 0 4 R3(config-line)# password cisco R3(config-line)# login R3(config)#interface Serial 0/0/1 R3(config-if)#ip address 172.24.1.2 255.255.255.0 R3(config-if)#no shutdown R3(config)#interface loopback 0 R3(config-if)# ip address 199.9.9.1 255.255.255.0 R3(config-if)#exit Bc 2: Cu hnh IBGP peers cho BGP. Sau cu hnh R2 route reflector. Sau khi cu hnh xong R2, cu hnh 2 router cn li l route reflector clients. IBGP kg cn cu hnh full mesh. Kim tra R2 c established peering vi R1 v R3 hay khng? Cu hnh EIGRP cho R1, R2, R3 R1(config)#router eigrp 100 R1(config-router)#network 192.168.1.5 0.0.0.0 R1(config-router)#no auto-summary R1(config-router)#end R2(config)#router eigrp 100 R2(config-router)#network 172.24.1.1 0.0.0.0 R2(config-router)#network 192.168.1.6 0.0.0.0 R2(config-router)#network 200.100.50.1 0.0.0.0 R2(config-router)#passive-interface loopback 0 R2(config-router)#no auto-summary R2(config-router)#end R3(config)#router eigrp 100 R3(config-router)#network 172.24.1.2 0.0.0.0 R3(config-router)#passive-interface loopback 0 R3(config-router)#no auto-summary R3(config-router)#end Cu hnh iBGP cho R1, R2, R3 R1(config)#router bgp 100 R1(config-router)#neighbor 192.168.1.6 remote-as 100 R1(config-router)#end R2(config)#router bgp 100
243

Gio trnh thc hnh BSCI

Chng 6 - BGP

R2(config-router)#neighbor 192.168.1.5 remote-as 100 R2(config-router)#neighbor 172.24.1.2 remote-as 100 R2(config-router)#end R3(config)#router bgp 100 R3(config-router)#neighbor 172.24.1.1 remote-as 100 R3(config-router)#end Bc 3: Inject an External Route vo BGP R3(config)#router bgp 100 R3(config-router)#network 199.9.9.0 mask 255.255.255.0

Hnh 6.6.3-1: show ip route tren R1

R2(config)#router bgp 100 R2(config-router)#neighbor 192.168.1.5 route-reflector-client R2(config-router)#neighbor 172.24.1.2 route-reflector-client R2(config-router)#end

Hnh 6.6.3-2: Show ip route tren R1 khi su dung route-reflector-client

244

Gio trnh thc hnh BSCI

Chng 6 - BGP

Bc 4: Inject mt Summary Address vo BGP, cu hnh R3 inject mt summary address vo BGP R3(config)#router bgp 100 R3(config-router)#aggregate-address 199.0.0.0 255.0.0.0 R3(config-router)#end

Hnh 6.6.3-3: Show ip route tren R1

Hnh 6.6.3-4: show ip bgp trn R2

R2(config)#ip prefix-list SUPERNETONLY permit 199.0.0.0/8 R2(config)#router bgp 100 R2(config-router)#neighbor 192.168.1.5 prefix-list SUPERNETONLY out R2(config-router)#end

Hnh 6.6.3-5: show ip route tren R1 khi su dung prefix-list

245

Vous aimerez peut-être aussi