Documente Academic
Documente Profesional
Documente Cultură
................................................................................................................................. 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 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).
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 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
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
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 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
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
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
http://bbs.hh010.com
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
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
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
8. IGP metric
eBGP iBGP IGP metric
9.
BGP
BGP
BGP
maximum-paths n eBGP
maximum-paths ibgp n iBGP
n 6 1
10. eBGP
http://bbs.hh010.com
BGP bgp best path comparerouterid
IOS Router-ID
11. Router-ID
BGP Router-ID OSPF Router-ID
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
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
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
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
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
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
3 R1 BGP
1#sh ip bgp
BGP table version is 2, local router ID is 1.1.1.1
http://bbs.hh010.com
Network
Next Hop
*> 11.1.1.0/24
0.0.0.0
32768 i
r1#
R1 network 11.1.1.0/24 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
* 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
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
*> 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
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
*> 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
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
*> 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
*> 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
* 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
*>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
*> 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
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
*> 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
*>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
2 R1 BGP
r1#sh ip bgp
http://bbs.hh010.com
Network
Next Hop
*> 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
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
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
http://bbs.hh010.com
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
*> 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
*> 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
*> 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
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
*> 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
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
shutdown
r4(config-router)#no neighbor 2.2.2.2 shutdown
r4(config-router)#
*Mar
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
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
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
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
http://bbs.hh010.com
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
r1#
R1 44.4.4.0/24
4 R4 11.1.1.0/24
http://bbs.hh010.com
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
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
*> 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
http://bbs.hh010.com
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
http://bbs.hh010.com
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
*> 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
*> 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)#router bgp 1
r1(config-router)#neighbor 2.2.2.2 route-map med in
r1(config)#router bgp 1
http://bbs.hh010.com
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
*> 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
*> 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)#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
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
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
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
*> 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
*> 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
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
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
*> 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
*> 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
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
1.IGP Loopback 0
1 OSPF
2 Loopback 0
r1#ping 2.2.2.2 source loopback 0
http://bbs.hh010.com
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 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
http://bbs.hh010.com
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)#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
Network
Next Hop
*> 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,
3 R4 BGP
r4(config)#router bgp 4
http://bbs.hh010.com
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
*> 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
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
*> 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
*> 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
*> 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
*> 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)#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
Network
Next Hop
*> 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
*> 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
*> 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
*> 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
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
*> 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
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
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
nonexist map
advertise map
BGP IOS
http://bbs.hh010.com
BGP
BGP
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
*> 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
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)#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
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
*> 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
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
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
1.IGP Loopback 0
IGP OSPF Loopback 0 Loopback 0
BGP
1 Loopback 0
r1#ping 2.2.2.2 source loopback 0
http://bbs.hh010.com
http://bbs.hh010.com
Loopback 0
2. Peer Group R1
http://bbs.hh010.com
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
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
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
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
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
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 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
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
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
*> 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
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
0 5 i
r4#
R4 R5 community
5 R4 community
http://bbs.hh010.com
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
*> 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
*>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
*> 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
http://bbs.hh010.com
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
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
Network
Next Hop
*> 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
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
Network
Next Hop
*> 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
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
*> 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
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
Network
Next Hop
*> 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
http://bbs.hh010.com
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
2 Community AS:NN
r4(config)#ip bgp-community new-format
r5(config)#ip bgp-community new-format
http://bbs.hh010.com
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
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
*> 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
*> 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
*> 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
*> 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 )
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
client client
client client client
http://bbs.hh010.com
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
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
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
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
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
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
*> 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
*>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
Network
Next Hop
*>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
*>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
*>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
*> 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
Network
Next Hop
*>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
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
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
*>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
Network
Next Hop
*>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
Network
Next Hop
*>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
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
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
1.IGP Loopback 0
1 OSPF
2 Loopback 0
r5#ping 1.1.1.1 source loopback 0
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
http://bbs.hh010.com
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
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
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
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
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
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
5 i
*>
0 5 i
r1#
R1 BGP
AS R1 R2 eBGP
3 R2 R1
r2(config)#router bgp 64513
http://bbs.hh010.com
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
*> 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
5 i
*>
0 5 i
r1#
R1 R5 55.5.5.0/24 S0/0
2 R1 55.5.5.0/24
AS_Path
http://bbs.hh010.com
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
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
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
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
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
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
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
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
O
B
http://bbs.hh010.com
r1#
R1 33.0.0.0 R2
4 R1 33.0.0.0
r1#traceroute 33.3.3.3
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
2 R1 EIGRP
r1#sh ip eigrp topology
IP-EIGRP Topology Table for AS(100)/ID(1.1.1.1)
http://bbs.hh010.com
R1 R3 33.0.0.0
5. BGP
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
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
http://bbs.hh010.com
r1#
R1 33.0.0.0 R3
4 R1 33.0.0.0
r1#traceroute 33.3.3.3
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
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
1.IGP Loopback 0
2. BGP
1 R1 BGP
r1(config)#router bgp 1
http://bbs.hh010.com
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
*> 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
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
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
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
*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
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
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
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
Network
Next Hop
*> 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
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
*> 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
D EX
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
D EX
D EX
http://bbs.hh010.com
r4#
iBGP IGP
BGP IGP
R4 EIGRP BGP
http://bbs.hh010.com