HCIE第七天总结
OSPF架构设计
实验要求:①该拓扑里面R1和R4分别有业务、办公两个部门
②业务部门的流量走左边的链路,经过r2,办公流量做右边链路,要去其中一条链路出现问题,需要做到备份,可以及时切换换链路
拓扑图:解决Ospf链路备份的方法有三种
第一种方法:虚链路
解析过程:
规划两个OSPF区域,左边的为area 0,右边的为area 1
如果r1和r2之间的链路发生故障,则会影响到左边area 0业务部流量无法通信,所以在r1和r4上面创建一个虚链路,直接将r1和r4进行连接这样就解决了在链路断裂情况下备份的效果。
命令:进ospf区域操作
vlink-peer 4.4.4.4
vlink-peer 1.1.1.1
第二种方法:重发布 通过路由策略来决定选路
启动OSPF多进程,在上面area 0建立ospf 1进程,下面建立ospf 2进程,然后在两个边界路由器上面进行路由的双向重发布,进行路由策略,先抓取感兴趣流量,然后在ospf里面启用router-police联合使用,最后设定两个不同链路的cost值。
命令:[r2]ip ip-prefix 100 index 10 permit 10.100.0.0 16 greater-equal 17 less-equal 32
[r2]route-policy k permit node 10
[r2-route-policy]if-match ip-prefix 100
[r2-route-policy]apply cost 100
[r2-ospf-1]import-route ospf 2 route-policy k
第三种方法:最长匹配
在r2路由器ospf 1 进程里面做area 0的汇总
在r3路由器ospf 1 进程里面做area 0的汇总
做区域的汇总,在r2和r3路由器上面,利用明细汇总优于汇总路由条目来满足实验的需求。
命令:[r2-ospf-area-0.0.0.0]abr-summary 10.0.0.0 255.255.0.0
[r2-ospf-area-0.0.0.1]abr-summary 10.200.0.0 255.255.0.0
[r3-ospf-area-0.0.0.1]abr-summary 10.100.0.0 255.255.0.0
[r3-ospf-area-0.0.0.0]abr-summary 10.0.0.0 255.255.0.0
OSPF分流实验
实验要求:
使用OSPF协议(划分区域,开销值)实现办公与业务路由分离R1路由器配置:
interface Ethernet0/0/0.1
dot1q termination vid 1
ip address 10.1.12.1 255.255.255.0
ospf cost 1
arp broadcast enable
interface Ethernet0/0/0.2
dot1q termination vid 2
ip address 10.2.12.1 255.255.255.0
ospf cost 1
arp broadcast enable
interface Ethernet0/0/1
ip address 10.1.13.1 255.255.255.0
ospf cost 1
interface GigabitEthernet0/0/0.1
dot1q termination vid 1
ip address 10.1.14.1 255.255.255.0
ospf cost 3
arp broadcast enable
interface GigabitEthernet0/0/0.2
dot1q termination vid 2
ip address 10.2.14.1 255.255.255.0
ospf cost 1
arp broadcast enable
interface GigabitEthernet0/0/1
ip address 10.100.1.1 255.255.255.0
interface GigabitEthernet0/0/2
ip address 10.200.1.1 255.255.255.0
ospf 1 router-id 1.1.1.1
area 0.0.0.1
network 10.100.0.0 0.0.255.255
network 10.1.12.0 0.0.0.255
network 10.1.14.0 0.0.0.255
network 10.1.13.0 0.0.0.255
area 0.0.0.2
network 10.200.0.0 0.0.255.255
network 10.2.12.0 0.0.0.255
network 10.2.14.0 0.0.0.255
R2路由器配置:
interface Ethernet0/0/0.1
dot1q termination vid 1
ip address 10.1.12.2 255.255.255.0
ospf cost 1
arp broadcast enable
interface Ethernet0/0/0.2
dot1q termination vid 2
ip address 10.2.12.2 255.255.255.0
ospf cost 1
arp broadcast enable
interface Ethernet0/0/1
ip address 10.1.24.1 255.255.255.0
ospf cost 1
interface GigabitEthernet0/0/0
ip address 10.100.2.1 255.255.255.0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/1.1
dot1q termination vid 1
ip address 10.1.23.1 255.255.255.0
ospf cost 1
arp broadcast enable
interface GigabitEthernet0/0/1.2
dot1q termination vid 2
ip address 10.2.23.1 255.255.255.0
ospf cost 3
arp broadcast enable
interface GigabitEthernet0/0/2
ip address 10.200.2.1 255.255.255.0
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 10.100.0.0 0.0.255.255
network 10.1.12.0 0.0.0.255
network 10.1.23.0 0.0.0.255
area 0.0.0.2
network 10.200.0.0 0.0.255.255
network 10.2.12.0 0.0.0.255
network 10.2.23.0 0.0.0.255
network 10.2.24.0 0.0.0.255
network 10.1.24.0 0.0.0.255
R3路由器配置:
interface Ethernet0/0/0
ip address 10.1.34.1 255.255.255.0
ospf cost 10
interface Ethernet0/0/1
ip address 10.1.13.2 255.255.255.0
interface GigabitEthernet0/0/1.1
dot1q termination vid 1
ip address 10.1.23.2 255.255.255.0
ospf cost 1
arp broadcast enable
interface GigabitEthernet0/0/1.2
dot1q termination vid 2
ip address 10.2.23.2 255.255.255.0
ospf cost 3
arp broadcast enable
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/2.1
dot1q termination vid 1
ip address 10.1.35.1 255.255.255.0
ospf cost 1
arp broadcast enable
interface GigabitEthernet0/0/2.2
dot1q termination vid 2
ip address 10.2.35.1 255.255.255.0
ospf cost 3
arp broadcast enable
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 10.1.34.0 0.0.0.255
area 0.0.0.1
network 10.1.23.0 0.0.0.255
network 10.1.13.0 0.0.0.255
area 0.0.0.2
network 10.2.23.0 0.0.0.255
area 0.0.0.3
network 10.1.35.0 0.0.0.255
area 0.0.0.4
network 10.2.35.0 0.0.0.255
R4路由器配置:
interface Ethernet0/0/0
ip address 10.1.34.2 255.255.255.0
ospf cost 10
interface Ethernet0/0/1
ip address 10.1.24.2 255.255.255.0
ospf cost 1
interface GigabitEthernet0/0/0.1
dot1q termination vid 1
ip address 10.1.14.2 255.255.255.0
ospf cost 3
arp broadcast enable
interface GigabitEthernet0/0/0.2
dot1q termination vid 2
ip address 10.2.14.2 255.255.255.0
arp broadcast enable
interface GigabitEthernet0/0/1.1
dot1q termination vid 1
ip address 10.1.45.1 255.255.255.0
ospf cost 3
arp broadcast enable
interface GigabitEthernet0/0/1.2
dot1q termination vid 2
ip address 10.2.45.1 255.255.255.0
ospf cost 1
arp broadcast enable
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 10.1.34.0 0.0.0.255
area 0.0.0.1
network 10.1.14.0 0.0.0.255
area 0.0.0.2
filter ip-prefix 100 import
network 10.2.14.0 0.0.0.255
network 10.1.24.0 0.0.0.255
area 0.0.0.3
network 10.1.45.0 0.0.0.255
area 0.0.0.4
filter ip-prefix 100 import
network 10.2.45.0 0.0.0.255
ip ip-prefix 100 index 10 deny 10.100.0.0 16 greater-equal 17 less-equal 32
ip ip-prefix 100 index 20 permit 0.0.0.0 0 less-equal 32
R5路由器配置:
interface Ethernet0/0/0
ip address 10.100.3.1 255.255.255.0
interface Ethernet0/0/1
ip address 10.200.3.1 255.255.255.0
interface GigabitEthernet0/0/1.1
dot1q termination vid 1
ip address 10.1.45.2 255.255.255.0
ospf cost 3
arp broadcast enable
interface GigabitEthernet0/0/1.2
dot1q termination vid 2
ip address 10.2.45.2 255.255.255.0
ospf cost 1
arp broadcast enable
interface GigabitEthernet0/0/2
interface GigabitEthernet0/0/2.1
dot1q termination vid 1
ip address 10.1.35.2 255.255.255.0
ospf cost 1
arp broadcast enable
interface GigabitEthernet0/0/2.2
dot1q termination vid 2
ip address 10.2.35.2 255.255.255.0
ospf cost 3
arp broadcast enable
ospf 1 router-id 5.5.5.5
area 0.0.0.3
network 10.1.35.0 0.0.0.255
network 10.1.45.0 0.0.0.255
network 10.100.0.0 0.0.255.255
area 0.0.0.4
network 10.2.35.0 0.0.0.255
network 10.2.45.0 0.0.0.255
network 10.200.0.0 0.0.255.255