一.要求
1.如图连接网络,合理规格IP地址,AS200内IGP协议为OSPF
2.R1属于AS 100:R2-R3-R4小AS 234 R5-R6-R7/AS567,同时声明大AS 200,R8属AS300
3.R2-R5 R4-R7之间为联邦EBGP邻居关系
4.R1-R8之间通信
二.配置过程
1.配置ip
R1
[R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[R1-LoopBack0]ip add 1.1.1.1 32
R2
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[R2-GigabitEthernet0/0/1]ip add 12.1.1.2 24
[R2-GigabitEthernet0/0/2]ip add 25.1.1.2 24
R3
[R3-GigabitEthernet0/0/0]ip add 34.1.1.3 24
[R3-GigabitEthernet0/0/1]ip add 23.1.1.3 24
[R3-LoopBack0]ip add 3.3.3.3 32
R4
[R4-GigabitEthernet0/0/1]ip add 34.1.1.4 24
[R4-GigabitEthernet0/0/2]ip add 47.1.1.4 24
[R4-LoopBack0]ip add 4.4.4.4 32
R5
[R5-GigabitEthernet0/0/0]ip add 56.1.1.5 24
[R5-GigabitEthernet0/0/2]ip add 25.1.1.5 24
[R5-LoopBack0]ip add 5.5.5.5 32
R6
[R6-GigabitEthernet0/0/0]ip add 67.1.1.6 24
[R6-GigabitEthernet0/0/1]ip add 56.1.1.6 24
[R6-LoopBack0]ip add 6.6.6.6 32
R7
[R7-GigabitEthernet0/0/0]ip add 78.1.1.7 24
[R7-GigabitEthernet0/0/1]ip add 67.1.1.7 24
[R7-GigabitEthernet0/0/2]ip add 47.1.1.7 24
[R7-LoopBack0]ip add 7.7.7.7 32
R8
[R8-GigabitEthernet0/0/1]ip add 78.1.1.8 24
[R8-LoopBack0]ip add 8.8.8.8 32
2.AS200内IGP协议为OSPF
[R2]ospf 100 router-id 2.2.2.2
[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-100-area-0.0.0.0]network 23.1.1.2 0.0.0.0
[R2-ospf-100-area-0.0.0.0]network 25.1.1.2 0.0.0.0
[R3-ospf-100-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[R4-ospf-100-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[R5-ospf-100-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[R6-ospf-100-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[R7]ospf 100 router-id 7.7.7.7
[R7-ospf-100]area 0
[R7-ospf-100-area-0.0.0.0]network 67.1.1.7 0.0.0.0
[R7-ospf-100-area-0.0.0.0]network 47.1.1.7 0.0.0.0
[R7-ospf-100-area-0.0.0.0]network 7.7.7.7 0.0.0.0
三.R1属于AS 100;R2-R3-R4小AS 234 R5-R6-R7/AS567,同时声明大AS 200;R8属AS300
R1
[R1]bgp 100
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.1.1.2 as-number 200
R2
[R2]bgp 234
[R2-bgp]router-id 2.2.2.2
[R2-bgp]confederation id 200
[R2-bgp]confederation peer-as 567
[R2-bgp]peer 12.1.1.1 as-number 100
[R2-bgp]peer 3.3.3.3 as-number 234
[R2-bgp]peer 3.3.3.3 connect-interface LoopBack0
[R2-bgp]peer 5.5.5.5 as-number 567
[R2-bgp]peer 5.5.5.5 connect-interface LoopBack0
[R2-bgp]peer 5.5.5.5 ebgp-max-hop
R3
[R3]bgp 234
[R3-bgp]router-id 3.3.3.3
[R3-bgp]confederation id 200
[R3-bgp]peer 2.2.2.2 as-number 234
[R3-bgp]peer 2.2.2.2 connect-interface LoopBack0
[R3-bgp]peer 4.4.4.4 as-number 234
[R3-bgp]peer 4.4.4.4 connect-interface LoopBack0
R4
[R4]bgp 234
[R4-bgp]confederation id 200
[R4-bgp]confederation peer-as 567
[R4-bgp]peer 3.3.3.3 as-number 234
[R4-bgp]peer 3.3.3.3 connect-interface loopback0
[R4-bgp]peer 7.7.7.7 as-number 567
[R4-bgp]peer 7.7.7.7 connect-interface loopback0
[R4-bgp]peer 7.7.7.7 ebgp-max-hop
R5
[R5]bgp 567
[R5-bgp]router-id 5.5.5.5
[R5-bgp]confederation id 200
[R5-bgp]confederation peer-as 234
[R5-bgp]peer 2.2.2.2 as-number 234
[R5-bgp]peer 2.2.2.2 connect-interface loopback0
[R5-bgp]peer 2.2.2.2 ebgp-max-hop
[R5-bgp]peer 6.6.6.6 as-number 567
[R5-bgp]peer 6.6.6.6 connect-interface loopback0
R6
[R6]bgp 567
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 200
[R6-bgp]peer 5.5.5.5 as-number 567
[R6-bgp]peer 5.5.5.5 connect-interface loopback0
[R6-bgp]peer 7.7.7.7 as-number 567
[R6-bgp]peer 7.7.7.7 connect-interface loopback0
R7
[R7]bgp 567
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 200
[R7-bgp]confederation peer-as 234
[R7-bgp]peer 6.6.6.6 as-number 567
[R7-bgp]peer 6.6.6.6 connect-interface loopback0
[R7-bgp]peer 4.4.4.4 as-number 234
[R7-bgp]peer 4.4.4.4 connect-interface loopback0
[R7-bgp]peer 4.4.4.4 ebgp-max-hop
[R7-bgp]peer 78.1.1.8 as-number 300
R8
[R8]bgp 300
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.1.1.7 as-number 200
四.R1-R8之间通信
R1
[R1-bgp]import-route direct
R2
[R2-bgp]import-route ospf 1
[R2-bgp]peer 3.3.3.3 next-hop-local
[R2-bgp]import-route direct
R3
[R3-bgp]peer 2.2.2.2 reflect-client
[R3-bgp]peer 4.4.4.4 reflect-client
R4
[R4-bgp]peer 3.3.3.3 next-hop-local
R5
[R5-bgp]peer 6.6.6.6 next-hop-local
R6
[R6-bgp]peer 5.5.5.5 reflect-client
[R6-bgp]peer 7.7.7.7 reflect-client
R7
[R7-bgp]import-route ospf 1
[R7-bgp]peer 6.6.6.6 next-hop-local
[R7-bgp]import-route direct
R8
[R8-bgp]import-route direct