LAB About BGP black hole
LAB Topology
Configure
1. configure Ip address on all Routers. Test the connectivity with each neighbors
2.Configure IGP internal AS123 , here we choose EIGRP.
1 | R1 : router eigrp 100 |
3.configure IBGP
- on R2
1 | configure bgp and specify R3 as neighbor |
- on R3
1 | R3(config)#router bgp 123 |
4.Check neighbor table
R3#show ip bgp summary #this command shows bgp information about neighbors
1 | BGP router identifier 3.3.3.3, local AS number 123 ----------- router itself ID , local AS |
12.1.1.2 #neighbor’s ip address
4 #the version of neighbor’s BGP protocol
123 #neighbor’s AS number
Msgcvd /MsgSent #receive or send messages between itself and neighbor
UP/DOWN #the time of the relationship
“State” #the status of neighbor relationship . “Blank” represents to be normal
“Ffxrcd” #shows how many 前缀 (routes updates) do you receive from neighbor. in this case it is 0
5.configure EBGP
- On R2
1 | R2(config-router)#router bgp 123 |
- On R4
1 | R2(config-router)#router bgp 4 |
Check neighbor table:
1 | R2#show ip bgp summary |
- On R3
1 | R3(config)#router bgp 123 |
- On R5
1 | R5(config)#router bgp 5 |
Check neighbor table:
1 | R5#sho ip bgp summary |
6.Advertise network
1.R4 advertise its loop interface ip address:
1 | R4(config)#router bgp 4 |
Check bgp route table :
1 | R4#show ip bgp #this command is to show the bgp route table ,not ip route table |
* #valid route
network #advertise network infomation
next hop #the next equipment to reach the network 0.0.0.0 means itself
Metric,Locprf ,weight,path #some attributes of the route Path
Check it on R2
1 | R2#show ip bgp |
Check the route table on R2
1 | 12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks |
We can see a route path to 172.16.1.0 ..it shows to be a BGP route with 20 administrate distance ,the next hop is R4
Notice : EBGP admin distance is 20
IBGP admin distance is 200
Check the bgp route table on R3
1 | R3#show ip bgp |
Check the ip route table on R3
1 | 12.0.0.0/24 is subnetted, 1 subnets |
Warn : We couldn’t see BGP routes in route table
Compare with the BGP route table on R2 and R3 ,we find that:
1.there is no “>” behind “*“ on R3 BGP table .. “>” means the best route path to the destination
2.the next hop in the BGP route table on R3 is 24.1.1.4 which the ip address of the interface on R4. But apparently , this is an unreachable address for R3 ,So this BGP route couldn’t appear in route table
So we get the conclusion :
while a route from the external AS passes through the internal AS ,the information of “next hop” never changes by default
Then we need to change this situation
the best way is to let R3 know that the next hop is R2 ———in another word is when the marginal routers receive routes from other AS and pass it through the local AS, the marginal routers take themself as the next hop .Because they know how to get to the distant network
note : it is unnecessary to specify next hop self on none-marginal routers
7.implement method :
specify itself as the next hop when configure neighbor relationship :
1 | R2(config)#router bgp 123 |
Check the bgp table on R3”
1 | BGP table version is 2, local router ID is 3.3.3.3 |
the next hop changed to R2 and “>” shows it is the best route path
check the route table :
1 | 12.0.0.0/24 is subnetted, 1 subnets |
Now ,we can see the BGP route.
of course . we can see this routes update on R5 now
1 | R5#show ip bgp |
It is obviously that when R5 advertise routes updates ,we can see the same situation on R2 and R4, So I am not gonna demonstrate it .
We need to specify the next hop on R3 when he configure the neighbor relationship with R2,so that the routes update from R5 could be extended to R4
8. For now , we are done with configuring BGP .we try to send a packet from R4 to R5 ,through three AS
failed to ping R5 .check the ICMP debug information on R1 :
1 | R4#ping 192.168.1.1 source 172.16.1.1 |
1 | R1#debug ip icmp |
R1 has not the information of route about 192.168.1.0
now we run BGP protocol on R1:
1 | R3(config-router)#neighbor 13.1.1.1 remote 123 |
now ,we can see routes in routing table about R1 and R5
1 | Gateway of last resort is not set |
now R4 and R5 is pingable
1 | R4#ping 192.168.1.1 source 172.16.1.1 |