Você está na página 1de 4

Previous: Dump BGP packets and table, Up: BGP

10.16 BGP Configuration Examples


Example of a session to an upstream, advertising only one prefix to it.
r out er bgp 64512
bgp r out er - i d 10. 236. 87. 1
net wor k 10. 236. 87. 0/ 24
nei ghbor upst r eampeer - gr oup
nei ghbor upst r eamr emot e- as 64515
nei ghbor upst r eamcapabi l i t y dynami c
nei ghbor upst r eampr ef i x- l i st pl - al l owed- adv out
nei ghbor 10. 1. 1. 1 peer - gr oup upst r eam
nei ghbor 10. 1. 1. 1 descr i pt i on ACME I SP
!
i p pr ef i x- l i st pl - al l owed- adv seq 5 per mi t 82. 195. 133. 0/ 25
i p pr ef i x- l i st pl - al l owed- adv seq 10 deny any

A more complex example. With upstream, peer and customer sessions. Advertising global prefixes and
NO_EXPORT prefixes and providing actions for customer routes based on community values. Extensive use
of route-maps and the 'call' feature to support selective advertising of prefixes. This example is intended as
guidance only, it has NOT been tested and almost certainly containts silly mistakes, if not serious flaws.
r out er bgp 64512
bgp r out er - i d 10. 236. 87. 1
net wor k 10. 123. 456. 0/ 24
net wor k 10. 123. 456. 128/ 25 r out e- map r m- no- expor t
nei ghbor upst r eamcapabi l i t y dynami c
nei ghbor upst r eamr out e- map r m- upst r eam- out out
nei ghbor cust capabi l i t y dynami c
nei ghbor cust r out e- map r m- cust - i n i n
nei ghbor cust r out e- map r m- cust - out out
nei ghbor cust send- communi t y bot h
nei ghbor peer capabi l i t y dynami c
nei ghbor peer r out e- map r m- peer - i n i n
nei ghbor peer r out e- map r m- peer - out out
nei ghbor peer send- communi t y bot h
nei ghbor 10. 1. 1. 1 r emot e- as 64515
nei ghbor 10. 1. 1. 1 peer - gr oup upst r eam
nei ghbor 10. 2. 1. 1 r emot e- as 64516
nei ghbor 10. 2. 1. 1 peer - gr oup upst r eam
nei ghbor 10. 3. 1. 1 r emot e- as 64517
nei ghbor 10. 3. 1. 1 peer - gr oup cust - def aul t
nei ghbor 10. 3. 1. 1 descr i pt i on cust omer 1
nei ghbor 10. 3. 1. 1 pr ef i x- l i st pl - cust 1- net wor k i n
nei ghbor 10. 4. 1. 1 r emot e- as 64518
nei ghbor 10. 4. 1. 1 peer - gr oup cust
nei ghbor 10. 4. 1. 1 pr ef i x- l i st pl - cust 2- net wor k i n
nei ghbor 10. 4. 1. 1 descr i pt i on cust omer 2
nei ghbor 10. 5. 1. 1 r emot e- as 64519
nei ghbor 10. 5. 1. 1 peer - gr oup peer
nei ghbor 10. 5. 1. 1 pr ef i x- l i st pl - peer 1- net wor k i n
nei ghbor 10. 5. 1. 1 descr i pt i on peer AS 1
nei ghbor 10. 6. 1. 1 r emot e- as 64520
nei ghbor 10. 6. 1. 1 peer - gr oup peer
nei ghbor 10. 6. 1. 1 pr ef i x- l i st pl - peer 2- net wor k i n
nei ghbor 10. 6. 1. 1 descr i pt i on peer AS 2
!
BGP Configuration Examples - Untitled http://www.nongnu.org/quagga/docs/docs-multi/BGP-Configuration-Exam...
1 de 4 17/02/2014 09:27 a.m.
i p pr ef i x- l i st pl - def aul t per mi t 0. 0. 0. 0/ 0
!
i p pr ef i x- l i st pl - upst r eam- peer s per mi t 10. 1. 1. 1/ 32
i p pr ef i x- l i st pl - upst r eam- peer s per mi t 10. 2. 1. 1/ 32
!
i p pr ef i x- l i st pl - cust 1- net wor k per mi t 10. 3. 1. 0/ 24
i p pr ef i x- l i st pl - cust 1- net wor k per mi t 10. 3. 2. 0/ 24
!
i p pr ef i x- l i st pl - cust 2- net wor k per mi t 10. 4. 1. 0/ 24
!
i p pr ef i x- l i st pl - peer 1- net wor k per mi t 10. 5. 1. 0/ 24
i p pr ef i x- l i st pl - peer 1- net wor k per mi t 10. 5. 2. 0/ 24
i p pr ef i x- l i st pl - peer 1- net wor k per mi t 192. 168. 0. 0/ 24
!
i p pr ef i x- l i st pl - peer 2- net wor k per mi t 10. 6. 1. 0/ 24
i p pr ef i x- l i st pl - peer 2- net wor k per mi t 10. 6. 2. 0/ 24
i p pr ef i x- l i st pl - peer 2- net wor k per mi t 192. 168. 1. 0/ 24
i p pr ef i x- l i st pl - peer 2- net wor k per mi t 192. 168. 2. 0/ 24
i p pr ef i x- l i st pl - peer 2- net wor k per mi t 172. 16. 1/ 24
!
i p as- pat h access- l i st asp- own- as per mi t ^$
i p as- pat h access- l i st asp- own- as per mi t _64512_
!
! #################################################################
! Mat ch communi t i es we pr ovi de act i ons f or , on r out es r ecei ves f r om
! cust omer s. Communi t i es val ues of <our - ASN>: X, wi t h X, have act i ons:
!
! 100 - bl ackhol e t he pr ef i x
! 200 - set no_expor t
! 300 - adver t i se onl y t o ot her cust omer s
! 400 - adver t i se onl y t o upst r eams
! 500 - set no_expor t when adver t i si ng t o upst r eams
! 2X00 - set l ocal _pr ef er ence t o X00
!
! bl ackhol e t he pr ef i x of t he r out e
i p communi t y- l i st st andar d cm- bl ackhol e per mi t 64512: 100
!
! set no- expor t communi t y bef or e adver t i si ng
i p communi t y- l i st st andar d cm- set - no- expor t per mi t 64512: 200
!
! adver t i se onl y t o ot her cust omer s
i p communi t y- l i st st andar d cm- cust - onl y per mi t 64512: 300
!
! adver t i se onl y t o upst r eams
i p communi t y- l i st st andar d cm- upst r eam- onl y per mi t 64512: 400
!
! adver t i se t o upst r eams wi t h no- expor t
i p communi t y- l i st st andar d cm- upst r eam- noexpor t per mi t 64512: 500
!
! set l ocal - pr ef t o l east si gni f i cant 3 di gi t s of t he communi t y
i p communi t y- l i st st andar d cm- pr ef mod- 100 per mi t 64512: 2100
i p communi t y- l i st st andar d cm- pr ef mod- 200 per mi t 64512: 2200
i p communi t y- l i st st andar d cm- pr ef mod- 300 per mi t 64512: 2300
i p communi t y- l i st st andar d cm- pr ef mod- 400 per mi t 64512: 2400
i p communi t y- l i st expanded cme- pr ef mod- r ange per mi t 64512: 2. . .
!
! I nf or mat i onal communi t i es
!
! 3000 - l ear ned f r omupst r eam
! 3100 - l ear ned f r omcust omer
! 3200 - l ear ned f r ompeer
!
i p communi t y- l i st st andar d cm- l ear nt - upst r eamper mi t 64512: 3000
i p communi t y- l i st st andar d cm- l ear nt - cust per mi t 64512: 3100
i p communi t y- l i st st andar d cm- l ear nt - peer per mi t 64512: 3200
BGP Configuration Examples - Untitled http://www.nongnu.org/quagga/docs/docs-multi/BGP-Configuration-Exam...
2 de 4 17/02/2014 09:27 a.m.
!
! ###################################################################
! Ut i l i t y r out e- maps
!
! These ut i l i t y r out e- maps gener al l y shoul d not used t o per mi t / deny
! r out es, i . e. t hey do not have meani ng as f i l t er s, and hence pr obabl y
! shoul d be used wi t h ' on- mat ch next ' . These al l f i ni sh wi t h an empt y
! per mi t ent r y so as not i nt er f er e wi t h pr ocessi ng i n t he cal l er .
!
r out e- map r m- no- expor t per mi t 10
set communi t y addi t i ve no- expor t
r out e- map r m- no- expor t per mi t 20
!
r out e- map r m- bl ackhol e per mi t 10
descr i pt i on bl ackhol e, up- pr ef and ensur e i t cant escape t hi s AS
set i p next - hop 127. 0. 0. 1
set l ocal - pr ef er ence 10
set communi t y addi t i ve no- expor t
r out e- map r m- bl ackhol e per mi t 20
!
! Set l ocal - pr ef as r equest ed
r out e- map r m- pr ef mod per mi t 10
mat ch communi t y cm- pr ef mod- 100
set l ocal - pr ef er ence 100
r out e- map r m- pr ef mod per mi t 20
mat ch communi t y cm- pr ef mod- 200
set l ocal - pr ef er ence 200
r out e- map r m- pr ef mod per mi t 30
mat ch communi t y cm- pr ef mod- 300
set l ocal - pr ef er ence 300
r out e- map r m- pr ef mod per mi t 40
mat ch communi t y cm- pr ef mod- 400
set l ocal - pr ef er ence 400
r out e- map r m- pr ef mod per mi t 50
!
! Communi t y act i ons t o t ake on r ecei pt of r out e.
r out e- map r m- communi t y- i n per mi t 10
descr i pt i on check f or bl ackhol i ng, no poi nt cont i nui ng i f i t mat ches.
mat ch communi t y cm- bl ackhol e
cal l r m- bl ackhol e
r out e- map r m- communi t y- i n per mi t 20
mat ch communi t y cm- set - no- expor t
cal l r m- no- expor t
on- mat ch next
r out e- map r m- communi t y- i n per mi t 30
mat ch communi t y cme- pr ef mod- r ange
cal l r m- pr ef mod
r out e- map r m- communi t y- i n per mi t 40
!
! #####################################################################
! Communi t y act i ons t o t ake when adver t i si ng a r out e.
! These ar e f i l t er i ng r out e- maps,
!
! Deny cust omer r out es t o upst r eamwi t h cust - onl y set .
r out e- map r m- communi t y- f i l t - t o- upst r eamdeny 10
mat ch communi t y cm- l ear nt - cust
mat ch communi t y cm- cust - onl y
r out e- map r m- communi t y- f i l t - t o- upst r eamper mi t 20
!
! Deny cust omer r out es t o ot her cust omer s wi t h upst r eam- onl y set .
r out e- map r m- communi t y- f i l t - t o- cust deny 10
mat ch communi t y cm- l ear nt - cust
mat ch communi t y cm- upst r eam- onl y
r out e- map r m- communi t y- f i l t - t o- cust per mi t 20
!
BGP Configuration Examples - Untitled http://www.nongnu.org/quagga/docs/docs-multi/BGP-Configuration-Exam...
3 de 4 17/02/2014 09:27 a.m.
! ###################################################################
! The t op- l evel r out e- maps appl i ed t o sessi ons. Fur t her ent r i es coul d
! be added obvi ousl y. .
!
! Cust omer s
r out e- map r m- cust - i n per mi t 10
cal l r m- communi t y- i n
on- mat ch next
r out e- map r m- cust - i n per mi t 20
set communi t y addi t i ve 64512: 3100
r out e- map r m- cust - i n per mi t 30
!
r out e- map r m- cust - out per mi t 10
cal l r m- communi t y- f i l t - t o- cust
on- mat ch next
r out e- map r m- cust - out per mi t 20
!
! Upst r eamt r ansi t ASes
r out e- map r m- upst r eam- out per mi t 10
descr i pt i on f i l t er cust omer pr ef i xes whi ch ar e mar ked cust - onl y
cal l r m- communi t y- f i l t - t o- upst r eam
on- mat ch next
r out e- map r m- upst r eam- out per mi t 20
descr i pt i on onl y cust omer r out es ar e pr ovi ded t o upst r eams/ peer s
mat ch communi t y cm- l ear nt - cust
!
! Peer ASes
! out bound pol i cy i s same as f or upst r eam
r out e- map r m- peer - out per mi t 10
cal l r m- upst r eam- out
!
r out e- map r m- peer - i n per mi t 10
set communi t y addi t i ve 64512: 3200
BGP Configuration Examples - Untitled http://www.nongnu.org/quagga/docs/docs-multi/BGP-Configuration-Exam...
4 de 4 17/02/2014 09:27 a.m.

Você também pode gostar