拓扑图&IP划分如下:
以R1为例,R2~R8同理
interface GigabitEthernet 0/0/0
ip address 12.0.0.1 24
interface LoopBack 0
ip address 10.0.0.1 24
以R2为例,R3~R7同理
ospf 1 router-id 2.2.2.2
area 0
network 172.16.0.0 0.0.255.255
R1:
bgp 1
router-id 1.1.1.1
peer 12.0.0.2 as-number 2
R2:
bgp 64512
confederation id 2
router-id 2.2.2.2
peer 12.0.0.1 as-number 1
R3:
bgp 65412
router-id 3.3.3.3
confederation id 2
peer 172.16.64.1 as-number 64512
peer 172.16.64.1 connect-interface LoopBack 0
R4:
bgp 65412
router-id 4.4.4.4
confederation id 2
peer 172.16.32.1 as-number 64512
peer 172.16.32.1 connect-interface LoopBack 0
R4:
confederation peer-as 64513
peer 172.16.160.1 as-number 64512
peer 172.16.160.1 connect-interface LoopBack 0
peer 172.16.160.1 ebgp-max-hop
R7:
bgp 64512
router-id 7.7.7.7
confederation id 2
peer 172.16.64.1 as-number 64512
peer 172.16.64.1 connect-interface LoopBack 0
peer 172.16.64.1 ebgp-max-hop
R1:
bgp 1
network 10.0.0.0 24
R2:
bgp 64512
peer 172.16.32.1 next-hop-local
peer 172.16.96.1 next-hop-local
R3,R6同理:
bgp 64512
peer 172.16.192.1 reflect-client
R2,R7同理
ip route-static 172.16.0.0 16 NULL 0
bgp 64512
network 172.16.0.0 16
R1,R8同理
interface Tunnel 0/0/0
tunnel-protocol gre
source 10.0.0.1
destination 80.0.0.1
测试
R8