Beruflich Dokumente
Kultur Dokumente
AS 1
accept
announce
announce
incoming
routing information
packets
accept
AS2
Route types
Static Routes
manually configured
Interior Routes
routes within an AS routes learnt by an IGP
Exterior Routes
Learnt by an EGP routes not belonging to the local AS
Basic Principles
A C
AS 100
B
Session
D
AS 101
AS 102
Vocabulary
Neighbor NLRI
NLRI - network layer reachability information Information concerning the accessibility (or not) of a remote network
Router-ID
Multiple possible paths to reach a network Attributes configuration (policy) permit to define the best one (main difference with IGP where an algorithm decides)
BGP Sessions
A C
AS 100
220.220.8.0/24
AS 101
220.220.16.0/24
BGP Routers called peers or neighbors Session between 2 different AS = External BGP
AS 102
220.220.32.0/24
Sessions BGP
A C
AS 100
220.220.8.0/24
AS 101
220.220.16.0/24
internal peers
E
AS 102
220.220.32.0/24
Sessions BGP
A C
AS 100
220.220.8.0/24
AS 101
220.220.16.0/24
AS 102
220.220.32.0/24
AS 101
.2
220.220.8.0/24
.1
.2
.1
220.220.16.0/24
.1
interface Serial 0 ip address 222.222.10.2 255.255.255.252 router bgp 100 network 220.220.8.0 mask 255.255.255.0 neighbor 222.222.10.1 remote-as 101
AS 101
Session TCP iBGP
.1
.2
220.220.8.0/24
.2
.1
.2
220.220.16.0/24
.1
interface Serial 1 ip address 220.220.16.2 255.255.255.252 router bgp 101 network 220.220.16.0 mask 255.255.255.0 neighbor 220.220.16.1 remote-as 101
interface Serial 1 ip address 222.220.16.1 255.255.255.252 router bgp 101 network 220.220.16.0 mask 255.255.255.0 neighbor 220.220.16.2 remote-as 101
C
Connection TCP/IP iBGP
Each iBGP router must establish a session with all other iBGP routers of the same AS
215.10.7.1
AS 100
215.10.7.2
215.10.7.3
AS 100
215.10.7.2
215.10.7.3
C interface loopback 0 ip address 215.10.7.1 255.255.255.255 router bgp 100 network 220.220.1.0 neighbor 215.10.7.2 remote-as 100 neighbor 215.10.7.2 update-source loopback0 neighbor 215.10.7.3 remote-as 100 neighbor 215.10.7.3 update-source loopback0
For iBGP, you might want to allow your BGP connections to stay up regardless of which interface is used to reach a neighbor. To enable this configuration, you first configure a loopback interface and assign it an IP address. Next, configure the BGP update source to be the loopback interface. Finally, configure your neighbor to use the address on the loopback interface. Now the iBGP session will be up as long as there is a route, regardless of any interface.
Attribute Next-Hop
AS 300 AS 200
150.10.0.0/16 B
.2 192.10.1.0/30
140.10.0.0/16
.2
.1
D E
Path 100
.1
AS 100
160.10.0.0/16
Message BGP
Attribute Next-Hop
AS 300 AS 200
150.10.0.0/16
B
.2 192.10.1.0/30
140.10.0.0/16
.2
.1
D E
.1
AS 100
160.10.0.0/16
Message BGP
Attribute Next-Hop
AS 300 AS 200
150.10.0.0/16
B
.2 192.10.1.0/30
140.10.0.0/16
.2
.1
D E
.1
AS 100
160.10.0.0/16
Message BGP
AS 321
192.168.10.0/24
Message BGP
.2
Connection failure
192.192.25.0/24
Network Next-Hop Path 150.10.0.0/16 192.168.10.2 321 200 192.192.25.0/24 192.168.10.2 321
BGP RIB
BGP RIB Network Next-Hop *>i160.10.1.0/24 192.20.2.2 *>i160.10.3.0/24 192.20.2.2 Path i i
D D D R S
router bgp 100 network 160.10.1.0 255.255.255.0 network 160.10.3.0 255.255.255.0 no auto-summary
the command BGP network is used to fill the BGP RIB from the routing table (2 conditions)
BGP RIB
BGP RIB Network Next-Hop *> 160.10.0.0/16 192.20.2.2 s> 160.10.1.0/24 192.20.2.2 s> 160.10.3.0/24 192.20.2.2 Path i i i
router bgp 100 network 160.10.0.0 255.255.0.0 aggregate-address 160.10.0.0 255.255.0.0 summary-only no auto-summary
D D D R S 10.1.2.0/24 160.10.1.0/24 160.10.3.0/24 153.22.0.0/16 192.1.1.0/24
The command BGP aggregateaddress permit to insert in the BGP RIB an aggregated route if at least one subnetwork exists in the routing table
Routing Table
BGP RIB
Network Next-Hop Path
* i
*> 192.1.1.0/24
192.20.2.2
192.20.2.2
i
i
BGP RIB
D D D R S
router bgp 100 network 160.10.0.0 255.255.0.0 redistribute static route-map foo no auto-summary access-list 1 permit 192.1.1.0 0.0.0.255 route-map foo permit 10 match ip address 1
Route Table
No mistake ??
BGP RIB
Network Next-Hop Path
* i
*> 192.1.1.0/24
192.20.2.2
192.20.2.2
i
?
BGP RIB
D D D R S
router bgp 100 network 160.10.0.0 255.255.0.0 redistribute static route-map foo no auto-summary access-list 1 permit 192.1.0.0 0.0.255.255 route-map foo permit 10 match ip address 1
Route Table
BGP RIB
Process IN BGP RIB Network Next-Hop *>i160.10.1.0/24 192.20.2.2 *>i160.10.3.0/24 192.20.2.2 *>173.21.0.0/16 192.20.2.1 Process Out Path i i 100
Message
Message
Path 100
BGP RIB
Process IN
Network *>i160.10.1.0/24 *>i160.10.3.0/24 *> 173.21.0.0/16
BGP RIB
Next-Hop 192.20.2.2 192.20.2.2 192.20.2.1 Path i i 100
Process OUT
Message
Message
BGP RIB
BGP RIB
Network *>i160.10.1.0/24 *>i160.10.3.0/24 *> 173.21.0.0/16 Next-Hop 192.20.2.2 192.20.2.2 192.20.2.1 Path i i 100
Result of process in
D D D R S B
This line is inserted in the routing table if unique or The distance is the lowest for this network
Routing Table
BGP Command
Configuration router bgp <AS-number> neighbor <ip address> remote-as <as-number> no auto-summary:Disables automatic network summarization. Consultation show ip bgp summary show ip bgp neighbors
redistribute static
Example
router bgp 109 redistribute static ip route 198.10.4.0 255.255.254.0 serial0
Redistribute risk
Very strict Control needed with the use of route-maps
Local Preference
AS 100
160.10.0.0/16
AS 200
D
500
800
AS 300
E
AS 400
C
Multi-Exit Discriminator
Permit to transport relative preferences between exit points The path with the lowest MED is chosen
AS 200
C
192.68.1.0/24 2000
Selected path
192.68.1.0/24 1000
B
192.68.1.0/24
AS 201
Administrative Distance
Routes can be learnt by different routing protocols
classification
Attributes classification
All attributes are classified from highest priority to lowest priority
Synchronization
IOS Cisco Specific : a BGP router will not announce a route if each router of its AS has not previously learnt it by the IGP
Synchronization
1880
C OSPF
35.0.0.0/8 209
D
690
C is not a BGP speaker A will not announce 35.0.0.0/8 to D if it has not learnt this network by its own IGP We can deactivate synchronization to supress this condition:
We want to be sure that C will be able to route usefull data to network 35.0.0.0 !!
Any route permitted in 192.0.0.0/8, except /25, /26, /27, /28, /29, /30, /31 and /32
All is accepted from neighbor except 218.10.0.0 We only send our network to the neighbor
Filter list
ip as-path access-list 1 permit 3561 ip as-path access-list 2 deny 35 ip as-path access-list 2 permit any router bgp neighbor neighbor neighbor 100 171.69.233.33 remote-as 33 171.69.233.33 filter-list 1 in 171.69.233.33 filter-list 2 out
Set
AS-path prepend Local-Preference MED Origin ...
Regular expression
[]
Matches the characters or a range of characters separated by a hyphen, within left and right square brackets.
Matches zero or one occurrence of the pattern. (Precede the question mark with Ctrl-V sequence to prevent it from being interpreted as a help command.)
Route Map:Example
configuration with AS-PATH prepend
router bgp 300 network 215.7.0.0 neighbor 2.2.2.2 remote-as 100 neighbor 2.2.2.2 route-map SETPATH out route-map SETPATH permit 10 set as-path prepend 300 300
Stub AS
B A
AS 101
ISP
AS 100
Client
stub AS
Default Route to the ISP ISP announce your networks ISP policy is your policy
AS multi-homed
AS 100
ISP
AS 300
A B C D
ISP
AS 200
client
ISP AS
AS 100
A
B C
AS 200
AS 300
D
FAI
E
AS 400