HCIP实验
实验要求:
1.R6为ISP只能配置IP地址,R1-R5的环回为私有网段
2.R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点
3.所有私有网段可以互相通信,私有网段使用OSPF完成。
实验思路:
- 规划网段,配IP地址,写缺省路由做通公网。
规划的网段如图所示
R1 配IP
R2 配IP
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 25.0.0.1 24
R3 配IP
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip address 35.0.0.1 24
R4 配IP
[r4]interface G0/0/0
[r4-GigabitEthernet0/0/0]IP address 45.0.0.1 24
R5 配IP
[R5]interface G0/0/0
[R5-GigabitEthernet0/0/0]IP address 55.0.0.1 24
R6 配IP
[R6]interface G0/0/0
[R6-GigabitEthernet0/0/0]IP address 65.0.0.2 24
[R6-GigabitEthernet0/0/0]Q
[R6]interface G0/0/1
[R6-GigabitEthernet0/0/1]IP address 15.0.0.2 24
[R6-GigabitEthernet0/0/1]Q
[R6]interface G0/0/2
[R6-GigabitEthernet0/0/2]IP address 55.0.0.2 24
[R6-GigabitEthernet0/0/2]Q
[R6]interface G4/0/2
[R6-GigabitEthernet4/0/2]IP address 45.0.0.2 24
[R6-GigabitEthernet4/0/2]Q
[R6]interface G/4/0/1
[R6-GigabitEthernet4/0/1]IP address 35.0.0.2 24
[R6-GigabitEthernet4/0/1]Q
[R6]interface G4/0/0
[R6-GigabitEthernet4/0/0]IP address 25.0.0.2 24
缺省路由配置:
[R1]ip route-static 0.0.0.0 0 15.0.0.2
[R1]ip route-static 0.0.0.0 0 65.0.0.2
[R2]ip route-static 0.0.0.0 0 25.0.0.2
[r3]ip route-static 0.0.0.0 0 35.0.0.2
[r4]IP route-static 0.0.0.0 0 45.0.0.2
[R5]IP route-static 0.0.0.0 0 55.0.0.2
R6为ISP只能配置IP地址,R1-R5的环回为私有网段 这个条件完成。
MGRE实现
中心的配置
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 192.168.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 15.0.0.1
[R1-Tunnel0/0/0]nhrp network-id 100
分支r4的配置
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 192.168.4.1 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source 45.0.0.1
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 192.168.1.1 15.0.0.1 r
[r4-Tunnel0/0/0]nhrp entry 192.168.1.1 15.0.0.1 register
分支r5的配置
[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]ip address 192.168.5.1 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source 55.0.0.1
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp entry 192.168.1.1 15.0.0.1 register
MGRE星型拓扑结构实现
中心r1的配置
1.创建tunnel,给与IP地址
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]IP address 192.168.6.0 24
2.定义封装方式
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
3.定义源和目标
[R1-Tunnel0/0/1]source 65.0.0.1
创建 nhrp域
[R1-Tunnel0/0/1]nhrp network-id 200
分支r2的配置
[R2]interface Tunnel 0/0/1
[R2-Tunnel0/0/1]IP address 192.168.2.1 24
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp
[R2-Tunnel0/0/1]source 25.0.0.1
[R2-Tunnel0/0/1]nhrp network-id 200
[R2-Tunnel0/0/1]nhrp entry 192.168.6.1 65.0.0.1 register
分支r3的配置
[r3]interface Tunnel 0/0/1
[r3-Tunnel0/0/1]IP address 192.168.3.1 24
[r3-Tunnel0/0/1]tunnel-protocol gre p2mp
[r3-Tunnel0/0/1]source 35.0.0.1
[r3-Tunnel0/0/1]nhrp network-id 200
[r3-Tunnel0/0/1]nhrp entry 192.168.6.1 65.0.0.1 register
OSPF
所有私有网段可以互相通信,私有网段使用OSPF完成
在R1上
1.启用OSPF进程给与进程号:
[R1]ospf 1 router-id 1.1.1.1
2.创建区域area0:
[R1-ospf-1]a 0
3.在区域里宣告路由信息:
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
1.启用OSPF进程给与进程号:
[R2]ospf 1 router-id 2.2.2.2
2.创建区域area0:
[R2-ospf-1]a 0
3.在区域里宣告路由信息:
[R2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
1.启用OSPF进程给与进程号:
[R3]ospf 1 router-id 3.3.3.3
2.创建区域area0:
[R3-ospf-1]a 0
3.在区域里宣告路由信息:
[R3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]a 0
[r4-ospf-1-area-0.0.0.0]ne
[r4-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]network192.168.5.0 0.0.0.255
Error: Unrecognized command found at '^' position.
[R5-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
测试