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.基础配置:
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 1.1.1.1 24
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
[R2]interface g0/0/2
[R2-GigabitEthernet0/0/2]ip address 25.1.1.1 24
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 24
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 23.1.1.2 24
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 34.1.1.1 24
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 3.3.3.3 24
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 34.1.1.2 24
[R4]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 47.1.1.1 24
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 24
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip address 25.1.1.2 24
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]ip address 56.1.1.1 24
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 5.5.5.5 24
[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip address 56.1.1.2 24
[R6]interface g0/0/1
[R6-GigabitEthernet0/0/1]ip address 67.1.1.1 24
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 6.6.6.6 24
[R7]interface g0/0/0
[R7-GigabitEthernet0/0/0]ip address 67.1.1.2 24
[R7]interface g0/0/2
[R7-GigabitEthernet0/0/2]ip address 47.1.1.2 24
[R7]interface g0/0/1
[R7-GigabitEthernet0/0/1]ip address 78.1.1.1 24
[R7]interface LoopBack 0
[R7-LoopBack0]ip address 7.7.7.7 24
[R8]interface g0/0/0
[R8-GigabitEthernet0/0/0]ip address 78.1.1.2 24
[R8]interface LoopBack 0
[R8-LoopBack0]ip address 8.8.8.8 24
2. 配置OSPF:
[R2]ospf 1 router-id 92.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 25.1.1.1 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R3]ospf 1 router-id 93.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 34.1.1.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R4]ospf 1 router-id 94.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 34.1.1.2 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 47.1.1.1 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[R5]ospf 1 router-id 95.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 25.1.1.2 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 56.1.1.1 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[R6]ospf 1 router-id 96.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 56.1.1.2 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 67.1.1.1 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[R7]ospf 1 router-id 97.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 67.1.1.2 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 47.1.1.2 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 7.7.7.7 0.0.0.0
3.建立BGP:
[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 3.3.3.3 as-number 234
[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R2-bgp]peer 5.5.5.5 as-number 567
[R2-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[R2-bgp]peer 5.5.5.5 ebgp-max-hop
[R2-bgp]peer 12.1.1.1 as-number 100
[R2-bgp]peer 3.3.3.3 next-hop-local
[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 LoopBack 0
[R3-bgp]peer 4.4.4.4 as-number 234
[R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R3-bgp]peer 2.2.2.2 reflect-client
[R3-bgp]peer 4.4.4.4 reflect-client
[R4]bgp 234
[R4-bgp]confederation id 200
[R4-bgp]confederation peer-as 567
[R4-bgp]router-id 4.4.4.4
[R4-bgp]peer 3.3.3.3 as-number 234
[R4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R4-bgp]peer 7.7.7.7 as-number 567
[R4-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[R4-bgp]peer 7.7.7.7 ebgp-max-hop
[R4-bgp]peer 3.3.3.3 next-hop-local
[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 LoopBack 0
[R5-bgp]peer 6.6.6.6 as-number 567
[R5-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[R5-bgp]peer 2.2.2.2 ebgp-max-hop
[R5-bgp]peer 6.6.6.6 next-hop-local
[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 LoopBack 0
[R6-bgp]peer 7.7.7.7 as-number 567
[R6-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[R6-bgp]peer 5.5.5.5 reflect-client
[R6-bgp]peer 7.7.7.7 reflect-client
[R7]bgp 567
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 200
[R7-bgp]peer 6.6.6.6 as-number 567
[R7-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[R7-bgp]confederation peer-as 234
[R7-bgp]peer 4.4.4.4 as-number 234
[R7-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R7-bgp]peer 4.4.4.4 ebgp-max-hop
[R7-bgp]peer 78.1.1.2 as-number 300
[R7-bgp]peer 6.6.6.6 next-hop-local
[R1]bgp 100
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.1.1.2 as-number 200
[R8]bgp 300
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.1.1.1 as-number 200
4.重发布:
[R1]bgp 100
[R1-bgp]import-route direct
[R8]bgp 300
[R8-bgp]import-route direct
[R7]bgp 567
[R7-bgp]import-route ospf 1
[R7-bgp]import-route direct
[R2]bgp 234
[R2-bgp]import-route ospf 1
[R2-bgp]import-route direct