Professional Documents
Culture Documents
BGP 学习笔记
BGP 学习笔记
>
*
r BGP
BGP
i IBGP
s / BGP
BGP
BGP EGP
EGP
BGP EGP EGP VLSM
BGP
BGP
BGPv4+ TLV
AFI
Cisco IPv4 AFI BGPv4+
IPv4 AFI
BGPv4+ Router(config-router)#no bgp default ipv4-
unicast
IPv4 AFI BGPv4+ BGP
address-family <AFI> AFI
BGP
AS
Internet
AS AS AS AS
BGP
Internet
BGP
AS
AS
Internet AS
AS
16 0 65535
AS 32 0 4294967295
0
1 64511 AS IANA IP
64512 65535 AS
AS AS
BGP AS Internet IPv4
15
AS IGP
AS
IGP
IGP IS-IS
IGP OSPF 3
BGP
IGP BGP AS
IGP
BGP AS AS
AS BGP
BGP Peer
BGP BGP Speaker
BGP
BGP
BGP BGP
BGP
network
IGP BGP
redistribute IGP /
BGP
aggregate-address BGP
/
BGP MED
BGP ECMP
BGP
Open
Keepalive
Notification
AS
/ Down
IGP Hello
BGP
BGP
BGP Idle -> Connect -> Active -> Open Sent ->
Open Confirm -> Established
BGP
Idle
TCP Connect
Open Open Sent
Active
Connect
Keepalive Open Confirm
Notification
Down Idle
Keepalive Established
Cisco
BGP
BGP TCP
BGP IP
BGP IP neighbor
IP
BGP IP
IP
IBGP
BGP IP IP
Router(config-router)#neighbor < IP> update-source
< >
Router(config-router)#neighbor < IP>
shutdown
BGP ID
ID Router(config-router)#bgp router-id <
ID>
EBGP IBGP
EBGP
AS
AS IGP
TTL 255
IGP
Down
AS IBGP
CPU
Router(config-router)#neighbor
< > peer-group
Router(config-
router)#neighbor < IP> peer-group <
>
TCP Router(config-router)#bgp
listen range <IP > peer-group <
>
AS
Router(config-router)#neighbor <
> remote-as < AS >
BGP
BGP
Router#show ip bgp < > mask < >
BGP
Router#show ip bgp
neighbors < IP> advertised-routes
Router#show ip bgp
neighbors < IP> received
Router(config-
router)#neighbor < IP> soft-reconfiguration
inbound
BGP
network BGP
BGP 0.0.0.0
network BGP
BGP
BGP 0.0.0.0
EBGP IBGP
next-hop-self
IBGP
IBGP
EBGP BGP EBGP
IBGP
IBGP EBGP IBGP
EBGP
EBGP AS Path
AS AS AS Path
AS
AS Path AS
Router(config-router)#neighbor <
IP > allowas-in [ ]
[ ] AS AS Path
prefix-list
prefix-list
Router(config-router)#neighbor < IP> prefix-list <
> in|out
BGP
BGP
BGP Full-Mesh
BGP
BGP IGP
IGP BGP
DMVPN GRE
IP
MPLS
IBGP BGP
BGP IBGP IGP
IGP
BGP
BGP Router(config-
router)#no synchronization
Cisco BGP
BGP Down
BGP
BGP
BGP
AS MA ICMP
BGP /
network
BGP 0.0.0.0
MED 0
Router(config-
router)#no auto-summary
/
/ BGP /
/ Router(config-router)#aggregate-
address < > < > [summary-only]
BGP /
summary-only
/ BGP 0.0.0.0
MED 0
suppress-
map <route-map > route-map
permit
/ AS Path
as-set
/ /
AS AS Path /
AS AS Path
AS show AS
/ Atomic Aggregate
Aggregator /
/ 30s
Router(config-router)#bgp
aggregate-timer 0
/ Null 0
/ network BGP
/
BGP
MED 0
BGP Router(config-
router)#default-information originate
BGP
MED
BGP Router(config-
router)#neighbor < IP> default-originate
BGP
BGP
BGP
AS Path AS
Next Hop
Origin
BGP
Local Preference
Atomic Aggregate
...
Community
Aggregator
...
MED
Cisco Metric
...
BGP route-map route-map
BGP
route-map
permit
route-map
Router(config-router)#neighbor < IP> route-map <route-
map > in|out
BGP
BGP
1. Weight
Weight Cisco
Weight
Weight 0 65535
BGP Weight 0
BGP Weight 32768
BGP Weight
Router(config-router)#neighbor < IP> weight
< >
route-map Router(config-route-map)#set
weight < >
2. Local Preference
IBGP Local
Preference EBGP Local
Preference
Local Preference 0 4294967295
Local Preference 100
Local Preference Router(config-
router)#bgp default local-preference < >
Local Preference AS
EBGP Local Preference
4. AS Path AS
EBGP AS Path
AS
AS Path AS AS
AS Path
AS AS
AS AS
AS Path AS
AS
AS
route-map AS Path AS
Router(config-route-map)#set as-path prepend <AS
> <AS > ...
AS Path ACL
AS Path
AS Path ACL ACL
Router(config)#ip as-path access-list <AS
Path ACL > permit|deny < >
AS Path ACL Router(config-
router)#neighbor < IP > filter-list <AS
Path ACL > in|out
AS AS EBGP AS
AS Path BGP
AS Path AS AS
Router(config-router)#neighbor < IP
> as-override
5. Origin IGP i > EGP e >
Incomplete ?
EGP EGP
Incomplete /
route-map Router(config-route-map)#set
origin igp|incomplete|egp <EGP AS >
6. MED
AS AS
AS MED AS
MED AS AS Path
MED Router(config-
router)#bgp always-compare-med
MED 0 MED AS
MED AS
EBGP MED
MED Router(config-
router)#bgp bestpath med missing-as-worst
network BGP
MED
MED 0 4294967295
Cisco MED BGP
route-map Router(config-route-map)#set metric
< >
7. EBGP
7
8. BGP IGP
9. 8
Router(config-router)#maximum-
secondary-paths [eibgp|ibgp] < >
eibgp ibgp EBGP
ibgp
IBGP
eibgp
Router(config-router)#neighbor <
IP> additional-paths send %
Router(config-router)#neighbor <
IP> additional-paths receive %
10. Uptime
11. ID
12. Cluster List Cluster List Cluster ID
Cluster List
13. IP
BGP
RR
IBGP
RR AS EBGP
Full-Mesh
IBGP EBGP
RR IBGP RR
EBGP RR IBGP RR
EBGP IBGP
IBGP IBGP
IBGP IBGP
IBGP
Router(config-router)#neighbor < IP>
route-reflector-client
RR
RR
RR RR IBGP RR
EBGP IBGP
RR RR
RR EBGP
RR
Cluster List
AS Path
RR IBGP
RR IBGP RR
Cluster ID Cluster List
RR Cluster ID
Cluster ID ID
Cluster ID Router(config-
router)#bgp cluster-id <Cluster ID>
RR Cluster ID
Originator ID ID
RR IBGP BGP
RR Originator ID BGP
Originator ID ID
Originator ID Originator ID
BGP RR RR
Confederation
AS AS AS
IBGP
AS EBGP
AS
EBGP AS
AS
EBGP ASBR
RR BGP
BGP AS AS
IGP tag
32
xx:yy
xx yy 16
Router(config)#ip bgp-
community new-format
route-map Router(config-route-map)#set
community < >
no-advertise
no-export EBGP
EBGP
local-as EBGP EBGP
MPLS VPN RT
Router(config-
router)#neighbor < IP> send-
community both|extended|standard
both extended
standard
community-list route-map
BGP
MD5 HMAC
Router(config-
router)#neighbor < IP> password < >
BGP AS
BGP AS
BGP AS
AS
Router(config-router)#neighbor < IP >
local-as < AS >
BGP
Router(config-router)#bgp additional-paths select
backup %
Router(config-router)#neighbor < IP> advertise
diverse-path backup %