1,实验题目
2,实验拓扑
3,实验需求
1、R2-7每台路由器均存在一个环回接口用于建立邻居,同时还存在一个环回来代表连接用户的接口;最终这些连接用户的接口网络需要可以和R1/8的环回通讯
2、AS2网段地址172.16.0.0/16 减路由条目数量
4,实验步骤
IP地址;
r1;
r2;
r3;
r4;
r5;
r6;
r7;
启动ospf
r2;
[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
r3;
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
r4;
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
r5;
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
r6;
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
r7;
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
BGP建邻居
r1:
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 2
r2:
[r2]bgp 64512
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]confederation peer-as 64513
[r2-bgp]peer 172.16.1.3 as-number 64512
[r2-bgp]peer 172.16.1.3 connect-interface LoopBack 1
[r2-bgp]peer 172.16.1.5 as-number 64513
[r2-bgp]peer 172.16.1.5 connect-interface LoopBack 1
[r2-bgp]peer 172.16.1.5 ebgp-max-hop 2
r3:
[r3]bgp 64512
[r3-bgp]confederation id 2
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 172.16.1.2 as-number 64512
[r3-bgp]peer 172.16.1.2 connect-interface LoopBack 1
[r3-bgp]peer 172.16.1.4 as-number 64512
[r3-bgp]peer 172.16.1.4 connect-interface LoopBack 1
r4:
[r4]bgp 64512
[r4-bgp]confederation id 2
[r4-bgp]router-id 4.4.4.4
[r4-bgp]confederation peer-as 64513
[r4-bgp]peer 172.16.1.3 as-number 64512
[r4-bgp]peer 172.16.1.3 connect-interface LoopBack 1
[r4-bgp]peer 172.16.1.7 as-number 64513
[r4-bgp]peer 172.16.1.7 connect-interface LoopBack 1
[r4-bgp]peer 172.16.1.7 ebgp-max-hop 2
r5:
[r5]bgp 64513
[r5-bgp]confederation id 2
[r5-bgp]confederation peer-as 64512
[r5-bgp]router-id 5.5.5.5
[r5-bgp]peer 172.16.1.2 as-number 64512
[r5-bgp]peer 172.16.1.2 connect-interface LoopBack 1
[r5-bgp]peer 172.16.1.2 ebgp-max-hop 2
[r5-bgp]peer 172.16.1.6 as-number 64513
[r5-bgp]peer 172.16.1.6 connect-interface LoopBack 1
r6:
[r6]bgp 64513
[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 2
[r6-bgp]peer 172.16.1.5 as-number 64513
[r6-bgp]peer 172.16.1.5 connect-interface LoopBack 1
[r6-bgp]peer 172.16.1.7 as-number 64513
[r6-bgp]peer 172.16.1.7 connect-interface LoopBack 1
r7:
[r7]bgp 64513
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation id 2
[r7-bgp]confederation peer-as 64512
[r7-bgp]peer 172.16.1.4 as-number 64512
[r7-bgp]peer 172.16.1.4 connect-interface LoopBack 1
[r7-bgp]peer 172.16.1.4 ebgp-max-hop 2
[r7-bgp]peer 172.16.1.6 as-number 64513
[r7-bgp]peer 172.16.1.6 connect-interface LoopBack 1
[r7-bgp]peer 78.1.1.2 as-number 3
r8:
[r8]bgp 3
[r8-bgp]router-id 8.8.8.8
[r8-bgp]peer 78.1.1.1 as-number 2
宣告路由;
[r1-bgp]network 1.1.1.0 24
[r2-bgp]peer 1.1.1.5 next-hop-local
[r2-bgp]peer 1.1.1.3 next-hop-local
[r7-bgp]peer 1.1.1.4 next-hop-local
[r7-bgp]peer 1.1.1.6 next-hop-local
汇总路由减少路由条目数量;
[r2]ip route-static 172.16.0.0 24 NULL 0
[r2]bgp 64512
[r2-bgp]network 172.16.0.0 24
[r7]ip route-static 172.16.0.0 24 NULL 0
[r7]bgp 64513
[r7-bgp]network 172.16.0.0 24