HCIP课程总结(六)
OSPF与MGRE实验
要求:
1、建立拓扑,分配ip并标识
2、配置ip地址
3、R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点
由条件知需要创建两个MGRE分别实施上述两个拓扑结构:
R1/4/5:
AR1:
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 255.255.255.0
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 12.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
AR4:
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 10.1.1.2 255.255.255.0
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source 12.1.4.1
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
AR5:
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 10.1.1.3 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 12.1.5.1
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
配置到ISP的缺省路由:
[r1]ip route-static 0.0.0.0 0 12.1.1.2
[r4]ip route-static 0.0.0.0 0 12.1.4.2
[r5]ip route-static 0.0.0.0 0 12.1.5.2
因为需要全连结构,所以设定都为中心站点,两两间互相注册
AR1:
[r1-Tunnel0/0/0]nhrp entry 10.1.1.2 12.1.4.1 register
Info: This peer protocol address conflicts with hub register peer protocol address.
[r1-Tunnel0/0/0]nhrp entry 10.1.1.3 12.1.5.1 register
Info: This peer protocol address conflicts with hub register peer protocol address.
AR4:
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]nhrp entry multicast dynamic
[r4-Tunnel0/0/0]nhrp entry 10.1.1.3 12.1.5.1 register
AR5:
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]nhrp entry multicast dynamic
[r5-Tunnel0/0/0]nhrp entry 10.1.1.2 12.1.4.1 register
测试:
R1/2/3:
配置到ISP的缺省:
[r1]ip route-static 0.0.0.0 0 12.1.6.2
[r2]ip route-static 0.0.0.0 0 12.1.2.2
[r3]ip route-static 0.0.0.0 0 12.1.3.2
测试:
4、所有私有网段可以互相通讯,私有网段使用ospf协议完成
启动R1/4/5的ospf
将tunnel0/0/0划分入area0
由图可知
NBAM(MGRE) 默认接口工作方式为p2p,该工作方式仅允许建立一个邻居关系;导致在MGRE环境中无法建立所有的邻居关系;可以通过修改接口的工作方式来解决:
修改所有接口的工作访问broadcast
[r1-Tunnel0/0/0]ospf network-type broadcast
注:在MGRE环境下,若一个网段的部分接口修改为broadcast,其他依然为点到点;由于建邻的条件匹配,故可以建立邻居关系;但broadcast需要DR,点到点不需要,所以最终不能正常收敛;需要该网段所有节点均为broadcast;
测试:
启动R1/2/3的ospf
将tunnel0/0/1划分入area1
对于中心到站点(轴辐状-星型结构) DR必须定在中心站点,没有BDR,所以让R2/3放弃选举;同样需要broadcast;
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ospf dr-priority 2
[r2]interface Tunnel 0/0/1
[r2-Tunnel0/0/1]ospf dr-priority 0
[r3]interface Tunnel 0/0/1
[r3-Tunnel0/0/1]ospf dr-priority 0
需要重启ospf,进行从新选举,时间差尽量小;
reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
查表:
OSPF的区域汇总—在ABR上将区域0的路由计算好后,传递到区域1时,方可进行汇总计算配置
[r1]ospf 1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]abr-summary 192.168.0.0 255.255.252.0
测试:
实验完成