整体结构:
IP配置:
r1:
GigabitEthernet0/0/0 12.1.1.1/24 up up
GigabitEthernet0/0/2 172.16.0.21/30 down down
LoopBack0 1.1.1.1/24 up up(s)
r2:
GigabitEthernet0/0/0 12.1.1.2/24 up up
GigabitEthernet0/0/1 172.16.0.1/30 up up
GigabitEthernet0/0/2 172.16.0.21/30 up up
LoopBack0 172.16.32.1/19 up up(s)
LoopBack1 172.16.224.2/32 up up(s)
r3:
GigabitEthernet0/0/0 172.16.0.2/30 up up
GigabitEthernet0/0/1 172.16.0.5/30 up up
LoopBack0 172.16.64.1/19 up up(s)
LoopBack1 172.16.224.3/32 up up(s)
r4:
GigabitEthernet0/0/0 172.16.0.6/30 up up
GigabitEthernet0/0/1 172.16.0.9/30 up up
LoopBack0 172.16.96.1/19 up up(s)
LoopBack1 172.16.224.4/32 up up(s)
r5:
GigabitEthernet0/0/0 172.16.0.22/30 up up
GigabitEthernet0/0/1 172.16.0.17/30 up up
LoopBack0 172.16.129.1/19 up up(s)
LoopBack1 172.16.224.5/32 up up(s)
r6:
GigabitEthernet0/0/0 172.16.0.18/30 up up
GigabitEthernet0/0/1 172.16.0.13/30 up up
LoopBack0 172.16.160.1/19 up up(s)
LoopBack1 172.16.224.6/32 up up(s)
r7:
GigabitEthernet0/0/0 172.16.0.14/30 up up
GigabitEthernet0/0/1 172.16.0.10/30 up up
GigabitEthernet0/0/2 78.1.1.1/24 up up
LoopBack0 172.16.193.1/19 up up(s)
LoopBack1 172.16.224.7/32 up up(s)
r8:
GigabitEthernet0/0/0 78.1.1.2/24 up up
LoopBack0 8.8.8.8/24 up up(s)
附图一张:
ospf协议:
r2:
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 172.16.0.1 0.0.0.0
network 172.16.0.21 0.0.0.0
network 172.16.32.1 0.0.0.0
network 172.16.224.2 0.0.0.0
r3:
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 0.0.0.0 255.255.255.255
r4、5、6、均是如此
r7:
ospf 1 router-id 7.7.7.7
area 0.0.0.0
network 172.16.0.10 0.0.0.0
network 172.16.0.13 0.0.0.0
network 172.16.192.1 0.0.0.0
network 172.16.224.7 0.0.0.0
附图一张:
bgp的建立邻居和反射以及联邦:
r2:
bgp 64512
confederation id 2
confederation peer-as 64513
peer 12.1.1.1 as-number 1
peer 172.16.224.3 as-number 64512
peer 172.16.224.3 connect-interface LoopBack1
peer 172.16.224.5 as-number 64513
peer 172.16.224.5 ebgp-max-hop 2
peer 172.16.224.5 connect-interface LoopBack1
network 172.16.32.0 255.255.224.0
peer 172.16.224.3 next-hop-local
r3:
bgp 64512
confederation id 2
peer 172.16.224.2 as-number 64512
peer 172.16.224.2 connect-interface LoopBack1
peer 172.16.224.4 as-number 64512
peer 172.16.224.4 connect-interface LoopBack1
network 172.16.64.0 255.255.224.0
peer 172.16.224.2 reflect-client
r4:
bgp 64512
confederation id 2
confederation peer-as 64513
peer 172.16.224.3 as-number 64512
peer 172.16.224.3 connect-interface LoopBack1
peer 172.16.224.7 as-number 64513
peer 172.16.224.7 ebgp-max-hop 2
peer 172.16.224.7 connect-interface LoopBack1
network 172.16.96.0 255.255.224.0
peer 172.16.224.3 next-hop-local
r5:
bgp 64513
confederation id 2
confederation peer-as 64512
peer 172.16.224.2 as-number 64512
peer 172.16.224.2 ebgp-max-hop 2
peer 172.16.224.2 connect-interface LoopBack1
peer 172.16.224.6 as-number 64513
peer 172.16.224.6 connect-interface LoopBack1
network 172.16.128.0 255.255.224.0
peer 172.16.224.6 next-hop-local
r6:
bgp 64513
confederation id 2
peer 172.16.224.5 as-number 64513
peer 172.16.224.5 connect-interface LoopBack1
peer 172.16.224.7 as-number 64513
peer 172.16.224.7 connect-interface LoopBack1
network 172.16.160.0 255.255.224.0
peer 172.16.224.5 reflect-client
r7:
bgp 64513
confederation id 2
confederation peer-as 64512
peer 78.1.1.2 as-number 3
peer 172.16.224.4 as-number 64512
peer 172.16.224.4 ebgp-max-hop 2
peer 172.16.224.4 connect-interface LoopBack1
peer 172.16.224.6 as-number 64513
peer 172.16.224.6 connect-interface LoopBack1
network 172.16.0.0
network 172.16.192.0 255.255.224.0
peer 172.16.224.6 next-hop-local
最后测试:
附图: