实验要求:
1.合理规划IP地址,启用OSPF单区域
2.R1-R2之间启用PPP的pap单向认证
3.R2-R3之间启用PPP的chap双向认证
4.R3-R5-R6之间使用MGRE,R3为hub端,R5 R6为spoke端;要求MGRE接口网络类型为BMA,spoke之间通信必须经过hub端
5.实现全网可达
Step1:首先给IP给环回基本配置(接口如图所示)
[r1-Serial4/0/0]ip address 12.1.1.1 24
[r1-LoopBack0]ip address 1.1.1.1 24
[r2-Serial4/0/0]ip address 23.1.1.1 24
[r2-Serial4/0/1]ip address 12.1.1.2 24
[r2-LoopBack0]ip address 2.2.2.2 24
[r3-Serial4/0/1]ip address 23.1.1.2 24
[r3-LoopBack0]ip address 3.3.3.3 24
[r4-GigabitEthernet0/0/0]ip address 34.1.1.2 24
[r4-GigabitEthernet0/0/1]ip address 45.1.1.1 24
[r4-GigabitEthernet0/0/2]ip address 46.1.1.1 24[r5-GigabitEthernet0/0/0]ip address 45.1.1.2 24
[r5-LoopBack0]ip address 5.5.5.5 24
[r6-GigabitEthernet0/0/0]ip address 46.1.1.2 24
[r6-LoopBack0]ip address 6.6.6.6 24
Step2:启用ospf单区域之前先做认证
R1和R2的pap单向认证直接在R1R2的接口分别做认证:
[r1]aaa
[r1-aaa]local-user hcia password cipher 654321 (R1为主认证方)
Info: Add a new user.
[r1-aaa]local-user hcia service-type ppp
[r1-Serial4/0/0]ppp authentication-mode pap (接口调用)[r2-Serial4/0/0]link-protocol ppp (被认证方提供账号和密码)
[r2-Serial4/0/0]ppp pap local-user hcia password cipher 654321
R2-R3之间启用PPP的chap双向认证
chap:挑战握手认证协议,通过三次握手的方式进行安全的MD5认证 ,在认证过程中需要发送挑战信息(类似 HMAC 密钥化哈希)。
1、主认证方R2
[r2]aaa
[r2-aaa]local-user hcip password cipher 365124
[r2-aaa]local-user hcip service-type ppp
接口启用chap[r2-Serial4/0/0]link-protocol ppp
[r2-Serial4/0/0]ppp authentication-mode chap
被认证方
[r3-Serial4/0/1]link-protocol ppp
[r3-Serial4/0/1]ppp chap user hcip
[r3-Serial4/0/1]ppp chap password cipher 365124
2、主认证方R3
[r3]aaa
[r3-aaa]local-user hcie password cipher 985211
[r3-aaa]local-user hcie service-type ppp
接口[r3-Serial4/0/1]link-protocol ppp
[r3-Serial4/0/1]ppp authentication-mode chap
被认证方
[r2-Serial4/0/0]link-protocol ppp
[r2-Serial4/0/0]ppp chap user hcie
[r2-Serial4/0/0]ppp chap password cipher 985211
Step3:启用ospf单区域,使用MGRE(R3为hub端,R5R6为spoke端)
NHRP:下一跳解析协议,所有的MGRE接口将自己的MGRE接口IP地址和对应 隧道物理接口地址信息发送给NHS(NHRPSERVER)进行注册,NHS 上存在所有接入MGRE的接 口映射关系。
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip ad
[r3-Tunnel0/0/0]ip address 10.1.1.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 34.1.1.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic[r5]int t0/0/0
[r5-Tunnel0/0/0]ip address 10.1.1.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 45.1.1.2
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 34.1.1.1 register[r6]int t0/0/0
[r6-Tunnel0/0/0]ip address 10.1.1.3 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source 46.1.1.2
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 10.1.1.1 34.1.1.1 register[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 12.1.1.1 0.0.0.0[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 12.1.1.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]ar 0
[r6-ospf-1-area-0.0.0.0]net
[r6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[r6-ospf-1-area-0.0.0.0]net
[r6-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0
Step4:改小R5R6优先级,使R5R6不参加DR选举,并改网络类型为BMA
[r3-Tunnel0/0/0]ospf network-type broadcast
[r5-Tunnel0/0/0]ospf dr-priority 0
[r5-Tunnel0/0/0]ospf network-type broadcast
[r6-Tunnel0/0/0]ospf dr-priority 0
[r6-Tunnel0/0/0]ospf network-type broadcast
Step5:写缺省路由
[r3]ip route-static 0.0.0.0 0 34.1.1.2
[r5]ip route-static 0.0.0.0 0 45.1.1.1
[r6]ip route-static 0.0.0.0 0 46.1.1.1