HCIP course summary

HCIP course summary (15)

BGP comprehensive experiment

Claim:
Insert picture description here

1. Establish topology and assign ip

Insert picture description here

2. Test
AR11:

Insert picture description here
AR12:
Insert picture description here
AR13: Other omissions
Insert picture description here
;

3. Start the IBGP protocol
AR2:
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

AR3 to AR9, AR11 to AR13, similar, only router-id is different; (omitted)

Lookup table:

Insert picture description here

Insert picture description here

Insert picture description here

Insert picture description here

Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here

Insert picture description here
Routing table query:
Insert picture description here

Insert picture description here
Insert picture description here

If there is no user network segment, you can use the following command to achieve the goal:
[r2]interface LoopBack 0
[r2-LoopBack1]ospf network-type broadcast

Note: AR2 to AR9 and AR11 to AR13 need to be modified;
Insert picture description here

4、MPLS
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Insert picture description here

Query neighbors:
Insert picture description here
Insert picture description here
Insert picture description here

5、启动BGP
AR1:
[r1]bgp 1
[r1-bgp]peer 12.1.1.2 as-number 2
[r1-bgp]peer 16.1.1.2 as-number 2

AR2:
bgp 64512
router-id 2.2.2.2
confederation id 2
peer 12.1.1.1 as-number 1
peer 172.16.1.3 as-number 64512
peer 172.16.1.3 connect-interface LoopBack0
peer 172.16.1.6 as-number 64512
peer 172.16.1.6 connect-interface LoopBack0

AR3:
bgp 64512
router-id 3.3.3.3
confederation id 2
peer 172.16.1.2 as-number 64512
peer 172.16.1.2 connect-interface LoopBack0
peer 172.16.1.4 as-number 64512
peer 172.16.1.4 connect-interface LoopBack0

AR4:
bgp 64512
router-id 4.4.4.4
confederation id 2
confederation peer-as 64513
peer 172.16.1.3 as-number 64512
peer 172.16.1.3 connect-interface LoopBack0
peer 172.16.1.5 as-number 64513
peer 172.16.1.5 ebgp-max-hop 255
peer 172.16.1.5 connect-interface LoopBack0

AR5:
bgp 64513
router-id 5.5.5.5
confederation id 2
confederation peer-as 64512
peer 51.1.1.2 as-number 3
peer 172.16.1.4 as-number 64512
peer 172.16.1.4 ebgp-max-hop 255
peer 172.16.1.4 connect-interface LoopBack0
peer 172.16.1.9 as-number 64513
peer 172.16.1.9 connect-interface LoopBack0

AR6:
bgp 64512
router-id 6.6.6.6
confederation id 2
peer 172.16.1.2 as-number 64512
peer 172.16.1.2 connect-interface LoopBack0
peer 172.16.1.7 as-number 64512
peer 172.16.1.7 connect-interface LoopBack0

AR7:
bgp 64512
router-id 7.7.7.7
confederation id 2
peer 172.16.1.6 as-number 64512
peer 172.16.1.6 connect-interface LoopBack0
peer 172.16.1.8 as-number 64512
peer 172.16.1.8 connect-interface LoopBack0

AR8:
bgp 64512
router-id 8.8.8.8
confederation id 2
confederation peer-as 64513
peer 172.16.1.7 as-number 64512
peer 172.16.1.7 connect-interface LoopBack0
peer 172.16.1.9 as-number 64513
peer 172.16.1.9 ebgp-max-hop 255
peer 172.16.1.9 connect-interface LoopBack0

AR9:
bgp 64513
router-id 9.9.9.9
confederation id 2
confederation peer-as 64512
peer 91.1.1.1 as-number 3
peer 91.1.1.2 as-number 3
peer 172.16.1.5 as-number 64513
peer 172.16.1.5 connect-interface LoopBack0
peer 172.16.1.8 as-number 64512
peer 172.16.1.8 ebgp-max-hop 255
peer 172.16.1.8 connect-interface LoopBack0

AR10:
bgp 3
router-id 10.10.10.10
peer 51.1.1.1 as-number 2
peer 91.1.1.1 as-number 2

Lookup table:
Insert picture description here

Insert picture description here

Insert picture description here
Insert picture description here

Insert picture description here

6、宣告
AR1:
[r1]bgp 1
[r1-bgp]network 1.1.1.0 24

Check the table: you
Insert picture description here
Insert picture description here
can see that AR3 is not good, just modify the next hop:
AR2:

[r2]bgp 64512
[r2-bgp]peer 172.16.1.3 next-hop-local
[r2-bgp]peer 172.16.1.6 next-hop-local

Searched again:
Insert picture description here
success Insert picture description here
for AR6, the same need to modify the next hop to AR7 preferably:
AR6:
[R6] BGP 64512
[BGP-R6] Use the peer 172.16.1.2 Next-Hop-local
[BGP-R6] Next Use the peer 172.16.1.7 -hop-local

Lookup table:
Insert picture description here
success

Look up table AR4:
Insert picture description here

It can be seen that because the ibgp cannot pass routes indirectly, it can be solved by using a reflector:
AR3:
[r3]bgp 64512
[r3-bgp]peer 172.16.1.2 reflect-client

Similarly, the reflector needs to be adjusted on AR7:
AR7:

[r7]bgp 64512
[r7-bgp]peer 172.16.1.8 reflect-client

Lookup table:
Insert picture description here
Insert picture description here
success

Check the table again:
AR5:
Insert picture description here
AR9:
Insert picture description here

Declaration AR10:
AR10:
[r10] bgp 3
[r10-bgp] network 10.10.10.0 24

For the same reason, AR4 and AR8 are not good, just modify the next hop:
AR5:
[r5]bgp 64513
[r5-bgp]peer 172.16.1.4 next-hop-local
[r5-bgp]peer 172.16.1.9 next-hop -local

AR9:
[r9]bgp 64513
[r9-bgp]peer 172.16.1.5 next-hop-local
[r9-bgp]peer 172.16.1.8 next-hop-local

Lookup table:
Insert picture description here

In this process, the reflectors at 3 and 7 have only one transmission opportunity. The ibgp interval does not transmit routes to each other, so AR2 and AR6 do not transmit 10.10.10.0 routes to each other;
as shown in the figure:

Insert picture description here
Insert picture description here
For backup, let 2 and 6 be reflectors:
AR2:
[r2]bgp 64512
[r2-bgp]peer 172.16.1.6 reflect-client

AR6:
[r6]bgp 64512
[r6-bgp]peer 172.16.1.2 reflect-client

Lookup table:
Insert picture description here
Insert picture description here

test:
Insert picture description here

Check table AR1 again:

Insert picture description here

It can be seen that the load balance is not reached;

Summary announcement:
——Null interface route announcement:

AR2:
[r2]ip route-static 172.16.0.0 255.255.0.0 NULL 0
[r2-bgp]network 172.16.0.0 16

Lookup table:
Insert picture description here

AR6:
[r6]ip route-static 172.16.0.0 16 NULL 0
[r6]bgp 64512
[r6-bgp]network 172.16.0.0 16

Lookup table:
Insert picture description here

At this time, there is a routing problem. You can advertise the required preferred route on the preferred EBGP:
AR2:
[r2]bgp 64512
[r2-bgp]network 172.16.2.0 24
[r2-bgp]network 172.16.3.0 24
[r2- bgp]network 172.16.4.0 24
[r2-bgp]network 172.16.5.0 24

AR6:
r6]bgp 64512
[r6-bgp]network 172.16.6.0 24
[r6-bgp]network 172.16.7.0 24
[r6-bgp]network 172.16.8.0 24
[r6-bgp]network 172.16.9.0 24

Lookup table:

Insert picture description here

It can be seen that it is not in line with expectations-because 2 and 6 pass routes to each other, the metric of the route passed is greater than the metric of the same route that was cleaned when passed to 1, and vice versa.
Note: It can be announced by transposition-about The routes announced to 2 and announced to 6 exchange announcements;

AR2:
[r2]bgp 64512
[r2-bgp]network 172.16.6.0 24
[r2-bgp]network 172.16.7.0 24
[r2-bgp]network 172.16.8.0 24
[r2-bgp]network 172.16.9.0 24

AR6:
[r6]BGP 64512
[r6-bgp]network 172.16.2.0 24
[r6-bgp]network 172.16.3.0 24
[r6-bgp]network 172.16.4.0 24
[r6-bgp]network 172.16.5.0 24

Lookup table:
Insert picture description here
success

Continue to declare 11,12,13:

AR2:
[r2]bgp 64512
[r2-bgp]network 172.16.11.0 24
[r2-bgp]network 172.16.12.0 24
[r2-bgp]network 172.16.13.0 24

AR6:
[r6]BGP 64512
[r6-bgp]network 172.16.11.0 24
[r6-bgp]network 172.16.12.0 24
[r6-bgp]network 172.16.13.0 24

Lookup table:

Insert picture description here

Test AR1ping AR11, 12, 13 (no connection)-11, 12, and 13 have no routes:
AR2:
[r2]ospf 1
[r2-ospf-1] default-route-advertise always

AR6:
[r6]OSPF 1
[r6-ospf-1]default-route-advertise always

AR5:
[r5]ospf 1
[r5-ospf-1]default-route-advertise always

AR9:
[r9]ospf 1
[r9-ospf-1]default-route-advertise always

Lookup table:
Insert picture description here
Insert picture description here
Insert picture description here
test:
Insert picture description here

Finish on the left

Look up the table on the right: you
Insert picture description here
can see that all AR5 is selected;

对策:
AR5:
[r5]bgp 64513
[r5-bgp]aggregate 172.16.0.0 255.255.0.0
[r5-bgp]aggregate 172.16.0.0 255.255.0.0 detail-suppressed

AR9:
[r9]bgp 64513
[r9-bgp]aggregate 172.16.0.0 255.255.0.0
[r9-bgp]aggregate 172.16.0.0 255.255.0.0 detail-suppressed (default suppression)

In this way, only the summary will be passed to AR10;

Lookup table:
Insert picture description here
Use prefix list:
AR5:

[r5]ip ip-prefix aa deny 172.16.6.0 24 (reject)
[r5]ip ip-prefix aa deny 172.16.7.0 24
[r5]ip ip-prefix aa deny 172.16.8.0 24
[r5]ip ip-prefix aa deny 172.16.9.0 24
[r5]ip ip-prefix aa permit 0.0.0.0 0 less-equal 32 (allow all)

[r5]bgp 64513
[r5-bgp]undo aggregate 172.16.0.0 255.255.0.0 detail-suppressed
[r5-bgp]aggregate 172.16.0.0 255.255.0.0
[r5-bgp]peer 51.1.1.2 ip-prefix aa export

AR9:
[r9]ip ip-prefix aa deny 172.16.2.0 24
[r9]ip ip-prefix aa deny 172.16.3.0 24
[r9]ip ip-prefix aa deny 172.16.4.0 24
[r9]ip ip-prefix aa deny 172.16.5.0 24
[r9]ip ip-prefix aa permit 0.0.0.0 0 less-equal 32

[r9]bgp 64513
[r9-bgp]undo aggregate 172.16.0.0 255.255.0.0 detail-suppressed
[r9-bgp]aggregate 172.16.0.0 255.255.0.0
[r9-bgp]peer 91.1.1.2 ip-prefix aa export

Lookup table:
Insert picture description here
success

7. Load balancing
AR1:
[r1]bgp 1
[r1-bgp]maximum load-balancing ebgp 2 (the maximum number of load paths)

AR10:
[r10]bgp 3
[r10-bgp]maximum load-balancing ebgp 2

Insert picture description here

Insert picture description here

test:
Insert picture description here
Insert picture description here
Insert picture description here

Experiment completed

Guess you like

Origin blog.csdn.net/zhuangjiu/article/details/114046539