Sunteți pe pagina 1din 226

BGP

................................................................................................................................. 2
BGP AS ............................................................................................................................. 3
BGP ......................................................................................................................... 4
BGP ..................................................................................................................... 6
BGP TTL ............................................................................................................................ 8
BGP AS_Path ..................................................................................................................... 8
BGP ................................................................................................................... 11
BGP Synchronization ........................................................................................................ 12
Path Attributes ................................................................................................................ 14
BGP RIB-Failure ............................................................................................................... 21
BGP........................................................................................................... 22
BGP.................................................................................................................. 26
BGP ................................................................................................................ 82
BGP ...............................................................................................................102
BGP ...............................................................................................................104
BGP.................................................................................................................111
BGP Peer Group ..............................................................................................................117
BGP Community .............................................................................................................128
BGP Reflector(BGP) ..............................................................................................156
BGP Confederation(BGP) ..........................................................................................176
BGP ...............................................................................................................195
BGP Dampening..............................................................................................................205
BGPIGP............................................................................................................218

http://bbs.hh010.com


IP
IP IP
IP
IP
IP
IP
IP

http://bbs.hh010.com

autonomous systemAS
AS
AS AS
AS Interior Gateway Protocol
(IGP) AS AS Border Gateway Protocol (BGP)
AS

AS AS ISP ISP
ISP
AS
AS IGP RIPEIGRPOSPFIS-IS
AS BGPEIGRP
AS EIGRP AS
EIGRP AS AS EIGRP AS
EIGRP AS BGP AS
AS BGP AS EIGRP AS
BGP AS
BGP classless interdomain routing (CIDR)

BGP AS
BGP AS Internet Assigned Number Authority (IANA)
IOS BGP 4 AS
AS 2009 1 2
AS 1-65535 2009 1 (IANA) 4 AS
65536 -4294967295

http://bbs.hh010.com

2 AS 1-65535 4 AS
BGP BGP AS
AS BGP
IANA AS BGP ISP
AS AS AS
AS AS 1-64511 AS 64512-65534 AS
AS AS
AS
AS ISP AS

BGP
PC FTP PC FTP
PC ping FTP
FTP PC
PC FTP TCP
BGP
BGP
BGP TCP
179 179
BGP TCP BGP
ping BGP

BGP BGP-Speaker BGP


BGP-Peer
OSPF OSPF
OSPF BGP BGP
BGP

BGP IP BGP
IP

IP Version 4 (IPv4),

http://bbs.hh010.com

IP Version 6 (IPv6),
Virtual Private Networks version 4 (VPNv4),
Connectionless Network Services (CLNS),
Layer 2 VPN (L2VPN).

address family address family


Ipv4 address family
BGP NLRI address family
AFI MPLS AFI NLRI NLRI
Ipv4
IOS AFI IPv4, IPv6, CLNS, VPNv4 IPv4 IPv6

BGP version 4 BGP


AS address family
address family BGP
Ipv4
BGP AS BGP
AS internal BGP (iBGP)
AS external BGP (eBGP)BGP eBGP
iBGP
BGP

BGP hello
Keepalive 60 hold timer 180 180
Keepalive

http://bbs.hh010.com

BGP

IdleBGP BGP
peer TCP peer
idle
Connect peer TCP
Active peer TCP idle
OpenSent TCP BGP OPEN peer
OpenSent Active
OpenReceive peer OPEN keepalive
keepalive Established notification idle
notification idle
Established peer keepalive
keepalive hold timer notification idle

BGP
BGP BGP BGP
BGP
IP IP BGP
IP
BGP
BGP IP BGP
BGP
IP BGP
IP BGP

http://bbs.hh010.com

BGP
IP BGP
IP BGP
BGP BGP

R1 R2 BGP R1
12.1.1.2R2 12.1.1.1R1
F0/0 IP 12.1.1.2BGP F0/0
12.1.1.1 R2 F0/0 IP
12.1.1.1BGP F0/0 12.1.1.2 R1
IP12.1.1.2 R2 BGP 12.1.1.2 BGP
R1 R2 IP R1

R1 R2 F0/0 S0/0
R1 10.1.1.1R2 20.1.1.2
IP BGP

BGP BGP
loopback
BGP loopback
TCP
loopback

http://bbs.hh010.com

BGP BGP loopback


IP BGP BGP
loopback BGP
R1 2.2.2.2BGP 1.1.1.1 R2
1.1.1.1BGP 2.2.2.2 IP
BGP
BGP

BGP TTL
BGP AS BGP
AS internal BGP (iBGP)
AS external BGP (eBGP)
BGP DOS BGP BGP eBGP
iBGP BGP
TTL eBGP TTL 1
eBGP iBGP iBGP
TTL 255 eBGP TTL
255

BGP AS_Path
BGP AS AS AS
BGP AS
AS BGP
AS eBGP AS
AS AS AS
AS AS AS-path BGP
AS_PATH AS
BGP eBGP
AS-path AS iBGP AS
iBGP AS AS

http://bbs.hh010.com

AS eBGP AS-path
AS AS AS-path AS 10
AS 20 AS-path 10 AS 20 AS 30
AS 20 AS-path 20,10 AS 30 AS 50
AS 50 AS-path 30,20,10 AS 30 AS 40AS 40
AS 10 AS-path 40,30,20,10 AS 10
AS-path AS 10

IGP
BGP path-vector routing
AS-path
BGP eBGP AS AS-path
iBGP AS-path AS
iBGP iBGP
BGP AS
BGP eBGP iBGP iBGP

http://bbs.hh010.com

iBGP eBGP BGP


BGP iBGP iBGP
eBGP

R1 eBGP R6 iBGP
R3 R4 R3 iBGP R1 iBGP
eBGP R3 R1 eBGP R5
R3 R4 R1 iBGP R2
R2 R2 R1 R2
BGP AS iBGP
AS 20

http://bbs.hh010.com

AS iBGP BGP Reflector(BGP


) BGP ConfederationBGP

BGP
BGP BGP BGP
BGP BGP
IGP
show ip route IGP IGP
IGP BGP
BGP show ip bgp BGP
BGP BGP BGP
BGP BGP
BGP BGP
BGP BGP
BGP IGP BGP
BGP BGP
BGP

http://bbs.hh010.com

BGP eBGP iBGP BGP AD


BGP eBGP AD 20 eBGP
IGP iBGP AD 200
IGP BGP AD BGP
BGP BGP AD 200
iBGP AD IGP
eBGP iBGP
AD BGP
AD

BGP Synchronization
BGP TCP
TCP IGP
TCP
TCP BGP AS
BGP IGP BGP
IGP
AS IGP BGP
TCP BGP BGP
BGP IGP
IGP BGP
BGP BGP
TCP BGP

IGP IGP BGP


BGP BGP
BGP IGP IGP

http://bbs.hh010.com

R1 R4 eBGP R3 R5 eBGP R1
R3 iBGP R1 R3 iBGP R1 3.3.3.3
R3R1 BGP 1.1.1.1 R3 1.1.1.1 R1
R3 BGP 3.3.3.3 1.1.1.1 3.3.3.3
TCP R1R2R3 IGP OSPFOSPF 1.1.1.1
3.3.3.3 AS
AS 10 R4 10.1.1.0/24 AS 20 R1 R1 R3
iBGP R1 10.1.1.0/24 R3 R3
10.1.1.0/24 AS 30 R5 R5 10.1.1.0/24 R3
R3 10.1.1.0/24 iBGP 1.1.1.1
R3 1.1.1.1 R1 R3
OSPF R3 1.1.1.1 R2
23.1.1.2 R2 OSPF BGP R2 BGP
10.1.1.0/24 R2 10.1.1.0/24

http://bbs.hh010.com

BGP iBGP
IGP BGP IGP
IGP BGP
AS IGP
BGP BGP
BGP iBGP
eBGP IGP

iBGP IGP
R3 iBGP R1 eBGP R5
IGP
IGP show ip route
iBGP iBGP IGP
eBGP

BGP IOS 12.2(8)T

Path Attributes

BGP
IGP
metric BGP
BGP metric BGP
Path Attributes
BGP BGP

Well-Known Mandatory

Well-Known Discretionary

http://bbs.hh010.com

Optional Transitive

Optional Nontransitive

Well-Known Mandatory
BGP
BGP
BGP
BGP BGP
BGP OriginNext_HopAS-path

Well-Known Discretionary
BGP

BGP
Optional Transitive
BGP
BGP
BGP

Optional Nontransitive
BGP

BGP

http://bbs.hh010.com

BGP

1Origin
BGP BGP
BGP BGP
BGP BGP
BGP BGP
Origin Origin
BGP BGP
IGP show ip route
IGP BGP BGP
network IGP BGP
network IGP BGP
BGP network BGP
Origin IGP
BGP EGP EGP BGP
EGP EGP Origin
EGP
BGP IGP EGP BGP
Origin Incomplete
BGP Origin
IGP EGPEGP Incomplete
IGP>EGP>Incomplete

2AS_Path
AS_Path BGP AS AS_Path
AS

http://bbs.hh010.com

AS_Path
AS_SEQUENCE AS AS AS_Path
AS_SET AS AS AS_Path
AS_Path

BGP AS-Path

3Next_Hop
BGP BGP BGP
BGP TCP
IGP BGP
IGP
BGP eBGP Next-hop
iBGP
Next-hop
BGP Next-hop

BGP BGP
Next-hop 0.0.0.0

4Local_Pref

Local_Pref Local AS AS
Local_Pref AS
Local_Pref AS AS

Local_Pref BGP iBGP


eBGP Local_Pref Local_Pref

http://bbs.hh010.com

AS BGP Local_Pref 100


AS 100

100

BGP Local_Pref
Local_Pref 110 100 110
Local_Pref AS
Local_Pref AS AS

http://bbs.hh010.com

AS 10 BGP R3 R1 R2 AS 20
R4 AS 10 Local_Pref
R1 Local_Pref 110 R2 R3
R1 AS 20 R1 Local_Pref 110 R2 Local_Pref
100 R3 R1

R1 R2 iBGP R3 Local_Pref R3
iBGP R1 iBGP R2 Local_Pref
iBGP iBGP Local_Pref

5MULTI_EXIT_DISCMED

MED BGP metric eBGP


iBGP Local_Pref
eBGP MEDMED BGP
metric MED MED 0
Local_Pref AS MED AS
eBGP MED iBGP MED
MED eBGP eBGP
iBGP 0 AS
iBGP MED 0 AS

MED

http://bbs.hh010.com

AS 20 R4 AS 10
R1 R2 eBGP MED R4
R2 MED 10 R1 MED R4 R1
AS 10 R1 MED 0 R2 MED 10
eBGP AS
MED eBGP AS MED
eBGP MED BGP bgp
always-compare-med

http://bbs.hh010.com

6.Weight
Weight Cisco Cisco Weight
Weight BGP
WeightWeight 0~65535 0 BGP Weight
32768 Weight
Weight
BGP Weight
Cisco Weight
Weight Cisco BGP

BGP RIB-Failure
BGP BGP BGP
BGP BGP
BGP BGP
BGP

iBGP IGP iBGP

BGP RIB-Failure RIB-Failure

IGP BGP AD

http://bbs.hh010.com

VRF

BGP
IP TCP
AS
BGP eBGP TTL 1
BGP IP IP

BGP
BGP
BGP

BGP
BGP
BGP

1. Weight
Weight Weight Cisco
Weight 0 32768

2. LOCAL_PREF
Weight LOCAL_PREF 100

http://bbs.hh010.com

3.
LOCAL_PREF BGP
0.0.0.0 BGP
network IGP BGP
network

4. AS_PATH
AS_PATH
bgp bestpath aspath ignore AS_PATH
AS_SET 1 AS
AS_SET AS BGP AS

5. Origin
AS_PATH Origin Origin
BGP BGP IGP
EGP IGP EGPEGP Incomplete
IGP>EGP>Incomplete

6. MED
Origin MED
AS MED AS
MED BGP bgp always-compare-med
AS MED 0
MED 0

7.eBGP iBGP

http://bbs.hh010.com

MED eBGP iBGP


eBGP AD 20 iBGP AD 200 BGP
eBGP iBGP AD
AD BGP

8. IGP metric
eBGP iBGP IGP metric

9.
BGP

BGP

BGP
maximum-paths n eBGP
maximum-paths ibgp n iBGP

n 6 1

eBGP iBGP maximum-paths eibgp


n Ipv4 VRF MPLS VPN eBGP iBGP

10. eBGP

http://bbs.hh010.com


BGP bgp best path comparerouterid
IOS Router-ID

11. Router-ID
BGP Router-ID OSPF Router-ID

12. cluster list AS_PATH


[cluster list BGP reflector (RR) AS_PATH]

13.

TCP

http://bbs.hh010.com

BGP

Loopback
R1

Loopback 0

1.1.1.1/32

Loopback 11

11.1.1.1/24

R2

Loopback 0

2.2.2.2/32

Loopback 22

22.2.2.2/24

R3

Loopback 0

3.3.3.3/32

Loopback 33

33.3.3.3/24

R4

Loopback 0

4.4.4.4/32

Loopback 44

44.4.4.4/24

OSPF Loopback 0 OSPF


Loopback 0 BGP

http://bbs.hh010.com

1.IGP Loopback 0
OSPF Loopback 0 BGP

1 OSPF

R1
r1(config)#router ospf 1
r1(config-router)#router-id 1.1.1.1
r1(config-router)#network 12.1.1.1 0.0.0.0 area 0
r1(config-router)#network 13.1.1.1 0.0.0.0 area 0
r1(config-router)#network 1.1.1.1 0.0.0.0 area 0

R2
r2(config)#router ospf 1
r2(config-router)#router-id 2.2.2.2
r2(config-router)#network 12.1.1.2 0.0.0.0 area 0
r2(config-router)#network 24.1.1.2 0.0.0.0 area 0
r2(config-router)#network 2.2.2.2 0.0.0.0 area 0

R3
r3(config)#router ospf 1
r3(config-router)#router-id 3.3.3.3

http://bbs.hh010.com

r3(config-router)#network 13.1.1.3 0.0.0.0 area 0


r3(config-router)#network 34.1.1.3 0.0.0.0 area 0
r3(config-router)#network 3.3.3.3 0.0.0.0 area 0

R4
r4(config)#router ospf 1
r4(config-router)#router-id 4.4.4.4
r4(config-router)#network 24.1.1.4 0.0.0.0 area 0
r4(config-router)#network 34.1.1.4 0.0.0.0 area 0
r4(config-router)#network 4.4.4.4 0.0.0.0 area 0

Loopback 0 OSPF

2. IGP

1 R1 OSPF
r1#show ip ospf neighbor

Neighbor ID
Time

Pri

Address

3.3.3.3

State

Dead

Interface
1

FULL/BDR

00:00:34

13.1.1.3

stEthernet0/1

http://bbs.hh010.com

Fa

2.2.2.2

FULL/BDR

00:00:38

12.1.1.2

Fa

stEthernet0/0
r1#
R1 R2 R3 OSPF

2 R4 OSPF
r4#show ip ospf neighbor

Neighbor ID
Time

Pri

Address

3.3.3.3

State

Dead

Interface
1

FULL/DR

00:00:34

34.1.1.3

Fa

FULL/DR

00:00:29

24.1.1.2

Fa

stEthernet0/0
2.2.2.2
stEthernet0/1
r4#
R4 R2 R3 OSPF

3 R1 loopback 0
r1#ping 2.2.2.2 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1

http://bbs.hh010.com

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
r1#
r1#ping 3.3.3.3 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
r1#ping 4.4.4.4 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
r1#
loopback 0 BGP

http://bbs.hh010.com

3. BGP

1 R1 R2 BGP
r1(config)#router bgp 1
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#neighbor 2.2.2.2 remote-as 1
R1 Router-ID 2.2.2.2 AS 1

2 R1 R2 BGP
r2(config)#router bgp 1
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 1.1.1.1 remote-as 1
R2 Router-ID 1.1.1.1 AS 1

(3) BGP
r1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor
Up/Down

AS MsgRcvd MsgSent

TblVer

InQ OutQ

State/PfxRcd

2.2.2.2
never

Active

http://bbs.hh010.com

r1#
R1 R2 BGP 2.2.2.2

12.1.1.2 1.1.1.1 12.1.1.1

4 R1 BGP
r1(config)#router bgp 1
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
R1 loopback 0 1.1.1.1 R2

1.1.1.1 R1

5 R1 BGP
r1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor
Up/Down

TblVer

InQ OutQ

State/PfxRcd

2.2.2.2
00:05:43

AS MsgRcvd MsgSent

r1#
R1 R2 BGP

http://bbs.hh010.com

6 R2 BGP
r2(config)#router bgp 1
r2(config-router)#neighbor 1.1.1.1 update-source loopback 0
R1 R2 BGP

R2 R1

4. R2 R4 BGP

1 R2 BGP
r2(config)#router bgp 1
r2(config-router)#neighbor 4.4.4.4 remote-as 4
r2(config-router)#neighbor 4.4.4.4 update-source loopback 0
R2 4.4.4.4 AS 4 R2 loopback 0

2.2.2.2

2 R4 BGP
r4(config)#router bgp 4
r4(config-router)#bgp router-id 4.4.4.4
r4(config-router)#neighbor 2.2.2.2 remote-as 1
r4(config-router)#neighbor 2.2.2.2 update-source loopback 0
R4 Router-ID 2.2.2.2 AS 1R4

4.4.4.4

http://bbs.hh010.com

3 BGP
r2#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor
Up/Down

TblVer

InQ OutQ

State/PfxRcd

1.1.1.1
00:08:45

12

12

4.4.4.4
never

AS MsgRcvd MsgSent

Idle

r2#
R2 R4 eBGP
hello TTL 1 R2 2.2.2.2

R4 4.4.4.4 TTL

4 R2 R4 TTL
r2(config)#router bgp 1
r2(config-router)#neighbor 4.4.4.4 ebgp-multihop

r4(config)#router bgp 4
r4(config-router)#neighbor 2.2.2.2 ebgp-multihop

http://bbs.hh010.com

R2 R4 TTL 255

5 BGP
r2#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 1
BGP table version is 1, main routing table version 1

Neighbor
Up/Down

AS MsgRcvd MsgSent

TblVer

InQ OutQ

State/PfxRcd

1.1.1.1
00:10:27

14

14

4.4.4.4
00:00:16

r2#

5. BGP

1 BGP
R1
r1#sh ip bgp

http://bbs.hh010.com

r1#

R2
r2#sh ip bgp
r2#

R4
r4#sh ip bgp
r4#
BGP

2 R1 BGP
r1(config)#router bgp 1
r1(config-router)#network 11.1.1.0 mask 255.255.255.0
11.1.1.0/24 BGP network

IGP show ip route


BGP

3 R1 BGP
1#sh ip bgp
BGP table version is 2, local router ID is 1.1.1.1

http://bbs.hh010.com

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

*> 11.1.1.0/24

0.0.0.0

Metric LocPrf Weight Path


0

32768 i

r1#
R1 network 11.1.1.0/24 BGP

Next Hop 0.0.0.0 weight 32768 i


origin IGP IGP BGP

4 R2 BGP
r2(config)#route-map loop permit 10
r2(config-route-map)#match interface loopback 22

r2(config)#router bgp 1
r2(config-router)#redistribute connected route-map loop
R2 22.2.2.0/24 BGP

5 R2 BGP

http://bbs.hh010.com

r2#sh ip bgp
BGP table version is 2, local router ID is 2.2.2.2
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

* i11.1.1.0/24

1.1.1.1

*> 22.2.2.0/24

0.0.0.0

100

0 i
32768 ?

r2#
R2 BGP

Next Hop 0.0.0.0 weight 32768


origin incomplete 11.1.1.0/24 R1
1.1.1.1 i iBGP
i origin IGP

6 R4 BGP
r4(config)#router bgp 4
r4(config-router)#network 44.4.4.0 mask 255.255.255.0
network 44.4.4.0/24 BGP

http://bbs.hh010.com

7 R4 BGP
r4#sh ip bgp
BGP table version is 3, local router ID is 4.4.4.4
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

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

0 1 ?
32768 i

r4#
R4 network BGP

Next Hop 0.0.0.0 weight 32768 origin IGP


22.2.2.0/24 eBGP R2 2.2.2.2
? origin incomplete

6. BGP

1 R1 BGP
r1#sh ip bgp
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,

http://bbs.hh010.com

r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*> 11.1.1.0/24

0.0.0.0

* i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

4.4.4.4

100

0 4 i

32768 i

r1#
R1 11.1.1.0/24

> BGP 22.2.2.0/24


44.4.4.0/24 > BGP
i
iBGP iBGP IGP

2 R1 iBGP IGP
r1(config)#router bgp 1
r1(config-router)#no synchronization

3 R1 BGP
r1#sh ip bgp
BGP table version is 4, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,

http://bbs.hh010.com

r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

*>i44.4.4.0/24

4.4.4.4

100

0 4 i

32768 i

r1#
iBGP IGP

4 R4 BGP
r4#sh ip bgp
BGP table version is 3, local router ID is 4.4.4.4
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

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

0 1 ?
32768 i

http://bbs.hh010.com

r4#
R4 iBGP IGP

R1 11.1.1.0/24

5 R2 BGP
r2#sh ip bgp
BGP table version is 3, local router ID is 2.2.2.2
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

* i11.1.1.0/24

1.1.1.1

*> 22.2.2.0/24

0.0.0.0

*> 44.4.4.0/24

4.4.4.4

100

0 i
32768 ?
0 4 i

r2#
11.1.1.0/24 iBGP iBGP IGP

R4

6 R2 iBGP IGP
r2(config)#router bgp 1

http://bbs.hh010.com

r2(config-router)#no synchronization
7 R2 BGP
r2#sh ip bgp
BGP table version is 4, local router ID is 2.2.2.2
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

*>i11.1.1.0/24

1.1.1.1

*> 22.2.2.0/24

0.0.0.0

*> 44.4.4.0/24

4.4.4.4

100

0 i
32768 ?
0 4 i

r2#
iBGP IGP

8 R4 BGP
r4#sh ip bgp
BGP table version is 4, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,

http://bbs.hh010.com

r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*> 11.1.1.0/24

2.2.2.2

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

0 1 i
0 1 ?
32768 i

r4#
R1R2R4

RIB failure
1.R4 OSPF

1R4 OSPF
r4(config)#int loopback 100
r4(config-if)#ip address 100.1.1.1 255.255.255.0
r4(config-if)#ip ospf network point-to-point

r4(config)#router ospf 1
r4(config-router)#network 100.1.1.1 0.0.0.0 area 0

http://bbs.hh010.com

R4 100.1.1.0/24 OSPF

2R4 100.1.1.0/24 BGP


r4(config)#router bgp 4
r4(config-router)#network 100.1.1.0 mask 255.255.255.0

3 R4 BGP
r4#sh ip bgp
BGP table version is 7, local router ID is 4.4.4.4
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

*> 11.1.1.0/24

2.2.2.2

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

32768 i

*> 100.1.1.0/24

0.0.0.0

32768 i

0 1 i
0 1 ?

r4#
100.1.1.0/24 BGP 0.0.0.0

weight 32768

http://bbs.hh010.com

2. RIB failure

1 R2 BGP
r2#sh ip bgp
BGP table version is 7, local router ID is 2.2.2.2
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

*>i11.1.1.0/24

1.1.1.1

*> 22.2.2.0/24

0.0.0.0

*> 44.4.4.0/24

4.4.4.4

0 4 i

*> 100.1.1.0/24

4.4.4.4

0 4 i

100

0 i
32768 ?

r2#
R2 eBGP R4 100.1.1.0/24 AD 20

OSPF AD 110 OSPF AD BGP AD BGP

2 R1 BGP
r1#sh ip bgp

http://bbs.hh010.com

BGP table version is 6, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

*>i44.4.4.0/24

4.4.4.4

100

0 4 i

r>i100.1.1.0/24

4.4.4.4

100

0 4 i

32768 i

r1#
R2 iBGP R2 100.1.1.0/24 AD 200

OSPF AD 110 OSPF AD BGP AD BGP


RIB failure r

(3) R1 RIB failure


r1#sh ip bgp rib-failure
Network

Next Hop

RIB-failure

Matches
100.1.1.0/24
distance

4.4.4.4

Higher admin

n/a

r1#

http://bbs.hh010.com

RIB-NH

100.1.1.0/24 RIB failure BGP

AD

BGP
1. R1R2R3R4 BGP

1 R3 BGP
R1
r1(config)#router bgp 1
r1(config-router)#neighbor 3.3.3.3 remote-as 1
r1(config-router)#neighbor 3.3.3.3 update-source loopback 0

R3
r3(config)#router bgp 1
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#neighbor 1.1.1.1 remote-as 1
r3(config-router)#neighbor 1.1.1.1 update-source loopback 0

r3(config-router)#neighbor 4.4.4.4 remote-as 4


r3(config-router)#neighbor 4.4.4.4 update-source loopback 0

http://bbs.hh010.com

r3(config-router)#neighbor 4.4.4.4 ebgp-multihop

R4
r4(config)#router bgp 4
r4(config-router)#neighbor 3.3.3.3 remote-as 1
r4(config-router)#neighbor 3.3.3.3 update-source loopback 0
r4(config-router)#neighbor 3.3.3.3 ebgp-multihop

2 R3 BGP
r3#sh ip bg summary
BGP router identifier 3.3.3.3, local AS number 1
BGP table version is 4, main routing table version 4
3 network entries using 351 bytes of memory
3 path entries using 156 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 903 total bytes of memory
BGP activity 3/0 prefixes, 3/0 paths, scan interval 60 secs

http://bbs.hh010.com

Neighbor
Up/Down

AS MsgRcvd MsgSent

TblVer

InQ OutQ

State/PfxRcd

1.1.1.1
00:02:08

4.4.4.4
00:00:08

r3#
R3 BGP

2. AS 1

1 R1 BGP
r1#sh ip bgp
BGP table version is 6, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

32768 i
100

0 ?

http://bbs.hh010.com

* i44.4.4.0/24

4.4.4.4

100

0 4 i

*>i

4.4.4.4

100

0 4 i

r i100.1.1.0/24

4.4.4.4

100

0 4 i

r>i

4.4.4.4

100

0 4 i

r1#
R1 iBGP R4 44.4.4.0

4.4.4.4 R2 R3
2 R2 R3 R1
r2(config)#router bgp 1
r2(config-router)#neighbor 1.1.1.1 next-hop-self

r3(config)#router bgp 1
r3(config-router)#neighbor 1.1.1.1 next-hop-self

3 R1 BGP
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.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

http://bbs.hh010.com

Network

Next Hop

Metric LocPrf Weight Path

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

3.3.3.3

100

0 4 i

*>i

2.2.2.2

100

0 4 i

r i100.1.1.0/24

3.3.3.3

100

0 4 i

r>i

2.2.2.2

100

0 4 i

32768 i

r1#
44.4.4.0/24 R2 R3

R1 R2 R3 R4 44.4.4.0/24
R4 R2 R3 R1 11.1.1.0/24

1. Weight
2. LOCAL_PREF
3.

4. AS_PATH
5. Origin

http://bbs.hh010.com

6. MED
7.eBGP iBGP
8. IGP metric
9.

10. eBGP
11. Router-ID
12. cluster list AS_PATH
13.

13
Router-ID

R2 R3 Router-ID
1 R3 Router-ID R2
r3(config)#router bgp 1
r3(config-router)#bgp router-id 2.2.2.2
r3(config-router)#

http://bbs.hh010.com

2 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

3.3.3.3

100

0 4 i

*>i

2.2.2.2

100

0 4 i

r i100.1.1.0/24

3.3.3.3

100

0 4 i

r>i

2.2.2.2

100

0 4 i

32768 i

r1#
R1 44.4.4.0/24 R2

12 cluster list

http://bbs.hh010.com

cluster list BGP Route Reflector (RR)

11 Router-ID
Router-ID

1 R3 Router-ID
r3(config)#router bgp 1
r3(config-router)#bgp router-id 1.1.1.3
R3 Router-ID 1.1.1.3

2 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 10, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

32768 i
100

0 ?

http://bbs.hh010.com

*>i44.4.4.0/24

3.3.3.3

100

0 4 i

* i

2.2.2.2

100

0 4 i

r>i100.1.1.0/24

3.3.3.3

100

0 4 i

r i

2.2.2.2

100

0 4 i

r1#
R2 Router-ID 2.2.2.2 R3 Router-ID 1.1.1.3

Router-ID R3

10 eBGP

eBGP R4

R2 R2 11.1.1.0/24
1 R4 11.1.1.0/24
r4#sh ip bgp
BGP table version is 7, local router ID is 4.4.4.4
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

11.1.1.0/24

3.3.3.3

0 1 i

2.2.2.2

0 1 i

http://bbs.hh010.com

*> 22.2.2.0/24

2.2.2.2

0 1 ?

*> 44.4.4.0/24

0.0.0.0

32768 i

*> 100.1.1.0/24

0.0.0.0

32768 i

r4#
R4 R2 11.1.1.0/24

(2) R2 R3
r4#sh ip bg summary
BGP router identifier 4.4.4.4, local AS number 4
BGP table version is 7, main routing table version 7
4 network entries using 404 bytes of memory
5 path entries using 240 bytes of memory
3 BGP path attribute entries using 180 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 848 total bytes of memory
BGP activity 5/1 prefixes, 8/3 paths, scan interval 60 secs

Neighbor
Up/Down

AS MsgRcvd MsgSent

TblVer

InQ OutQ

State/PfxRcd

http://bbs.hh010.com

2.2.2.2
00:43:27

51

49

27

33

3.3.3.3
00:02:23

r4#
R2 R3 R2

3 R2
r4(config)#router bgp 4
r4(config-router)#neighbor 2.2.2.2 shutdown
r4(config-router)#
*Mar

1 01:16:09.823: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Down Admin.

shutdown
r4(config-router)#no neighbor 2.2.2.2 shutdown
r4(config-router)#
*Mar

1 01:16:37.452: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up

r4(config-router)#
R2

4
r4#sh ip bg summary
BGP router identifier 4.4.4.4, local AS number 4

http://bbs.hh010.com

BGP table version is 10, main routing table version 10


4 network entries using 404 bytes of memory
5 path entries using 240 bytes of memory
3 BGP path attribute entries using 180 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 848 total bytes of memory
BGP activity 5/1 prefixes, 10/5 paths, scan interval 60 secs

Neighbor
Up/Down

AS MsgRcvd MsgSent

TblVer

InQ OutQ

State/PfxRcd

2.2.2.2
00:00:27

57

55

10

28

36

10

3.3.3.3
00:03:45

r4#
R3 R2

5 R4 11.1.1.0/24
r4#sh ip bgp
BGP table version is 10, local router ID is 4.4.4.4

http://bbs.hh010.com

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

11.1.1.0/24

2.2.2.2

0 1 i

*>

3.3.3.3

0 1 i

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

32768 i

*> 100.1.1.0/24

0.0.0.0

32768 i

Metric LocPrf Weight Path

0 1 ?

r4#
R3 R2 R3

9 BGP
8 BGP 8

1 R1 44.4.4.0/24
r1#sh ip route bgp
22.0.0.0/24 is subnetted, 1 subnets
B

22.2.2.0 [200/0] via 2.2.2.2, 00:38:33

http://bbs.hh010.com

44.0.0.0/24 is subnetted, 1 subnets


B

44.4.4.0 [200/0] via 3.3.3.3, 00:05:12

r1#
R1 44.4.0/24 R3

2 BGP
r1(config)#router bgp 1
r1(config-router)#maximum-paths ibgp 2
iBGP iBGP

3 R1 44.4.0/24
r1#sh ip route bgp
22.0.0.0/24 is subnetted, 1 subnets
B

22.2.2.0 [200/0] via 2.2.2.2, 00:39:16


44.0.0.0/24 is subnetted, 1 subnets

44.4.4.0 [200/0] via 2.2.2.2, 00:00:18


[200/0] via 3.3.3.3, 00:00:18

r1#
R1 44.4.4.0/24

4 R4 11.1.1.0/24

http://bbs.hh010.com

r4#sh ip route bgp


22.0.0.0/24 is subnetted, 1 subnets
B

22.2.2.0 [20/0] via 2.2.2.2, 00:03:03


11.0.0.0/24 is subnetted, 1 subnets

11.1.1.0 [20/0] via 3.3.3.3, 00:03:31

r4#
R4 11.1.1.0/24

5 R4 11.1.1.0/24
r4(config)#router bgp 4
r4(config-router)#maximum-paths 2
eBGP eBGP

6 R4 11.1.1.0/24
r4#sh ip route bgp
22.0.0.0/24 is subnetted, 1 subnets
B

22.2.2.0 [20/0] via 2.2.2.2, 00:03:33


11.0.0.0/24 is subnetted, 1 subnets

11.1.1.0 [20/0] via 2.2.2.2, 00:00:15


[20/0] via 3.3.3.3, 00:00:15

r4#

http://bbs.hh010.com

R4 11.1.1.0/24

8 IGP metric
IGP metric

1 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 14, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

2.2.2.2

100

0 4 i

*>i

3.3.3.3

100

0 4 i

r i100.1.1.0/24

2.2.2.2

100

0 4 i

r>i

3.3.3.3

100

0 4 i

32768 i

r1#
R1 R3 44.4.0/24 IGP metric

http://bbs.hh010.com

2 R2 R3 IGP metric
r1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter
area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

34.0.0.0/24 is subnetted, 1 subnets


O

34.1.1.0 [110/2] via 13.1.1.3, 00:28:17, FastEthernet0/1


1.0.0.0/32 is subnetted, 1 subnets

1.1.1.1 is directly connected, Loopback0


2.0.0.0/32 is subnetted, 1 subnets

2.2.2.2 [110/2] via 12.1.1.2, 00:28:17, FastEthernet0/0


100.0.0.0/24 is subnetted, 1 subnets

100.1.1.0 [110/3] via 12.1.1.2, 00:28:17, FastEthernet0/0

http://bbs.hh010.com

[110/3] via 13.1.1.3, 00:28:17, FastEthernet0/1


3.0.0.0/32 is subnetted, 1 subnets
O

3.3.3.3 [110/2] via 13.1.1.3, 00:28:18, FastEthernet0/1


4.0.0.0/32 is subnetted, 1 subnets

4.4.4.4 [110/3] via 12.1.1.2, 00:28:18, FastEthernet0/0


[110/3] via 13.1.1.3, 00:28:18, FastEthernet0/1
22.0.0.0/24 is subnetted, 1 subnets

22.2.2.0 [200/0] via 2.2.2.2, 00:41:12


24.0.0.0/24 is subnetted, 1 subnets

24.1.1.0 [110/2] via 12.1.1.2, 00:28:21, FastEthernet0/0


11.0.0.0/24 is subnetted, 1 subnets

11.1.1.0 is directly connected, Loopback11


12.0.0.0/24 is subnetted, 1 subnets

12.1.1.0 is directly connected, FastEthernet0/0


13.0.0.0/24 is subnetted, 1 subnets

13.1.1.0 is directly connected, FastEthernet0/1


44.0.0.0/24 is subnetted, 1 subnets

44.4.4.0 [200/0] via 2.2.2.2, 00:02:14


[200/0] via 3.3.3.3, 00:02:14

r1#
R2 R3 IGP metric

http://bbs.hh010.com

3 R3 IGP metric R2
r1(config)#int f0/1
r1(config-if)#ip ospf cost 2

4 R2 R3 IGP metric
r1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter
area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

34.0.0.0/24 is subnetted, 1 subnets


O

34.1.1.0 [110/3] via 13.1.1.3, 00:01:10, FastEthernet0/1


[110/3] via 12.1.1.2, 00:01:10, FastEthernet0/0
1.0.0.0/32 is subnetted, 1 subnets

http://bbs.hh010.com

1.1.1.1 is directly connected, Loopback0


2.0.0.0/32 is subnetted, 1 subnets

2.2.2.2 [110/2] via 12.1.1.2, 00:01:10, FastEthernet0/0


100.0.0.0/24 is subnetted, 1 subnets

100.1.1.0 [110/3] via 12.1.1.2, 00:01:10, FastEthernet0/0


3.0.0.0/32 is subnetted, 1 subnets

3.3.3.3 [110/3] via 13.1.1.3, 00:01:11, FastEthernet0/1


4.0.0.0/32 is subnetted, 1 subnets

4.4.4.4 [110/3] via 12.1.1.2, 00:01:11, FastEthernet0/0


22.0.0.0/24 is subnetted, 1 subnets

22.2.2.0 [200/0] via 2.2.2.2, 00:43:18


24.0.0.0/24 is subnetted, 1 subnets

24.1.1.0 [110/2] via 12.1.1.2, 00:01:11, FastEthernet0/0


11.0.0.0/24 is subnetted, 1 subnets

11.1.1.0 is directly connected, Loopback11


12.0.0.0/24 is subnetted, 1 subnets

12.1.1.0 is directly connected, FastEthernet0/0


13.0.0.0/24 is subnetted, 1 subnets

13.1.1.0 is directly connected, FastEthernet0/1


44.0.0.0/24 is subnetted, 1 subnets

44.4.4.0 [200/0] via 2.2.2.2, 00:00:14

http://bbs.hh010.com

r1#
R2 metric 2, R3 metric 3 R2

5 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 16, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

*>i44.4.4.0/24

2.2.2.2

100

0 4 i

* i

3.3.3.3

100

0 4 i

r>i100.1.1.0/24

2.2.2.2

100

0 4 i

r i

3.3.3.3

100

0 4 i

32768 i

r1#
R2 IGP

metric R3 R2

http://bbs.hh010.com

eBGP iBGP

eBGP iBGP

MED

MED MED 0

MED eBGP AS
MED MED R1
44.4.4.0/24

1 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 16, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

*>i44.4.4.0/24

2.2.2.2

100

0 4 i

32768 i

http://bbs.hh010.com

* i

3.3.3.3

100

0 4 i

r>i100.1.1.0/24

2.2.2.2

100

0 4 i

r i

3.3.3.3

100

0 4 i

r1#

R2 R3 MED 0

2 R2 MED R3
r1(config)#access-list 44 permit 44.4.4.0

r1(config)#route-map med permit 10


r1(config-route-map)#match ip address 44
r1(config-route-map)#set metric 44
r1(config-route-map)#exit
r1(config)#route-map med permit 20

r1(config)#router bgp 1
r1(config-router)#neighbor 2.2.2.2 route-map med in

r1(config)#router bgp 1

http://bbs.hh010.com

r1(config-router)#neighbor 2.2.2.2 soft-reconfiguration inbound

BGP in

3 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 17, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

2.2.2.2

44

100

0 4 i

*>i

3.3.3.3

100

0 4 i

r>i100.1.1.0/24

2.2.2.2

100

0 4 i

r i

3.3.3.3

100

0 4 i

32768 i

r1#
R3 MED R2 R3

R4 MED

http://bbs.hh010.com

5 Origin
IGP EGPEGP Incomplete IGP>EGP>Incomplete

1 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 17, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

2.2.2.2

44

100

0 4 i

*>i

3.3.3.3

100

0 4 i

r>i100.1.1.0/24

2.2.2.2

100

0 4 i

r i

3.3.3.3

100

0 4 i

32768 i

r1#
origin IGP

http://bbs.hh010.com

2 R3 origin incomplete R2

r1(config)#route-map ori permit 10


r1(config-route-map)#match ip address 44
r1(config-route-map)#set origin incomplete
r1(config)#route-map ori permit 20

r1(config)#router bgp 1
r1(config-router)#neighbor 3.3.3.3 route-map ori in
r1(config-router)#neighbor 3.3.3.3 soft-reconfiguration inbound

3 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 18, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

Metric LocPrf Weight Path


0

32768 i

http://bbs.hh010.com

*>i22.2.2.0/24

2.2.2.2

100

0 ?

*>i44.4.4.0/24

2.2.2.2

44

100

0 4 i

* i

3.3.3.3

100

0 4 ?

r>i100.1.1.0/24

2.2.2.2

100

0 4 i

r i

3.3.3.3

100

0 4 i

r1#
R3 origin incompleteR2 origin IGP

R2

4 AS_PATH
AS_Path eBGP iBGP AS_Path

R4 eBGP R2 R3 11.1.1.0

1 R4 11.1.1.0/24
r4#sh ip bgp
BGP table version is 14, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

http://bbs.hh010.com

Network

Next Hop

11.1.1.0/24

2.2.2.2

0 1 i

*>

3.3.3.3

0 1 i

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

32768 i

*> 100.1.1.0/24

0.0.0.0

32768 i

Metric LocPrf Weight Path

0 1 ?

r4#
R2 R3 AS_Path

2 R3 AS_Path R2
r4(config)#access-list 3 permit 11.1.1.0

r4(config)#route-map as permit 10
r4(config-route-map)#match ip address 3
r4(config-route-map)#set as-path prepend 3
r4(config-route-map)#exit
r4(config)#route-map as permit 20

r4(config)#router bgp 4
r4(config-router)#neighbor 3.3.3.3 route-map as in

http://bbs.hh010.com

r4(config-router)#neighbor 3.3.3.3 soft-reconfiguration inbound

3 R4 11.1.1.0/24
r4#sh ip bgp
BGP table version is 15, local router ID is 4.4.4.4
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

*> 11.1.1.0/24

2.2.2.2

0 1 i

3.3.3.3

0 3 1 i

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

32768 i

*> 100.1.1.0/24

0.0.0.0

32768 i

0 1 ?

r4#
R3 AS_Path R2 R2

http://bbs.hh010.com

BGP

2 LOCAL_PREF
LOCAL_PREF iBGP AS
LOCAL_PREF LOCAL_PREF
R4 11.1.1.0/24

(1) R4 11.1.1.0/24
r4#sh ip bgp
BGP table version is 15, local router ID is 4.4.4.4
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

*> 11.1.1.0/24

2.2.2.2

0 1 i

3.3.3.3

0 3 1 i

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

32768 i

*> 100.1.1.0/24

0.0.0.0

32768 i

0 1 ?

http://bbs.hh010.com

r4#
R2

2 R3 LOCAL_PREF R2 R3
r4(config)#access-list 11 permit 11.1.1.0

r4(config)#route-map r3 permit 10
r4(config-route-map)#match ip address 11
r4(config-route-map)#set local-preference 3
r4(config-route-map)#exit
r4(config)#route-map r3 permit 20

r4(config)#route-map r2 permit 10
r4(config-route-map)#match ip address 11
r4(config-route-map)#set local-preference 2
r4(config-route-map)#exit
r4(config)#route-map r2 permit 20

r4(config)#router bgp 4
r4(config-router)#neighbor 3.3.3.3 route-map r3 in
r4(config-router)#neighbor 2.2.2.2 route-map r2 in

http://bbs.hh010.com

r4(config-router)#neighbor 2.2.2.2 soft-reconfiguration inbound

3 R4 11.1.1.0/24
r4#sh ip bgp
BGP table version is 5, local router ID is 4.4.4.4
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

11.1.1.0/24

2.2.2.2

0 1 i

*>

3.3.3.3

0 1 i

*> 22.2.2.0/24

2.2.2.2

*> 44.4.4.0/24

0.0.0.0

32768 i

*> 100.1.1.0/24

0.0.0.0

32768 i

0 1 ?

r4#
R3 LOCAL_PREF R2 R3

R1 LOCAL_PREF

http://bbs.hh010.com

Weight

Weight Weight

1 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 23, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

3.3.3.3

100

0 4 ?

*>i

2.2.2.2

44

100

0 4 i

r i100.1.1.0/24

3.3.3.3

100

0 4 i

r>i

2.2.2.2

100

0 4 i

32768 i

r1#
R2

http://bbs.hh010.com

2 R3 weight R3
r1(config)#router bgp 1
r1(config-router)#neighbor 3.3.3.3 weight 3

3 R1 44.4.4.0/24
r1#sh ip bgp
BGP table version is 6, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 ?

* i44.4.4.0/24

2.2.2.2

44

100

0 4 i

*>i

3.3.3.3

100

3 4 ?

r i100.1.1.0/24

2.2.2.2

100

0 4 i

r>i

3.3.3.3

100

3 4 i

32768 i

r1#
R3 weight R2 R3

http://bbs.hh010.com

BGP

BGP
BGP
BGP

BGP

AS_Path AS_Path
AS_Path
BGP BGP
atomic-aggregate
BGP AS_Path
AS_Path AS_Path
AS-SETAS-SET AS_Path AS_Path
AS 15AS 25AS 35AS 45 AS-SET
{35154525} AS-SET
atomic-aggregate

http://bbs.hh010.com

atomic-aggregate AS-SET AS-SET


AS AS-SET AS AS_Path
1 AS
BGP
AD 200 0.0.0.0

BGP
1

2 BGP

BGP

http://bbs.hh010.com

Loopback
R1

Loopback 0

1.1.1.1/32

Loopback 11

11.1.1.1/24

R2

Loopback 0

2.2.2.2/32

Loopback 22

22.2.2.2/24

R3

Loopback 0

3.3.3.3/32

Loopback 33

33.3.3.3/24

R4

Loopback 0

4.4.4.4/32

Loopback 44

44.4.4.4/24

R5

Loopback 0

5.5.5.5/32

Loopback 55

55.5.5.5/24

R6

Loopback 0

6.6.6.6/32

Loopback 66

66.6.6.6/24

http://bbs.hh010.com

OSPF Loopback 0 OSPF


Loopback 0

1.IGP Loopback 0

1 OSPF

2 Loopback 0
r1#ping 2.2.2.2 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/50/88 ms
r1#ping 3.3.3.3 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/43/76 ms
r1#ping 4.4.4.4 source loopback 0

http://bbs.hh010.com

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/74/116
ms
r1#ping 5.5.5.5 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 132/172/228
ms
r1#ping 6.6.6.6 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!

http://bbs.hh010.com

Success rate is 100 percent (5/5), round-trip min/avg/max = 96/169/248


ms
r1#
Loopback 0

2. BGP

1 R1 BGP
r1(config)#router bgp 1
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#neighbor 2.2.2.2 remote-as 1
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
r1(config-router)#neighbor 3.3.3.3 remote-as 1
r1(config-router)#neighbor 3.3.3.3 update-source loopback 0
r1(config-router)#network 11.1.1.0 mask 255.255.255.0
2 R2 BGP
r2(config)#router bgp 1
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 1.1.1.1 remote-as 1
r2(config-router)#neighbor 1.1.1.1 update-source loopback 0
r2(config-router)#neighbor 4.4.4.4 remote-as 4
r2(config-router)#neighbor 4.4.4.4 update-source loopback 0

http://bbs.hh010.com

r2(config-router)#neighbor 4.4.4.4 ebgp-multihop


r2(config-router)#network 22.2.2.0 mask 255.255.255.0
3 R3 BGP
r3(config)#router bgp 1
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#neighbor 1.1.1.1 remote-as 1
r3(config-router)#neighbor 1.1.1.1 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 remote-as 4
r3(config-router)#neighbor 4.4.4.4 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 ebgp-multihop
r3(config-router)#network 33.3.3.0 mask 255.255.255.0
4 R4 BGP
r4(config)#router bgp 4
r4(config-router)#bgp router-id 4.4.4.4
r4(config-router)#neighbor 2.2.2.2 remote-as 1
r4(config-router)#neighbor 2.2.2.2 update-source loopback 0
r4(config-router)#neighbor 2.2.2.2 ebgp-multihop
r4(config-router)#neighbor 3.3.3.3 remote-as 1
r4(config-router)#neighbor 3.3.3.3 update-source loopback 0
r4(config-router)#neighbor 3.3.3.3 ebgp-multihop
r4(config-router)#neighbor 5.5.5.5 remote-as 5

http://bbs.hh010.com

r4(config-router)#neighbor 5.5.5.5 update-source loopback 0


r4(config-router)#neighbor 5.5.5.5 ebgp-multihop
r4(config-router)#neighbor 6.6.6.6 remote-as 6
r4(config-router)#neighbor 6.6.6.6 update-source loopback 0
r4(config-router)#neighbor 6.6.6.6 ebgp-multihop
r4(config-router)#network 44.4.4.0 mask 255.255.255.0
5 R5 BGP
r5(config)#router bgp 5
r5(config-router)#bgp router-id 5.5.5.5
r5(config-router)#neighbor 4.4.4.4 remote-as 4
r5(config-router)#neighbor 4.4.4.4 update-source loopback 0
r5(config-router)#neighbor 4.4.4.4 ebgp-multihop
r5(config-router)#network 55.5.5.0 mask 255.255.255.0
6 R6 BGP
r6(config)#router bgp 6
r6(config-router)#bgp router-id 6.6.6.6
r6(config-router)#neighbor 4.4.4.4 remote-as 4
r6(config-router)#neighbor 4.4.4.4 update-source loopback 0
r6(config-router)#neighbor 4.4.4.4 ebgp-multihop
r6(config-router)#network 66.6.6.0 mask 255.255.255.0

http://bbs.hh010.com

3. BGP

1 R1 R6 BGP
r1(config)#int loopback 100
r1(config-if)#ip address 100.1.1.1 255.255.255.0

r1(config)#router bgp 1
r1(config-router)#network 100.1.1.0 mask 255.255.255.0

r6(config)#int loopback 100


r6(config-if)#ip address 100.1.2.1 255.255.255.0
r6(config-if)#ip address 100.1.3.1 255.255.255.0 secondary

r6(config)#router bgp 6
r6(config-router)#network 100.1.2.0 mask 255.255.255.0
r6(config-router)#network 100.1.3.0 mask 255.255.255.0
R1 R6 BGP

2 R5 BGP
r5#sh ip bgp
BGP table version is 10, local router ID is 5.5.5.5

http://bbs.hh010.com

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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

0 4 6 i

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

0 4 i
32768 i

r5#
R5 R1 R6 100.1.1.0/24, 100.1.2.0/24,

100.1.3.0/24 AS_Path 4,6 4,1 AS 1


AS4 AS 4

3 R4 BGP
r4(config)#router bgp 4

http://bbs.hh010.com

r4(config-router)#aggregate-address 100.1.0.0 255.255.252.0


100.1.0.0/22

4. BGP

(1) R5 BGP
r5#sh ip bgp
BGP table version is 11, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

0 4 i
32768 i
0 4 6 i

0 4 i

http://bbs.hh010.com

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

r5#
R5 BGP 100.1.0.0/22

100.1.0.0/22 AS_Path 4 AS_Path

2 atomic-aggregate
r5#sh ip bgp 100.1.0.0
BGP routing table entry for 100.1.0.0/22, version 32
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
4, (aggregated by 4 4.4.4.4)
4.4.4.4 (metric 65) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external,
atomic-aggregate, best
r5#
100.1.0.0/22
atomic-aggregate

5. BGP

1 AS-SET
r4(config)#router bgp 4
r4(config-router)#aggregate-address 100.1.0.0 255.255.252.0 as-set
R4 AS-SET AS_Path

http://bbs.hh010.com

2 R5 BGP
r5#sh ip bgp
BGP table version is 12, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

0 4 i
32768 i
0 4 6 i

0 4 {1,6} i

r5#

http://bbs.hh010.com

100.1.0.0/22 AS_Path

3 atomic-aggregate
r5#sh ip bgp 100.1.0.0
BGP routing table entry for 100.1.0.0/22, version 33
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
4 {1,6}, (aggregated by 4 4.4.4.4)
4.4.4.4 (metric 65) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external, best
r5#
100.1.0.0/22

atomic-aggregate

6. BGP

1 R4
r4(config)#access-list 1 permit 100.1.1.0
r4(config)#route-map sup permit 10
r4(config-route-map)#match ip address 1

http://bbs.hh010.com

r4(config)#router bgp 4
r4(config-router)#aggregate-address 100.1.0.0 255.255.252.0 as-set
suppress-map sup
100.1.1.0/24 route-map suppress-map route-map

2 R5 BGP
r5#sh ip bgp
BGP table version is 12, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

0 4 i
32768 i
0 4 6 i

0 4 {1,6} i

http://bbs.hh010.com

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

r5#
R5 100.1.1.0/24

3 R4
r4(config)#router bgp 4
r4(config-router)#aggregate-address 100.1.0.0 255.255.252.0 as-set
summary-only
R4

4 R5 BGP
r5#sh ip bgp
BGP table version is 15, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

0 4 i

http://bbs.hh010.com

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

32768 i
0 4 6 i

0 4 {1,6} i

r5#
R5

5 R4
r4#sh ip bgp
BGP table version is 15, local router ID is 4.4.4.4
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

*> 11.1.1.0/24

2.2.2.2

0 1 i

3.3.3.3

0 1 i

*> 22.2.2.0/24

2.2.2.2

0 1 i

*> 33.3.3.0/24

3.3.3.3

0 1 i

*> 44.4.4.0/24

0.0.0.0

*> 55.5.5.0/24

5.5.5.5

0 5 i

*> 66.6.6.0/24

6.6.6.6

0 6 i

32768 i

http://bbs.hh010.com

*> 100.1.0.0/22

0.0.0.0

3.3.3.3

0 1 i

s>

2.2.2.2

0 1 i

s> 100.1.2.0/24

6.6.6.6

0 6 i

s> 100.1.3.0/24

6.6.6.6

0 6 i

100.1.1.0/24

100

32768 {1,6} i

r4#
s

6
r4(config)#access-list 3 permit 100.1.3.0

r4(config)#route-map unsup permit 10


r4(config-route-map)#match ip address 3

r4(config)#router bgp 4
r4(config-router)#neighbor 5.5.5.5 unsuppress-map unsup

unsuppress-map

7 R5 BGP
r5#sh ip bgp

http://bbs.hh010.com

BGP table version is 16, local router ID is 5.5.5.5


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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

*> 100.1.3.0/24

4.4.4.4

0 4 i
32768 i
0 4 6 i

0 4 {1,6} i
0 4 6 i

r5#
R4 100.1.3.0/24 R5

7.

1 R4 BGP
r4(config)#ip route 100.1.0.0 255.255.252.0 null 0

http://bbs.hh010.com

r4(config)#router bgp 4
r4(config-router)#redistribute static
null 0

BGP

2 R5
r5#sh ip bgp
BGP table version is 35, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

*> 100.1.1.0/24

4.4.4.4

0 4 i
32768 i
0 4 6 i

0 4 ?
0 4 1 i

http://bbs.hh010.com

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

R5
R5

BGP
BGP

BGP
BGP

1. BGP

(1) R4 BGP
r4(config)#router bgp 4
r4(config-router)#default-information originate

2 R5
r5#sh ip bgp
BGP table version is 37, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,

http://bbs.hh010.com

r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*> 0.0.0.0

4.4.4.4

0 4 ?

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

*> 200.0.0.0/8

4.4.4.4

0 4 i
32768 i
0 4 6 i

0 4 ?

0 4 ?

r5#
R5 R4

3
r4(config-router)#neighbor 5.5.5.5 default-originate

http://bbs.hh010.com

BGP
BGP access-list
prefix-list BGP

BGP AS_Path IP
AS_Path AS_Path Regular
Expressions () AS Regular Expressions (
)

^
_

.*

http://bbs.hh010.com

^123$
AS 123

^$
AS AS

^12[0-3]$
120

121

122

123

^12.
12 120 129 AS

_12_
AS 12

BGP

http://bbs.hh010.com

BGP
1. R5 As-path filter

1 R5
r5#sh ip bgp
BGP table version is 13, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

*> 100.1.0.0/22

4.4.4.4

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

0 4 i
32768 i
0 4 6 i

0 4 {1,6} i

r5#

http://bbs.hh010.com

R5

2 AS 6
r5(config)#ip as-path access-list 5 permit ^6$

r5(config)#router bgp 5
r5(config-router)#neighbor 4.4.4.4 filter-list 5 in
R5 As-path filter

(3)
r5#sh ip bgp
BGP table version is 22, local router ID is 5.5.5.5
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

*> 55.5.5.0/24

0.0.0.0

Metric LocPrf Weight Path


0

32768 i

r5#
^6$

AS 6

http://bbs.hh010.com

3 AS 6
r5(config)#ip as-path access-list 55 permit _6$
r5(config)#router bgp 5
r5(config-router)#neighbor 4.4.4.4 filter-list 55 in
AS 6 _6$ AS _

4
r5#sh ip bgp
BGP table version is 19, local router ID is 5.5.5.5
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

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

0 4 6 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

32768 i

r5#

http://bbs.hh010.com

As-path filter AS 6

2. R4 distribute-list

1
r4(config)#access-list 2 permit 100.1.2.0

r4(config)#router bgp 4
r4(config-router)#distribute-list 2 in
100.1.2.0

r4#sh ip bgp
BGP table version is 9, local router ID is 4.4.4.4
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

*> 44.4.4.0/24

0.0.0.0

*> 100.1.0.0/22

0.0.0.0

Metric LocPrf Weight Path


0

32768 i
100

32768 {1,6} i

http://bbs.hh010.com

*> 100.1.2.0/24

6.6.6.6

0 6 i

r4#
100.1.2.0

3
r4(config)#router bgp 4
r4(config-router)#no distribute-list 2 in
r4(config-router)#neighbor 6.6.6.6 distribute-list 2 in
R6

4
r4#sh ip bgp
BGP table version is 9, local router ID is 4.4.4.4
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

11.1.1.0/24

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 22.2.2.0/24

2.2.2.2

Metric LocPrf Weight Path

0 1 i

http://bbs.hh010.com

*> 33.3.3.0/24

3.3.3.3

*> 44.4.4.0/24

0.0.0.0

*> 55.5.5.0/24

5.5.5.5

*> 100.1.0.0/22

0.0.0.0

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 100.1.2.0/24

6.6.6.6

100.1.1.0/24

0 1 i
32768 i
0 5 i
100

32768 {1,6} i

0 6 i

r4#
R6 100.1.2.0

BGP
BGP
BGP

BGP route-map advertise map exist map


route-map access list IP prefix listBGP
exist map BGP advertise map

nonexist map
advertise map
BGP IOS

http://bbs.hh010.com

BGP
BGP

R4 100.1.2.0 BGP 5.5.5.5


11.1.1.0

1. BGP

1 R5
r5#sh ip bgp
BGP table version is 9, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 66.6.6.0/24

4.4.4.4

0 4 i
0 4 6 i

http://bbs.hh010.com

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

r5#
R5 11.1.1.0

2 R4
r4#sh ip bgp
BGP table version is 20, local router ID is 4.4.4.4
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

11.1.1.0/24

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 22.2.2.0/24

2.2.2.2

0 1 i

*> 33.3.3.0/24

3.3.3.3

0 1 i

*> 44.4.4.0/24

0.0.0.0

*> 55.5.5.0/24

5.5.5.5

0 5 i

*> 66.6.6.0/24

6.6.6.6

0 6 i

Metric LocPrf Weight Path

32768 i

http://bbs.hh010.com

100.1.1.0/24

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 100.1.2.0/24

6.6.6.6

0 6 i

*> 100.1.3.0/24

6.6.6.6

0 6 i

r4#
R4 11.1.1.0 100.1.2.0

3 R4 BGP
r4(config)#access-list 11 permit 11.1.1.0
r4(config)#access-list 2 permit 100.1.2.0

r4(config)#route-map adv permit 10


r4(config-route-map)#match ip address 11
r4(config-route-map)#exit

r4(config)#route-map exi permit 10


r4(config-route-map)#match ip address 2

r4(config)#router bgp 4
r4(config-router)#neighbor 5.5.5.5 advertise-map adv exist-map exi
100.1.2.0 BGP 5.5.5.5

11.1.1.0

http://bbs.hh010.com

4 100.1.2.0
r6(config)#router bgp 6
r6(config-router)#no network 100.1.2.0 mask 255.255.255.0
100.1.2.0

5 R4 BGP
r4#sh ip bgp
BGP table version is 21, local router ID is 4.4.4.4
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

11.1.1.0/24

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 22.2.2.0/24

2.2.2.2

0 1 i

*> 33.3.3.0/24

3.3.3.3

0 1 i

*> 44.4.4.0/24

0.0.0.0

*> 55.5.5.0/24

5.5.5.5

0 5 i

*> 66.6.6.0/24

6.6.6.6

0 6 i

Metric LocPrf Weight Path

32768 i

http://bbs.hh010.com

100.1.1.0/24

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 100.1.3.0/24

6.6.6.6

0 6 i

r4#
100.1.2.0 BGP

6 R5 BGP
r5#sh ip bgp
BGP table version is 23, local router ID is 5.5.5.5
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

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

0 4 6 i

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

32768 i

r5#

http://bbs.hh010.com

100.1.2.0 11.1.1.0 R5

11.1.1.0

BGP Peer Group


BGP
AS BGP TTL BGP
BGP

BGP BGP Peer Group BGP


Peer Group BGP BGP

BGP Peer Group


Peer Group Peer Group
Peer Group Peer Group
Peer Group
BGP 4
10 40 Peer Group Peer Group
1 4 Peer Group 10 10
Peer Group Peer Group 10
15 40 Peer Group
BGP
Peer Group
Peer Group

Peer Group Peer Group


iBGP eBGP iBGP eBGP
Peer Group eBGP AS
AS

http://bbs.hh010.com

Peer Group Peer Group


Peer Group
Peer Group Peer Group

BGP Peer Group

Loopback
R1

Loopback 0

1.1.1.1/32

Loopback 11

11.1.1.1/24

R2

Loopback 0

2.2.2.2/32

Loopback 22

22.2.2.2/24

R3

Loopback 0

3.3.3.3/32

Loopback 33

33.3.3.3/24

http://bbs.hh010.com

R4

Loopback 0

4.4.4.4/32

Loopback 44

44.4.4.4/24

R5

Loopback 0

5.5.5.5/32

Loopback 55

55.5.5.5/24

OSPF Loopback 0 OSPF


Loopback 0

R1 BGP BGP Peer Group R1

1.IGP Loopback 0
IGP OSPF Loopback 0 Loopback 0

BGP
1 Loopback 0
r1#ping 2.2.2.2 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 72/126/192
ms
r1#ping 3.3.3.3 source loopback 0

Type escape sequence to abort.

http://bbs.hh010.com

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:


Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/99/192 ms
r1#
r1#ping 4.4.4.4 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/70/152 ms
r1#
r1#ping 5.5.5.5 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/129/196
ms
r1#

http://bbs.hh010.com

Loopback 0

2. Peer Group R1

1 Peer Group AS iBGP


r1(config)#router bgp 1
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#neighbor as1 peer-group
r1(config-router)#neighbor as1 remote-as 1
r1(config-router)#neighbor as1 update-source loopback 0
r1(config-router)#neighbor 2.2.2.2 peer-group as1
r1(config-router)#neighbor 3.3.3.3 peer-group as1
Peer Group as1 as1 as 1

Loopback0 2.2.2.2 3.3.3.3 Peer Group(as1)

2 Peer Group AS eBGP


r1(config)#router bgp 1
r1(config-router)#neighbor as45 peer-group
r1(config-router)#neighbor as45 update-source loopback 0
r1(config-router)#neighbor as45 ebgp-multihop

r1(config-router)#neighbor 4.4.4.4 remote-as 4

http://bbs.hh010.com

r1(config-router)#neighbor 4.4.4.4 peer-group as1


% Peer with AS 4 cannot be in this peer-group, members must be all internal
or all external

r1(config-router)#neighbor 4.4.4.4 peer-group as45

r1(config-router)#neighbor 5.5.5.5 remote-as 5


r1(config-router)#neighbor 5.5.5.5 peer-group as1
% Peer with AS 5 cannot be in this peer-group, members must be all internal
or all external

r1(config-router)#neighbor 5.5.5.5 peer-group as45


r1(config-router)#

Peer Group as45 as45 Loopback0

TTL 255 as45 AS eBGP


AS AS Peer Group(as1)
AS AS Peer Group

3. BGP

1 R2
r2(config)#router bgp 1
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 1.1.1.1 remote-as 1
r2(config-router)#neighbor 1.1.1.1 up loopback 0

http://bbs.hh010.com

r2(config-router)#network 22.2.2.0 mask 255.255.255.0


R2

2 R3
r3(config)#router bgp 1
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#neighbor 1.1.1.1 remote-as 1
r3(config-router)#neighbor 1.1.1.1 up loopback 0
r3(config-router)#network 33.3.3.0 mask 255.255.255.0
R3

3 R4
r4(config)#router bgp 4
r4(config-router)#bgp router-id 4.4.4.4
r4(config-router)#neighbor 1.1.1.1 remote-as 1
r4(config-router)#neighbor 1.1.1.1 up loopback 0
r4(config-router)#neighbor 1.1.1.1 ebgp-multihop
r4(config-router)#network 44.4.4.0 mask 255.255.255.0
R4

http://bbs.hh010.com

4 R5
r5(config)#router bgp 5
r5(config-router)#bgp router-id 5.5.5.5
r5(config-router)#neighbor 1.1.1.1 remote-as 1
r5(config-router)#neighbor 1.1.1.1 update-source loopback 0
r5(config-router)#neighbor 1.1.1.1 ebgp-multihop
r5(config-router)#network 55.5.5.0 mask 255.255.255.0
R5

4.

1 BGP
r1#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 5, main routing table version 5
4 network entries using 516 bytes of memory
4 path entries using 208 bytes of memory
4/3 BGP path/bestpath attribute entries using 496 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1268 total bytes of memory

http://bbs.hh010.com

BGP activity 4/0 prefixes, 4/0 paths, scan interval 60 secs

Neighbor
Up/Down

AS MsgRcvd MsgSent

TblVer

InQ OutQ

State/PfxRcd

2.2.2.2
00:03:01

5.5.5.5
00:00:28

4.4.4.4
00:01:15

3.3.3.3
00:02:18

r1#
R1 BGP

2 BGP
r1#sh ip bgp
BGP table version is 5, local router ID is 1.1.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

http://bbs.hh010.com

*>i22.2.2.0/24

2.2.2.2

100

0 i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*> 44.4.4.0/24

4.4.4.4

0 4 i

*> 55.5.5.0/24

5.5.5.5

0 5 i

r1#
BGP

5.

1 Peer Group
r1(config)#router bgp 1
r1(config-router)#neighbor as1 weight 111
Peer Group as1 weight 111 Peer Group

2
r1#sh ip bgp
BGP table version is 7, local router ID is 1.1.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

http://bbs.hh010.com

*>i22.2.2.0/24

2.2.2.2

100

111 i

*>i33.3.3.0/24

3.3.3.3

100

111 i

*> 44.4.4.0/24

4.4.4.4

0 4 i

*> 55.5.5.0/24

5.5.5.5

0 5 i

r1#
Peer Group Peer Group

3
r1(config)#router bgp 1
r1(config-router)#neighbor 5.5.5.5 weight 5
Peer Group as45 5.5.5.5 weight 5

Peer Group

4
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.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

*>i22.2.2.0/24

2.2.2.2

Metric LocPrf Weight Path


0

100

111 i

http://bbs.hh010.com

*>i33.3.3.0/24

3.3.3.3

100

111 i

*> 44.4.4.0/24

4.4.4.4

0 4 i

*> 55.5.5.0/24

5.5.5.5

5 5 i

r1#
Peer Group Peer Group

BGP Community
BGP Community BGP BGP
Optional Transitive Community
Community BGP
Community
Peer Group BGP BGP Community
BGP Community BGP
Community Community
Community CommunityExtended

Community

Community
Community BGP
Community BGP 4
Community

no-export eBGP AS

no-advertise BGP
internet BGP

http://bbs.hh010.com

local-as no-export AS

Community

Community
Community BGP BGP
Community
BGP Community Community

BGP
prefix list access list

Community
Community Community
Community
Community

Community 32bit
32bit 123666
2 AS AS:NN 1:0
65534:65535
32bit AS:NN BGP-Community
New-Format

http://bbs.hh010.com

Community
Community Community
Community Community

CommunityExtended

Community

Community MPLS VRF MPLS


BGP Community Community

Community Community List list


list 10 10 list
100 list IOS list
Community List route-map Community
List route-map

Community Community

BGP Community

http://bbs.hh010.com

Loopback
R1

Loopback 0

1.1.1.1/32

Loopback 11

11.1.1.1/24

R2

Loopback 0

2.2.2.2/32

Loopback 22

22.2.2.2/24

R3

Loopback 0

3.3.3.3/32

Loopback 33

33.3.3.3/24

R4

Loopback 0

4.4.4.4/32

Loopback 44

44.4.4.4/24

R5

Loopback 0

5.5.5.5/32

Loopback 55

55.5.5.5/24

R6

Loopback 0

6.6.6.6/32

Loopback 66

66.6.6.6/24

http://bbs.hh010.com

OSPF Loopback 0 OSPF


Loopback 0

1.IGP Loopback 0

2. BGP

3. no-export
R5 55.5.5.0/24 no-export R4
no-export

eBGP R6 R4 55.5.5.0/24
1 R4 BGP
r4#sh ip bgp
BGP table version is 11, local router ID is 4.4.4.4
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

http://bbs.hh010.com

11.1.1.0/24

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 22.2.2.0/24

2.2.2.2

0 1 i

*> 33.3.3.0/24

3.3.3.3

0 1 i

*> 44.4.4.0/24

0.0.0.0

*> 55.5.5.0/24

5.5.5.5

0 5 i

*> 66.6.6.0/24

6.6.6.6

0 6 i

3.3.3.3

0 1 i

*>

2.2.2.2

0 1 i

*> 100.1.2.0/24

6.6.6.6

0 6 i

*> 100.1.3.0/24

6.6.6.6

0 6 i

100.1.1.0/24

32768 i

r4#
R4 R5

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

http://bbs.hh010.com

Network

Next Hop

Metric LocPrf Weight Path

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

4.4.4.4

*> 66.6.6.0/24

0.0.0.0

*> 100.1.1.0/24

4.4.4.4

*> 100.1.2.0/24

0.0.0.0

32768 i

*> 100.1.3.0/24

0.0.0.0

32768 i

0 4 i
0 4 5 i

32768 i
0 4 1 i

r6#
R4 R6

3R5 55.5.5.0/24 no-export R4


r5(config)#access-list 55 permit 55.5.5.0

r5(config)#route-map noe permit 10


r5(config-route-map)#mat ip address 55
r5(config-route-map)#set community no-export
r5(config-route-map)#exit
r5(config)#route-map noe permit 20

http://bbs.hh010.com

r5(config-route-map)#exit

r5(config)#router bgp 5
r5(config-router)#neighbor 4.4.4.4 route-map noe out
r5(config-router)#neighbor 4.4.4.4 send-community
R5 55.5.5.0/24 no-export community

R4

4 R4 community
r4#sh ip bgp community
BGP table version is 12, local router ID is 4.4.4.4
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

*> 55.5.5.0/24

5.5.5.5

Metric LocPrf Weight Path


0

0 5 i

r4#
R4 R5 community

5 R4 community

http://bbs.hh010.com

r4#sh ip bgp 55.5.5.0


BGP routing table entry for 55.5.5.0/24, version 12
Paths: (1 available, best #1, table Default-IP-Routing-Table, not
advertised to EBGP peer)
Flag: 0x880
Not advertised to any peer
5
5.5.5.5 (metric 65) from 5.5.5.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: no-export
r4#
R4 55.5.5.0/24 community no-export

eBGP

6 R4 eBGP R6
r6#sh ip bgp
BGP table version is 157, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

http://bbs.hh010.com

Network

Next Hop

Metric LocPrf Weight Path

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 66.6.6.0/24

0.0.0.0

*> 100.1.1.0/24

4.4.4.4

*> 100.1.2.0/24

0.0.0.0

32768 i

*> 100.1.3.0/24

0.0.0.0

32768 i

0 4 i
32768 i
0 4 1 i

r6#
R4 55.5.5.0/24 community no-export

eBGP R6 55.5.5.0/24

4. no-advertise
R4 44.4.4.0/24 no-advertise R2

no-advertise BGP R1 R2
44.4.4.0/24

1 R2 BGP
r2#sh ip bgp
BGP table version is 124, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,

http://bbs.hh010.com

r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*>i11.1.1.0/24

1.1.1.1

*> 22.2.2.0/24

0.0.0.0

*> 44.4.4.0/24

4.4.4.4

*> 66.6.6.0/24

4.4.4.4

*>i100.1.1.0/24

1.1.1.1

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

100

0 i
32768 i
0 4 i
0 4 6 i

100

0 i

r2#
R2 R4

2 R1 BGP
r1#sh ip bgp
BGP table version is 186, local router ID is 1.1.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

http://bbs.hh010.com

Network

Next Hop

Metric LocPrf Weight Path

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*>i44.4.4.0/24

2.2.2.2

100

0 4 i

* i

3.3.3.3

100

0 4 i

*>i66.6.6.0/24

2.2.2.2

100

0 4 6 i

* i

3.3.3.3

100

0 4 6 i

*> 100.1.1.0/24

0.0.0.0

* i100.1.2.0/24

3.3.3.3

100

0 4 6 i

*>i

2.2.2.2

100

0 4 6 i

*>i100.1.3.0/24

2.2.2.2

100

0 4 6 i

* i

3.3.3.3

100

0 4 6 i

32768 i

32768 i

r1#
R2 R1

3R4 44.4.4.0/24 no-advertise R2


r4(config)#access-list 44 permit 44.4.4.0

r4(config)#route-map noa permit 10


r4(config-route-map)#match ip address 44

http://bbs.hh010.com

r4(config-route-map)#set community no-advertise


r4(config-route-map)#exit
r4(config)#route-map noa permit 20
r4(config-route-map)#exit

r4(config)#router bgp 4
r4(config-router)#neighbor 2.2.2.2 route-map noa out
r4(config-router)#neighbor 2.2.2.2 send-community
R4 44.4.4.0/24 no-advertise

community R2

4 R2 community
r2#sh ip bgp community
BGP table version is 125, local router ID is 2.2.2.2
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

*> 44.4.4.0/24

4.4.4.4

Metric LocPrf Weight Path


0

0 4 i

http://bbs.hh010.com

r2#
R2 R4 community

5 R2 community
r2#sh ip bgp 44.4.4.0
BGP routing table entry for 44.4.4.0/24, version 125
Paths: (1 available, best #1, table Default-IP-Routing-Table, not
advertised to any peer)
Flag: 0x880
Not advertised to any peer
4
4.4.4.4 (metric 2) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external, best
Community: no-advertise
r2#
R2 44.4.4.0/24 community no-advertise

BGP

6 R2 R1
r1#sh ip bgp
BGP table version is 187, local router ID is 1.1.1.1

http://bbs.hh010.com

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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*>i44.4.4.0/24

3.3.3.3

100

0 4 i

*>i66.6.6.0/24

2.2.2.2

100

0 4 6 i

* i

3.3.3.3

100

0 4 6 i

*> 100.1.1.0/24

0.0.0.0

* i100.1.2.0/24

3.3.3.3

100

0 4 6 i

*>i

2.2.2.2

100

0 4 6 i

*>i100.1.3.0/24

2.2.2.2

100

0 4 6 i

* i

3.3.3.3

100

0 4 6 i

32768 i

32768 i

r1#
R2 44.4.4.0/24 community no-advertise

R1 R2 44.4.4.0/24

http://bbs.hh010.com

5. Community
Community Community

1R4 100.0.0.0/8 Community 123 R5


r4(config)#access-list 10 permit 100.0.0.0 0.255.255.255

r4(config)#route-map com permit 10


r4(config-route-map)#match ip address 10
r4(config-route-map)#set community 123
r4(config-route-map)#exit
r4(config)#route-map com permit 20
r4(config-route-map)#exit

r4(config)#router bgp 4
r4(config-router)#neighbor 5.5.5.5 route-map com out
r4(config-router)#neighbor 5.5.5.5 send-community
R4 100.0.0.0/8 Community 123 R5

2 R5 community

http://bbs.hh010.com

r5#sh ip bgp community


BGP table version is 41, local router ID is 5.5.5.5
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

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

r5#
R4 community 100.0.0.0/8

3 R5 community
r5#sh ip bgp 100.1.1.0
BGP routing table entry for 100.1.1.0/24, version 39
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x880
Not advertised to any peer
4 1
4.4.4.4 (metric 65) from 4.4.4.4 (4.4.4.4)

http://bbs.hh010.com

Origin IGP, localpref 100, valid, external, best


Community: 123
r5#
R4 100.0.0.0/8 community 123

4 R5 BGP
r5#sh ip bgp
BGP table version is 41, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

0 4 6 i

*> 100.1.1.0/24

4.4.4.4

0 4 1 i

0 4 i
32768 i

http://bbs.hh010.com

*> 100.1.2.0/24

4.4.4.4

0 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 4 6 i

r5#
R5 BGP 10.0.0.0/8

5R5 community 123 weight 123


r5(config)#ip community-list 5 permit 123

r5(config)#route-map wei permit 10


r5(config-route-map)#match community 5
r5(config-route-map)#set weight 123
r5(config-route-map)#exit
r5(config)#route-map wei permit 20
r5(config-route-map)#exit

r5(config)#router bgp 5
r5(config-router)#neighbor 4.4.4.4 route-map wei in
R5 community-list community 123 weight

123

6 R5
r5#sh ip bgp

http://bbs.hh010.com

BGP table version is 44, local router ID is 5.5.5.5


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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

0 4 6 i

*> 100.1.1.0/24

4.4.4.4

123 4 1 i

*> 100.1.2.0/24

4.4.4.4

123 4 6 i

*> 100.1.3.0/24

4.4.4.4

123 4 6 i

0 4 i
32768 i

r5#
community 123 100.0.0.0/8 weight 123

6. AS:NN Community

1R4 100.0.0.0/8 Community 4:123 R5

http://bbs.hh010.com

r4(config)#access-list 10 permit 100.0.0.0 0.255.255.255

r4(config)#route-map com2 permit 10


r4(config-route-map)#match ip address 10
r4(config-route-map)#set community 4:123
r4(config-route-map)#exit
r4(config)#route-map com2 permit 20
r4(config-route-map)#exit

r4(config)#router bgp 4
r4(config-router)#neighbor 5.5.5.5 route-map com2 out
r4(config-router)#neighbor 5.5.5.5 send-community

R4 100.0.0.0/8 Community 4: 123 R5

2 Community AS:NN
r4(config)#ip bgp-community new-format
r5(config)#ip bgp-community new-format

r5#sh ip bgp 100.1.1.0

http://bbs.hh010.com

BGP routing table entry for 100.1.1.0/24, version 11


Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x880
Not advertised to any peer
4 1
4.4.4.4 (metric 65) from 4.4.4.4 (4.4.4.4)
Origin IGP, localpref 100, valid, external, best
Community: 262267
r5#
bgp-community new-format AS:NN

3 bgp-community new-format AS:NN


r5#sh ip bgp 100.1.1.0
BGP routing table entry for 100.1.1.0/24, version 11
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
4 1
4.4.4.4 (metric 65) from 4.4.4.4 (4.4.4.4)
Origin IGP, localpref 100, valid, external, best
Community: 4:123

http://bbs.hh010.com

r5#
bgp-community new-format Community 4:123

AS:NN

7. AS BGP
BGP AS AS

1 R5 BGP
r5(config)#router bgp 5
r5(config-router)#bgp router-id 5.5.5.5
r5(config-router)#neighbor 4.4.4.4 remote-as 100
r5(config-router)#neighbor 4.4.4.4 up loopback 0
r5(config-router)#neighbor 4.4.4.4 ebgp-multihop
r5(config-router)#network 55.5.5.0 mask 255.255.255.0
4.4.4.4 AS 4 R5 100

2 R4 AS
r4(config)#router bgp 4
r4(config-router)#neighbor 5.5.5.5 remote-as 5
r4(config-router)#neighbor 5.5.5.5 update-source loopback 0
r4(config-router)#neighbor 5.5.5.5 ebgp-multihop

http://bbs.hh010.com

r4(config-router)#neighbor 5.5.5.5 local-as 100


R4 5.5.5.5 AS 100 BGP

3 R5 BGP
r5#sh ip bgp summary
BGP router identifier 5.5.5.5, local AS number 5
BGP table version is 10, main routing table version 10
9 network entries using 1161 bytes of memory
9 path entries using 468 bytes of memory
5/4 BGP path/bestpath attribute entries using 620 bytes of memory
3 BGP AS-PATH entries using 72 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 2321 total bytes of memory
BGP activity 9/0 prefixes, 9/0 paths, scan interval 60 secs

Neighbor
Up/Down

TblVer

InQ OutQ

State/PfxRcd

4.4.4.4
00:00:34

AS MsgRcvd MsgSent

100

10

10

r5#
R5 R4 AS 100

http://bbs.hh010.com

4 R5 BGP
r5#sh ip bgp
BGP table version is 10, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 100 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 100 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 100 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

*> 66.6.6.0/24

4.4.4.4

0 100 4 6 i

*> 100.1.1.0/24

4.4.4.4

0 100 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 100 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 100 4 6 i

0 100 4 i
32768 i

r5#

http://bbs.hh010.com

R4 R5 AS AS 100

AS_Path R5

5 R6 BGP
r6#sh ip bgp
BGP table version is 158, local router ID is 6.6.6.6
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

4.4.4.4

*> 66.6.6.0/24

0.0.0.0

*> 100.1.1.0/24

4.4.4.4

*> 100.1.2.0/24

0.0.0.0

32768 i

*> 100.1.3.0/24

0.0.0.0

32768 i

0 4 i
0 4 100 5 i

32768 i
0 4 1 i

r6#

http://bbs.hh010.com

R4 R5 AS 100 R6 AS

6 AS_Path AS 100
r4(config)#router bgp 4
r4(config-router)#neighbor 5.5.5.5 local-as 100 no-prepend
AS 100 AS_Path

7 R5 BGP
r5#sh ip bgp
BGP table version is 26, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

4.4.4.4

0 100 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 100 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 100 4 1 i

*> 44.4.4.0/24

4.4.4.4

*> 55.5.5.0/24

0.0.0.0

0 100 4 i
32768 i

http://bbs.hh010.com

*> 66.6.6.0/24

4.4.4.4

0 100 4 6 i

*> 100.1.1.0/24

4.4.4.4

0 100 4 1 i

*> 100.1.2.0/24

4.4.4.4

0 100 4 6 i

*> 100.1.3.0/24

4.4.4.4

0 100 4 6 i

r5#
R5 AS 100 100

AS_Path AS 100

8 R6 BGP

r6#sh ip bgp
BGP table version is 160, local router ID is 6.6.6.6
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

*> 11.1.1.0/24

4.4.4.4

0 4 1 i

*> 22.2.2.0/24

4.4.4.4

0 4 1 i

*> 33.3.3.0/24

4.4.4.4

0 4 1 i

*> 44.4.4.0/24

4.4.4.4

0 4 i

http://bbs.hh010.com

*> 55.5.5.0/24

4.4.4.4

0 4 5 i

*> 66.6.6.0/24

0.0.0.0

*> 100.1.1.0/24

4.4.4.4

*> 100.1.2.0/24

0.0.0.0

32768 i

*> 100.1.3.0/24

0.0.0.0

32768 i

32768 i
0 4 1 i

r6#
AS 100 AS

AS_Path

BGP Reflector(BGP )

BGP eBGP AS AS-path


iBGP AS-path AS
iBGP iBGP
BGP AS BGP
eBGP iBGP iBGP
iBGP eBGP AS

http://bbs.hh010.com

R1 eBGP R5 iBGP R2
R2 iBGP R1 iBGP R3
BGP R3 R4 BGP
AS iBGP iBGP
iBGP eBGP
R1
R1
BGP BGP Reflector(BGP )
iBGP iBGP
BGP Reflector BGP client
iBGP

http://bbs.hh010.com

eBGP client client

client client
client client client

BGP Reflector Client cluster

R2 BGP Reflector R3 client R2 R3


cluster BGP Reflector Reflector

http://bbs.hh010.com

client client client cluster


client cluster Reflector

Cluster 1 R2 ReflectorR3 client R3 client


R3 Cluster 2 Reflector R4 Cluster 2
client Reflector R2 R1 client R3
R3 Reflector client R4 R4
R2

AS Cluster AS_Path
Cluster Cluster ID Cluster ID
Reflector Router-ID Cluster
Reflector Cluster Reflector Cluster ID

http://bbs.hh010.com

Reflector Cluster ID
Cluster Reflector Cluster ID
Cluster ID AS_Path
Cluster ID Cluster

Cluster ID Originator ID Originator ID


Router-ID
AS Originator ID AS BGP

BGP Reflector

http://bbs.hh010.com

BGP Reflector

Loopback
R1

Loopback 0

1.1.1.1/32

Loopback 11

11.1.1.1/24

R2

Loopback 0

2.2.2.2/32

Loopback 22

22.2.2.2/24

R3

Loopback 0

3.3.3.3/32

Loopback 33

33.3.3.3/24

http://bbs.hh010.com

R4

Loopback 0

4.4.4.4/32

Loopback 44

44.4.4.4/24

R5

Loopback 0

5.5.5.5/32

Loopback 55

55.5.5.5/24

OSPF Loopback 0 OSPF


Loopback 0

1.IGP Loopback 0

2. BGP

1 R5 BGP
r5(config)#router bgp 5
r5(config-router)#bgp router-id 5.5.5.5
r5(config-router)#neighbor 1.1.1.1 remote-as 1
r5(config-router)#neighbor 1.1.1.1 update-source loopback 0
r5(config-router)#neighbor 1.1.1.1 ebgp-multihop
r5(config-router)#network 55.5.5.0 mask 255.255.255.0

2 R1 BGP
r1(config)#router bgp 1
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#neighbor 5.5.5.5 remote-as 5

http://bbs.hh010.com

r1(config-router)#neighbor 5.5.5.5 update-source loopback 0


r1(config-router)#neighbor 5.5.5.5 ebgp-multihop
r1(config-router)#neighbor 2.2.2.2 remote-as 1
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
r1(config-router)#network 11.1.1.0 mask 255.255.255.0

3 R2 BGP
r2(config)#router bgp 1
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 1.1.1.1 remote-as 1
r2(config-router)#neighbor 1.1.1.1 update-source loopback 0
r2(config-router)#neighbor 3.3.3.3 remote-as 1
r2(config-router)#neighbor 3.3.3.3 update-source loopback 0
r2(config-router)#network 22.2.2.0 mask 255.255.255.0

4 R3 BGP
r3(config)#router bgp 1
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#neighbor 2.2.2.2 remote-as 1
r3(config-router)#neighbor 2.2.2.2 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 remote-as 1

http://bbs.hh010.com

r3(config-router)#neighbor 4.4.4.4 update-source loopback 0


r3(config-router)#network 33.3.3.0 mask 255.255.255.0

5 R4 BGP
r4(config)#router bgp 1
r4(config-router)#bgp router-id 4.4.4.4
r4(config-router)#neighbor 3.3.3.3 remote-as 1
r4(config-router)#neighbor 3.3.3.3 update-source loopback 0
r4(config-router)#network 44.4.4.0 mask 255.255.255.0

3. BGP

1 R5 BGP
r5#sh ip bgp
BGP table version is 4, local router ID is 5.5.5.5
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

*> 11.1.1.0/24

1.1.1.1

Metric LocPrf Weight Path


0

0 1 i

http://bbs.hh010.com

*> 22.2.2.0/24

1.1.1.1

*> 55.5.5.0/24

0.0.0.0

0 1 i
0

32768 i

r5#
R2 R3 R4 33.3.3.0 44.4.4.0 R1

R5

2 R1 BGP
r1#sh ip bgp
BGP table version is 4, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

*> 55.5.5.0/24

5.5.5.5

32768 i
100

0 i
0 5 i

r1#
R2 R3 R4 33.3.3.0 44.4.4.0 R1

R1

http://bbs.hh010.com

3 R2 BGP
r2#sh ip bgp
BGP table version is 5, local router ID is 2.2.2.2
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

*>i11.1.1.0/24

1.1.1.1

*> 22.2.2.0/24

0.0.0.0

*>i33.3.3.0/24

3.3.3.3

100

0 i

*>i55.5.5.0/24

5.5.5.5

100

0 5 i

100

0 i
32768 i

r2#
R3 R4 44.4.4.0 R2 R2

4 R3 BGP
r3#sh ip bgp
BGP table version is 4, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,
r RIB-failure, S Stale

http://bbs.hh010.com

Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*>i22.2.2.0/24

2.2.2.2

*> 33.3.3.0/24

0.0.0.0

*>i44.4.4.0/24

4.4.4.4

100

0 i
32768 i

100

0 i

r3#
R3 R2 R4

5 R4 BGP
r4#sh ip bgp
BGP table version is 3, local router ID is 4.4.4.4
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

*>i33.3.3.0/24

3.3.3.3

*> 44.4.4.0/24

0.0.0.0

100

0 i
32768 i

r4#

http://bbs.hh010.com

R4 R3

4. BGP Reflector

1 R2 BGP Reflector
r2(config)#router bgp 1
r2(config-router)#neighbor 3.3.3.3 route-reflector-client
R2 BGP ReflectorR3 Client

2 R3
r3#sh ip bgp
BGP table version is 8, local router ID is 3.3.3.3
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

*>i11.1.1.0/24

1.1.1.1

100

0 i

*>i22.2.2.0/24

2.2.2.2

100

0 i

*> 33.3.3.0/24

0.0.0.0

*>i44.4.4.0/24

4.4.4.4

100

0 i

*>i55.5.5.0/24

5.5.5.5

100

0 5 i

32768 i

r3#

http://bbs.hh010.com

R2 R1 R5 R3

3 R1
r1#sh ip bgp
BGP table version is 5, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

100

0 i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*> 55.5.5.0/24

5.5.5.5

32768 i

0 5 i

r1#
client client client

R1 R2 R4

4 R2
r2#sh ip bgp
BGP table version is 7, local router ID is 2.2.2.2

http://bbs.hh010.com

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

*>i11.1.1.0/24

1.1.1.1

*> 22.2.2.0/24

0.0.0.0

*>i33.3.3.0/24

3.3.3.3

100

0 i

*>i55.5.5.0/24

5.5.5.5

100

0 5 i

100

0 i
32768 i

r2#
R3 iBGP R4 iBGP R2 R4

5 R3 R4 44.4.4.0
r3#sh ip bgp 44.4.4.0
BGP routing table entry for 44.4.4.0/24, version 4
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
Local
4.4.4.4 (metric 2) from 4.4.4.4 (4.4.4.4)

http://bbs.hh010.com

Origin IGP, metric 0, localpref 100, valid, internal, best


r3#
R4 R3

6 R3 R2 55.5.5.0
r3#sh ip bgp 55.5.5.0
BGP routing table entry for 55.5.5.0/24, version 8
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
5
5.5.5.5 (metric 4) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, internal, best
Originator: 1.1.1.1, Cluster list: 2.2.2.2
r3#
R2 Reflector, Cluster ID

Router-ID 2.2.2.2 Originator ID AS R1


Router-ID

7 Reflector R2 Client
r2(config)#router bgp 1
r2(config-router)#neighbor 3.3.3.3 next-hop-self

http://bbs.hh010.com

8 R3
r3#sh ip bgp
BGP table version is 8, local router ID is 3.3.3.3
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

*>i11.1.1.0/24

1.1.1.1

100

0 i

*>i22.2.2.0/24

2.2.2.2

100

0 i

*> 33.3.3.0/24

0.0.0.0

*>i44.4.4.0/24

4.4.4.4

100

0 i

*>i55.5.5.0/24

5.5.5.5

100

0 5 i

32768 i

r3#
R2 R5 55.5.5.0 R5

Reflector

5. Cluster 2

(1) R4

r4#sh ip bgp

http://bbs.hh010.com

BGP table version is 3, local router ID is 4.4.4.4


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

*>i33.3.3.0/24

3.3.3.3

*> 44.4.4.0/24

0.0.0.0

100

0 i
32768 i

r4#
R3 iBGP R4 R4 R3 R4

2 R3 Cluster Reflector
r3(config)#router bgp 1
r3(config-router)#neighbor 4.4.4.4 route-reflector-client
R3 ReflectorR4 Client

3 R4
r4#sh ip bgp
BGP table version is 8, local router ID is 4.4.4.4

http://bbs.hh010.com

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

*>i11.1.1.0/24

1.1.1.1

100

0 i

*>i22.2.2.0/24

2.2.2.2

100

0 i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*> 44.4.4.0/24

0.0.0.0

*>i55.5.5.0/24

5.5.5.5

32768 i
100

0 5 i

r4#
R3 client R4 R4

4 R4 Reflector
r4#sh ip bgp 55.5.5.0
BGP routing table entry for 55.5.5.0/24, version 8
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
5
5.5.5.5 (metric 5) from 3.3.3.3 (3.3.3.3)

http://bbs.hh010.com

Origin IGP, metric 0, localpref 100, valid, internal, best


Originator: 1.1.1.1, Cluster list: 3.3.3.3, 2.2.2.2
r4#
cluster clustercluster ID AS_Path

5 R3 cluster ID
r3(config)#router bgp 1
r3(config-router)#bgp cluster-id 123
R3 cluster ID 0.0.0.123

6 R4 Reflector
r4#sh ip bgp 55.5.5.0
BGP routing table entry for 55.5.5.0/24, version 11
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x800
Not advertised to any peer
5
5.5.5.5 (metric 5) from 3.3.3.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, internal, best
Originator: 1.1.1.1, Cluster list: 0.0.0.123, 2.2.2.2

http://bbs.hh010.com

r4#
R3 cluster ID 0.0.0.123

BGP Confederation(BGP )
iBGP iBGP
iBGP BGP Reflector
BGP Confederation(BGP )
iBGP iBGP eBGP
iBGP
AS BGP Confederation AS AS
AS AS AS eBGP

http://bbs.hh010.com

R3 iBGP R1 iBGP R4
R2 eBGP R5 R1 AS
R4 R4 R3 R4

BGP R3 R4 BGP
Reflector AS BGP Confederation

BGP Confederation R1 R3 AS 64512


R2 R4 AS 64513 R1 R3 R2
R4
R3 R4 eBGP R3 R4 BGP

http://bbs.hh010.com

BGP Confederation AS AS AS
64512-65534 BGP Confederation AS
R1 R2 AS 1 AS 64512 AS 64513 R5
R1 R2 AS 1 AS 64512 AS 64513 R5
AS BGP Confederation AS AS
AS_Path AS AS AS_Path

AS AS_Path
eBGP iBGP AS AS
eBGP iBGP

BGP Confederation

http://bbs.hh010.com

Loopback
R1

Loopback 0

1.1.1.1/32

Loopback 11

11.1.1.1/24

R2

Loopback 0

2.2.2.2/32

Loopback 22

22.2.2.2/24

R3

Loopback 0

3.3.3.3/32

Loopback 33

33.3.3.3/24

R4

Loopback 0

4.4.4.4/32

Loopback 44

44.4.4.4/24

R5

Loopback 0

5.5.5.5/32

Loopback 55

55.5.5.5/24

OSPF Loopback 0 OSPF


Loopback 0

1.IGP Loopback 0

1 OSPF

2 Loopback 0
r5#ping 1.1.1.1 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5

http://bbs.hh010.com

!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/114/228
ms
r5#ping 2.2.2.2 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/84/128
ms
r5#
r5#
r5#ping 3.3.3.3 source loopback 0

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/106/180
ms
r5#ping 4.4.4.4 source loopback 0

http://bbs.hh010.com

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/124/224
ms
r5#
Loopback 0

2. BGP Confederation

1 R5 BGP
r5(config)#router bgp 5
r5(config-router)#bgp router-id 5.5.5.5
r5(config-router)#neighbor 1.1.1.1 remote-as 1
r5(config-router)#neighbor 1.1.1.1 update-source loopback 0
r5(config-router)#neighbor 1.1.1.1 ebgp-multihop
r5(config-router)#neighbor 2.2.2.2 remote-as 1
r5(config-router)#neighbor 2.2.2.2 update-source loopback 0
r5(config-router)#neighbor 2.2.2.2 ebgp-multihop
r5(config-router)#network 55.5.5.0 mask 255.255.255.0

http://bbs.hh010.com

R5

2 R1 BGP Confederation
r1(config)#router bgp 64512
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#bgp confederation identifier 1
r1(config-router)#bgp confederation peers 64513
r1(config-router)#neighbor 5.5.5.5 remote-as 5
r1(config-router)#neighbor 5.5.5.5 update-source loopback 0
r1(config-router)#neighbor 5.5.5.5 ebgp-multihop
r1(config-router)#neighbor 2.2.2.2 remote-as 64513
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
r1(config-router)#neighbor 2.2.2.2 ebgp-multihop
r1(config-router)#neighbor 3.3.3.3 remote-as 64512
r1(config-router)#neighbor 3.3.3.3 update-source loopback 0
r1(config-router)#network 11.1.1.0 mask 255.255.255.0
AS 64512 AS 1 AS 64513 AS

R2 eBGP R3 iBGP

3 R2 BGP Confederation
r2(config)#router bgp 64513
r2(config-router)#bgp router-id 2.2.2.2

http://bbs.hh010.com

r2(config-router)#bgp confederation identifier 1


r2(config-router)#bgp confederation peers 64512
r2(config-router)#neighbor 5.5.5.5 remote-as 5
r2(config-router)#neighbor 5.5.5.5 update-source loopback 0
r2(config-router)#neighbor 5.5.5.5 ebgp-multihop
r2(config-router)#neighbor 1.1.1.1 remote-as 64512
r2(config-router)#neighbor 1.1.1.1 update-source loopback 0
r2(config-router)#neighbor 1.1.1.1 ebgp-multihop
r2(config-router)#neighbor 4.4.4.4 remote-as 64513
r2(config-router)#neighbor 4.4.4.4 update-source loopback 0
r2(config-router)#network 22.2.2.0 mask 255.255.255.0

AS 64513 AS 1 AS 64512 AS

R1 eBGP R4 iBGP
4 R3 BGP Confederation
r3(config)#router bgp 64512
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#bgp confederation identifier 1
r3(config-router)#bgp confederation peers 64513
r3(config-router)#neighbor 1.1.1.1 remote-as 64512
r3(config-router)#neighbor 1.1.1.1 update-source loopback 0
r3(config-router)#neighbor 4.4.4.4 remote-as 64513

http://bbs.hh010.com

r3(config-router)#neighbor 4.4.4.4 update-source loopback 0


r3(config-router)#neighbor 4.4.4.4 ebgp-multihop
r3(config-router)#network 33.3.3.0 mask 255.255.255.0
AS 64512 AS 1 AS 64513 AS

R4 eBGP R1 iBGP
5 R4 BGP Confederation
r4(config)#router bgp 64513
r4(config-router)#bgp router-id 4.4.4.4
r4(config-router)#bgp confederation identifier 1
r4(config-router)#bgp confederation peers 64512
r4(config-router)#neighbor 2.2.2.2 remote-as 64513
r4(config-router)#neighbor 2.2.2.2 update-source loopback 0
r4(config-router)#neighbor 3.3.3.3 remote-as 64512
r4(config-router)#neighbor 3.3.3.3 update-source loopback 0
r4(config-router)#neighbor 3.3.3.3 ebgp-multihop
r4(config-router)#network 44.4.4.0 mask 255.255.255.0
AS 64513 AS 1 AS 64512 AS

R3 eBGP R1 iBGP

3. BGP

1 R5 BGP
r5#sh ip bgp summary

http://bbs.hh010.com

BGP router identifier 5.5.5.5, local AS number 5


BGP table version is 6, main routing table version 6
5 network entries using 645 bytes of memory
9 path entries using 468 bytes of memory
4/3 BGP path/bestpath attribute entries using 496 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1633 total bytes of memory
BGP activity 5/0 prefixes, 9/0 paths, scan interval 60 secs

Neighbor
Up/Down

TblVer

InQ OutQ

State/PfxRcd

1.1.1.1
00:17:30

25

26

15

16

2.2.2.2
00:07:08

AS MsgRcvd MsgSent

r5#
R1 R2 AS 64512 AS 64513 R5

AS 1 AS

2 R1 BGP
r1#sh ip bgp summary

http://bbs.hh010.com

BGP router identifier 1.1.1.1, local AS number 64512


BGP table version is 6, main routing table version 6
5 network entries using 645 bytes of memory
6 path entries using 312 bytes of memory
6/4 BGP path/bestpath attribute entries using 744 bytes of memory
3 BGP AS-PATH entries using 72 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1773 total bytes of memory
BGP activity 5/0 prefixes, 6/0 paths, scan interval 60 secs

Neighbor
Up/Down

TblVer

InQ OutQ

State/PfxRcd

2.2.2.2
00:06:27

00:03:14

4 64513

13

13

4 64512

11

26

25

3.3.3.3
1

5.5.5.5
00:17:51

AS MsgRcvd MsgSent

r1#
AS AS

BGP

http://bbs.hh010.com

4. BGP

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

Next Hop

11.1.1.0/24

2.2.2.2

Network

*>
*

1.1.1.1
22.2.2.0/24

*>
33.3.3.0/24

0 1 i
0

1.1.1.1
2.2.2.2

Metric LocPrf Weight Path

0 1 i
0 1 i

0 1 i

2.2.2.2

0 1 i

1.1.1.1

0 1 i

1.1.1.1

0 1 i

*>

2.2.2.2

0 1 i

*> 55.5.5.0/24

0.0.0.0

*>
*

44.4.4.0/24

32768 i

r5#

http://bbs.hh010.com

R5 AS

2 R1 BGP
r1#sh ip bgp
BGP table version is 6, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*> 22.2.2.0/24

2.2.2.2

100

0 (64513) i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*> 44.4.4.0/24

4.4.4.4

100

0 (64513) i

5.5.5.5

100

0 (64513)

5.5.5.5

55.5.5.0/24

Metric LocPrf Weight Path


32768 i

5 i
*>

0 5 i

r1#
R1 BGP

AS R1 R2 eBGP

3 R2 R1
r2(config)#router bgp 64513

http://bbs.hh010.com

r2(config-router)#neighbor 1.1.1.1 next-hop-self

4 R1 BGP
r1#sh ip bgp
BGP table version is 7, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*> 22.2.2.0/24

2.2.2.2

100

0 (64513) i

*>i33.3.3.0/24

3.3.3.3

100

0 i

* i44.4.4.0/24

4.4.4.4

100

0 (64513) i

*>

2.2.2.2

100

0 (64513)

2.2.2.2

100

0 (64513)

5.5.5.5

32768 i

i
*

55.5.5.0/24

5 i
*>

0 5 i

r1#
R2 R1

http://bbs.hh010.com

5AS
R1:
r1(config)#router bgp 64512
r1(config-router)#neighbor 2.2.2.2 next-hop-self
r1(config-router)#neighbor 3.3.3.3 next-hop-self

R3
r3(config)#router bgp 64512
r3(config-router)#neighbor 1.1.1.1 next-hop-self
r3(config-router)#neighbor 4.4.4.4 next-hop-self

R4
r4(config)#router bgp 64513
r4(config-router)#neighbor 2.2.2.2 next-hop-self
r4(config-router)#neighbor 3.3.3.3 next-hop-self

5. BGP

1 R1 BGP

http://bbs.hh010.com

r1#sh ip bgp
BGP table version is 7, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*> 22.2.2.0/24

2.2.2.2

100

0 (64513) i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*> 44.4.4.0/24

2.2.2.2

100

0 (64513) i

2.2.2.2

100

0 (64513)

5.5.5.5

55.5.5.0/24

Metric LocPrf Weight Path


32768 i

5 i
*>

0 5 i

r1#
R1 R5 55.5.5.0/24 S0/0

2 R1 55.5.5.0/24
AS_Path

R1 55.5.5.0/24 R2 AS_Path R5 R2 AS_Path


R5 AS AS_Path
AS AS_Path
MED

http://bbs.hh010.com

r1(config)#access-list 55 permit 55.5.5.0

r1(config)#route-map med permit 10


r1(config-route-map)#match ip address 55
r1(config-route-map)#set metric 55
r1(config-route-map)#exit
r1(config)#route-map med permit 20
r1(config-route-map)#exit

r1(config)#router bgp 64512


r1(config-router)#neighbor 5.5.5.5 route-map med in
R5 MED 55 R2 MED 0

3 R1 55.5.5.0/24
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

Metric LocPrf Weight Path


0

32768 i

http://bbs.hh010.com

*> 22.2.2.0/24

2.2.2.2

100

0 (64513) i

*>i33.3.3.0/24

3.3.3.3

100

0 i

*> 44.4.4.0/24

2.2.2.2

100

0 (64513) i

*> 55.5.5.0/24

2.2.2.2

100

0 (64513) 5

5.5.5.5

55

i
0 5 i

r1#
R1 55.5.5.0/24 R2 R1 AS_Path R5

AS R2 MED
eBGP iBGP BGP

4 R3 BGP
r3#sh ip bgp
BGP table version is 12, local router ID is 3.3.3.3
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

*>i11.1.1.0/24

1.1.1.1

100

0 i

4.4.4.4

100

0 (64513)

22.2.2.0/24

Metric LocPrf Weight Path

http://bbs.hh010.com

*>i

1.1.1.1

100

0 (64513)

*> 33.3.3.0/24

0.0.0.0

4.4.4.4

100

0 (64513)

*>i

1.1.1.1

100

0 (64513)

4.4.4.4

100

0 (64513)

1.1.1.1

100

0 (64513)

44.4.4.0/24

32768 i

i
55.5.5.0/24

5 i
*>i
5 i
r3#
R3 55.5.5.0/24 iBGP R1

eBGP R4 eBGP iBGP BGP

http://bbs.hh010.com

BGP

AS 1 AS 2 AS 1 R1 AS
2 R2 eBGP R2 AS 2 R1
AS 1 AS 2 R1 AS 2 R2
R1 R2 eBGP AS 1 AS 2
33.0.0.0/8 R1 R3 R1 R3
EIGRP R3 33.0.0.0/8 EIGRP R1R3
33.0.0.0/8 EIGRP BGP R1 R3
R1 R2 R1 R2 33.0.0.0/8
R1 eBGP R2 EIGRP R3 33.0.0.0/8 eBGP
AD 20EIGRP AD 90R1 33.0.0.0/8
R1 R2
R1 R3 33.0.0.0/8 eBGP AD
EIGRP AD
33.0.0.0/8

http://bbs.hh010.com

eBGP BGP
network BGP AD 200
IGP AD
BGP BGP backdoorBGP
BGP BGP BGP

BGP

Loopback
R1

Loopback 0

1.1.1.1/32

R2

Loopback 0

2.2.2.2/32

R3

Loopback 0

3.3.3.3/32

http://bbs.hh010.com

OSPF Loopback 0 OSPF


Loopback 0

1.IGP Loopback 0

1 OSPF

2 Loopback 0

2. BGP

1 R1 R2 BGP
r1(config)#router bgp 1
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#neighbor 2.2.2.2 remote-as 2
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
r1(config-router)#neighbor 2.2.2.2 ebgp-multihop
R1 R2 eBGP

2 R2 R1 R3 BGP
r2(config)#router bgp 2
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 1.1.1.1 remote-as 1

http://bbs.hh010.com

r2(config-router)#neighbor 1.1.1.1 update-source loopback 0


r2(config-router)#neighbor 1.1.1.1 ebgp-multihop
r2(config-router)#neighbor 3.3.3.3 remote-as 2
r2(config-router)#neighbor 3.3.3.3 update-source loopback 0
R2 R1 eBGP , R2 R3 iBGP

3 R3 R2 BGP
r3(config)#router bgp 2
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#neighbor 2.2.2.2 remote-as 2
r3(config-router)#neighbor 2.2.2.2 update-source loopback 0
r3(config-router)#network 33.0.0.0 mask 255.0.0.0
R3 R2 iBGP , 33.0.0.0/8 BGP

3.

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

http://bbs.hh010.com

Network
*>i33.0.0.0

Next Hop
3.3.3.3

Metric LocPrf Weight Path


0

100

0 i

r2#
R2 iBGP R3 33.0.0.0

2 R1 BGP
r1#sh ip bgp
BGP table version is 7, local router ID is 1.1.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
*> 33.0.0.0

Next Hop
2.2.2.2

Metric LocPrf Weight Path


0 2 i

r1#
R1 eBGP R2 33.0.0.0

3 R1 IGP
r1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

http://bbs.hh010.com

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2


E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS
level-2
ia - IS-IS inter area, * - candidate default, U - per-user static
route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets


C

1.1.1.1 is directly connected, Loopback0


2.0.0.0/32 is subnetted, 1 subnets

O
B

2.2.2.2 [110/2] via 12.1.1.2, 00:15:39, FastEthernet0/0


33.0.0.0/8 [20/0] via 2.2.2.2, 00:00:13
3.0.0.0/32 is subnetted, 1 subnets

3.3.3.3 [110/66] via 12.1.1.2, 00:15:39, FastEthernet0/0


23.0.0.0/24 is subnetted, 1 subnets

23.1.1.0 [110/65] via 12.1.1.2, 00:15:39, FastEthernet0/0


12.0.0.0/24 is subnetted, 1 subnets

12.1.1.0 is directly connected, FastEthernet0/0


13.0.0.0/24 is subnetted, 1 subnets

http://bbs.hh010.com

13.1.1.0 is directly connected, FastEthernet0/1

r1#
R1 33.0.0.0 R2

4 R1 33.0.0.0
r1#traceroute 33.3.3.3

Type escape sequence to abort.


Tracing the route to 33.3.3.3

1 12.1.1.2 16 msec 84 msec 16 msec


2 23.1.1.3 184 msec *

316 msec

r1#
R1 R1 R2 33.0.0.0

4. EIGRP

1 R1 R3 EIGRP
R1
r1(config)#router eigrp 100
r1(config-router)#no auto-summary
r1(config-router)#network 13.1.1.1 0.0.0.0

http://bbs.hh010.com

R3
r3(config)#router eigrp 100
r3(config-router)#no auto-summary
r3(config-router)#network 13.1.1.3 0.0.0.0
r3(config-router)#network 33.3.3.3 0.0.0.0

R1 R3 EIGRPR3 33.0.0.0 EIGRP

2 R1 EIGRP
r1#sh ip eigrp topology
IP-EIGRP Topology Table for AS(100)/ID(1.1.1.1)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,


r - reply Status, s - sia Status

P 13.1.1.0/24, 1 successors, FD is 28160


via Connected, FastEthernet0/1
P 33.0.0.0/8, 0 successors, FD is Inaccessible
via 13.1.1.3 (156160/128256), FastEthernet0/1
r1#

http://bbs.hh010.com

R1 R3 33.0.0.0

5. BGP

1R1 BGP 33.0.0.0


r1(config)#router bgp 1
r1(config-router)#network 33.3.3.0 backdoor

2 R1 BGP
r1#sh ip bgp
BGP table version is 4, local router ID is 1.1.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
r> 33.0.0.0

Next Hop
2.2.2.2

Metric LocPrf Weight Path


0 2 i

r1#
33.0.0.0 r BGP RIB-failure

3 R1 IGP

http://bbs.hh010.com

r1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS
level-2
ia - IS-IS inter area, * - candidate default, U - per-user static
route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets


C

1.1.1.1 is directly connected, Loopback0


2.0.0.0/32 is subnetted, 1 subnets

2.2.2.2 [110/2] via 12.1.1.2, 00:19:28, FastEthernet0/0

33.0.0.0/8 [90/156160] via 13.1.1.3, 00:02:35, FastEthernet0/1


3.0.0.0/32 is subnetted, 1 subnets

3.3.3.3 [110/66] via 12.1.1.2, 00:19:28, FastEthernet0/0


23.0.0.0/24 is subnetted, 1 subnets

23.1.1.0 [110/65] via 12.1.1.2, 00:19:28, FastEthernet0/0

http://bbs.hh010.com

12.0.0.0/24 is subnetted, 1 subnets


C

12.1.1.0 is directly connected, FastEthernet0/0


13.0.0.0/24 is subnetted, 1 subnets

13.1.1.0 is directly connected, FastEthernet0/1

r1#
R1 33.0.0.0 R3

4 R1 33.0.0.0
r1#traceroute 33.3.3.3

Type escape sequence to abort.


Tracing the route to 33.3.3.3

1 13.1.1.3 204 msec *

56 msec

r1#
R1 R3 33.0.0.0

BGP Dampening
BGP

BGP

http://bbs.hh010.com

BGP

BGP
BGP Dampening
BGP

Penalty()
1000

Suppress limit()
2000 2000

Half-life ()
15 5

http://bbs.hh010.com

Resume limit ()
750
10

Maximum suppress limit()


4 60 750
4 750 12000

BGP Dampening eBGP


BGP Dampening iBGP

BGP Dampening BGP

BGP Dampening

BGP Dampening

http://bbs.hh010.com


Loopback
R1

Loopback 0

1.1.1.1/32

R2

Loopback 0

2.2.2.2/32

OSPF Loopback 0 OSPF


Loopback 0

1.IGP Loopback 0

2. BGP

1 R1 BGP
r1(config)#router bgp 1

http://bbs.hh010.com

r1(config-router)#bgp router-id 1.1.1.1


r1(config-router)#neighbor 2.2.2.2 remote-as 2
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
r1(config-router)#neighbor 2.2.2.2 ebgp-multihop
R1 R2 eBGP

2 R2 BGP
r2(config)#router bgp 2
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 1.1.1.1 remote-as 1
r2(config-router)#neighbor 1.1.1.1 update-source loopback 0
r2(config-router)#neighbor 1.1.1.1 ebgp-multihop
r2(config-router)#network 10.1.1.0 mask 255.255.255.0
r2(config-router)#network 20.1.1.0 mask 255.255.255.0
R2 10.1.1.0/24 20.1.1.0/24 BGP

3 R1 BGP
r1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,

http://bbs.hh010.com

r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*> 10.1.1.0/24

2.2.2.2

0 2 i

*> 20.1.1.0/24

2.2.2.2

0 2 i

r1#
R1 R2 10.1.1.0/24 20.1.1.0/24

3. BGP Dampening

1 R1 BGP Dampening
r1(config)#router bgp 1
r1(config-router)#bgp dampening

2 BGP Dampening
r1#sh ip bgp dampening parameters
dampening 15 750 2000 60 (DEFAULT)
Half-life time

: 15 mins

Decay Time

: 2320 secs

Max suppress penalty: 12000

Max suppress time: 60 mins

Suppress penalty

Reuse penalty

2000

: 750

http://bbs.hh010.com

BGP Dampening

3 BGP Dampening
r1#sh ip bgp dampening dampened-paths

r1#

4 bgp dampening
r2(config)#int loopback 10
r2(config-if)#shutdown
10.1.1.0/24

5R1 10.1.1.0/24
r1#sh ip bgp 10.1.1.0
BGP routing table entry for 10.1.1.0/24, version 4
Paths: (1 available, no best path)
Flag: 0x820
Not advertised to any peer
2 (history entry)
2.2.2.2 (metric 65) from 2.2.2.2 (2.2.2.2)

http://bbs.hh010.com

Origin IGP, metric 0, localpref 100, external


Dampinfo: penalty 980, flapped 1 times in 00:00:29
r1#
10.1.1.0/24 penalty

980

6R1 10.1.1.0/24
r1#sh ip bgp 10.1.1.0
BGP routing table entry for 10.1.1.0/24, version 6
Paths: (1 available, no best path)
Flag: 0x820
Not advertised to any peer
2 (history entry)
2.2.2.2 (metric 65) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, external
Dampinfo: penalty 1903, flapped 2 times in 00:04:25
r1#
10.1.1.0/24 penalty 1903

2000

7R1 10.1.1.0/24
r1#sh ip bgp 10.1.1.0

http://bbs.hh010.com

BGP routing table entry for 10.1.1.0/24, version 8


Paths: (1 available, no best path)
Flag: 0x820
Not advertised to any peer
2 (history entry)
2.2.2.2 (metric 65) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, external
Dampinfo: penalty 2780, flapped 3 times in 00:06:03
r1#
3 penalty 2780 2000

8
r1#sh ip bgp dampening dampened-paths
BGP table version is 8, local router ID is 1.1.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
*d 10.1.1.0/24

From

Reuse

Path

2.2.2.2

00:04:49 2 i

r1#

http://bbs.hh010.com

10.1.1.0/24

9 R1 BGP
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.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

*d 10.1.1.0/24

2.2.2.2

0 2 i

*> 20.1.1.0/24

2.2.2.2

0 2 i

r1#
BGP 10.1.1.0/24

4. BGP Dampening

1 R1 20.1.1.0 BGP Dampening


r1(config)#access-list 20 permit 20.1.1.0
r1(config)#route-map damp permit 10

http://bbs.hh010.com

r1(config-route-map)#match ip address 20
r1(config-route-map)#set dampening 15 800 2100 60
r1(config-route-map)#exit
r1(config)#route-map damp permit 20

r1(config)#router bgp 1
r1(config-router)#bgp dampening route-map damp
20.1.1.0/24 BGP Dampening Dampening

2 BGP Dampening
r1#sh ip bgp dampening parameters
dampening 15 800 2100 60 (route-map damp 10)
Half-life time

: 15 mins

Decay Time

: 2345 secs

Max suppress penalty: 12800

Max suppress time: 60 mins

Suppress penalty

Reuse penalty

2100

: 800

r1#

3 20.1.1.0/24
r1#sh ip bgp 20.1.1.0

http://bbs.hh010.com

BGP routing table entry for 20.1.1.0/24, version 4


Paths: (1 available, no best path)
Flag: 0x820
Not advertised to any peer
2 (history entry)
2.2.2.2 (metric 65) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, external
Dampinfo: penalty 1000, flapped 1 times in 00:00:04
r1#
20.1.1.0/24 penalty 1000

4 20.1.1.0/24
r1#sh ip bgp 20.1.1.0
BGP routing table entry for 20.1.1.0/24, version 8
Paths: (1 available, no best path)
Flag: 0x820
Not advertised to any peer
2 (history entry)
2.2.2.2 (metric 65) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, external
Dampinfo: penalty 2886, flapped 3 times in 00:03:08

http://bbs.hh010.com

r1#
20.1.1.0/24 3 penalty 2886 2000

5
r1#sh ip bgp dampening dampened-paths
BGP table version is 8, local router ID is 1.1.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
*d 20.1.1.0/24

From

Reuse

Path

2.2.2.2

00:05:39 2 i

r1#
20.1.1.0/24

6 R1 BGP
r1#sh ip bgp
BGP table version is 8, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal,
r RIB-failure, S Stale

http://bbs.hh010.com

Origin codes: i - IGP, e - EGP, ? - incomplete

Network

Next Hop

Metric LocPrf Weight Path

*> 10.1.1.0/24

2.2.2.2

0 2 i

*d 20.1.1.0/24

2.2.2.2

0 2 i

r1#
BGP 20.1.1.0/24

BGP IGP
BGP BGP IGP
IGP
IOS BGP IGP BGP IGP
eBGP
IGP iBGP IGP iBGP
IGP

BGP IGP

http://bbs.hh010.com

R1R2R3 Loopback
R1

Loopback 0

1.1.1.1/32

R2

Loopback 0

2.2.2.2/32

R3

Loopback 0

3.3.3.3/32

OSPF Loopback 0 OSPF


Loopback 0

1.IGP Loopback 0

http://bbs.hh010.com

2. BGP

1 R1 BGP
r1(config)#router bgp 1
r1(config-router)#bgp router-id 1.1.1.1
r1(config-router)#neighbor 2.2.2.2 remote-as 1
r1(config-router)#neighbor 2.2.2.2 update-source loopback 0
r1(config-router)#neighbor 3.3.3.3 remote-as 3
r1(config-router)#neighbor 3.3.3.3 update-source loopback 0
r1(config-router)#neighbor 3.3.3.3 ebgp-multihop
r1(config-router)#network 11.1.1.0 mask 255.255.255.0
R1 R2 iBGP R3 eBGP

2 R2 BGP
r2(config)#router bgp 1
r2(config-router)#bgp router-id 2.2.2.2
r2(config-router)#neighbor 1.1.1.1 remote-as 1
r2(config-router)#neighbor 1.1.1.1 update-source loopback 0
r2(config-router)#network 22.2.2.0 mask 255.255.255.0
R2 R1 iBGP

http://bbs.hh010.com

3 R3 BGP
r3(config)#router bgp 3
r3(config-router)#bgp router-id 3.3.3.3
r3(config-router)#neighbor 1.1.1.1 remote-as 1
r3(config-router)#neighbor 1.1.1.1 update-source loopback 0
r3(config-router)#neighbor 1.1.1.1 ebgp-multihop
r3(config-router)#network 33.3.3.0 mask 255.255.255.0
R3 R1 eBGP

(4) R1 BGP
r1#sh ip bgp
BGP table version is 4, local router ID is 1.1.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

*> 11.1.1.0/24

0.0.0.0

*>i22.2.2.0/24

2.2.2.2

32768 i
100

0 i

http://bbs.hh010.com

*> 33.3.3.0/24

3.3.3.3

0 3 i

r1#
R1 11.1.1.0/24iBGP 22.2.2.0/24eBGP

33.3.3.0/24

3. EIGRP

1 R1 EIGRP
r1(config)#router eigrp 100
r1(config-router)#no auto-summary
r1(config-router)#network 14.1.1.1 0.0.0.0
R1 R4 EIGRP

2 R4 EIGRP
r4(config)#router eigrp 100
r4(config-router)#no auto-summary
r4(config-router)#network 14.1.1.4 0.0.0.0
R4 R1 EIGRP

3 R4 EIGRP
r4#sh ip eig neighbors
IP-EIGRP neighbors for process 100

http://bbs.hh010.com

Address

Uptime

SRTT

Interface
RTO

Hold

Seq
(sec)

(ms)

Cnt Num
0
1590

14.1.1.1
5000

Se1/0

137 00:00:44

r4#
R4 R1 EIGRP

4. BGP EIGRP

1 R1 BGP EIGRP
r1(config)#router eigrp 100
r1(config-router)#redistribute bgp 1 metric 10000 100 255 1 1500
R1 BGP BGP EIGRP

2 R4 EIGRP
r4#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2

http://bbs.hh010.com

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS


level-2
ia - IS-IS inter area, * - candidate default, U - per-user static
route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

33.0.0.0/24 is subnetted, 1 subnets


D EX

33.3.3.0 [170/2195456] via 14.1.1.1, 00:00:49, Serial1/0


11.0.0.0/24 is subnetted, 1 subnets

D EX

11.1.1.0 [170/2195456] via 14.1.1.1, 00:00:49, Serial1/0


14.0.0.0/24 is subnetted, 1 subnets

14.1.1.0 is directly connected, Serial1/0

r4#
R1 11.0.0.0/24 eBGP 33.3.3.0/24

IGP

3 iBGP IGP
r1(config)#router bgp 1
r1(config-router)#bgp redistribute-internal
BGP iBGP IGP

http://bbs.hh010.com

(4) R4 EIGRP
r4#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS
level-2
ia - IS-IS inter area, * - candidate default, U - per-user static
route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

33.0.0.0/24 is subnetted, 1 subnets


D EX

33.3.3.0 [170/2195456] via 14.1.1.1, 00:01:15, Serial1/0


22.0.0.0/24 is subnetted, 1 subnets

D EX

22.2.2.0 [170/2195456] via 14.1.1.1, 00:00:02, Serial1/0


11.0.0.0/24 is subnetted, 1 subnets

D EX

11.1.1.0 [170/2195456] via 14.1.1.1, 00:01:15, Serial1/0


14.0.0.0/24 is subnetted, 1 subnets

http://bbs.hh010.com

14.1.1.0 is directly connected, Serial1/0

r4#
iBGP IGP
BGP IGP

R4 EIGRP BGP

http://bbs.hh010.com

S-ar putea să vă placă și