一.实验拓扑
二.实验需求
1.R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址;
2.R1和R5间使用PPP的PAP认证,R5为主认证
R2与R5之间使用ppp的CHAP认证,R5为主认证方
R3与R5之间使用HDLC封装;
3.R1-R2-R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE;
4.整个私有网络基本RIP全网可达;
5.所有Pc设置私有IP为源IP,可以访问R5环回。
三.实验思路
1.先根据IP地址分配IP
2.在R1-R2-R3-R4上做缺省
3.在R1-R5之间做PPP中的PAP认证,R5为主认证方
主验证方
[R5]aaa
[R5-aaa]local-user wangdaye password cipher 123456
[R5-aaa]local-user wangdaye service-type ppp
[R5-aaa]q
[R5]interface s 4/0/1
[R5-Serial4/0/1]ppp authentication-mode pap
[R5-Serial4/0/1]link-protocol ppp
[R5-Serial4/0/1]q
被验证方
[R1]interface s 4/0/0
[R1-Serial4/0/0]ppp pap local-user wangdaye password cipher 123456
[R1-Serial4/0/0]q
4.在R2-R5之间做PPP的CHAP认证,R5为主认证方
主验证方
[R5]aaa
[R5-aaa]local-user wangdaye1 password cipher 123456
[R5-aaa]local-user wangdaye1 service-type ppp
[R5-aaa]q
[R5]interface s 3/0/1
[R5-Serial3/0/1]ppp authentication-mode chap
[R5-Serial3/0/1]link-protocol ppp
[R5-Serial3/0/1]q
被验证方
[R2]interface s 3/0/1
[R2-Serial3/0/1]ppp chap user wangdaye1
[R2-Serial3/0/1]ppp chap password cipher 123456
[R2-Serial3/0/1]q
5.R3-R5之间使用HDLC封装
[R3]interface s 4/0/0
[R3-Serial4/0/0]link-protocol hdlc[R5]interface s4/0/0
[R5-Serial4/0/0]link-protocol hdlc
6. 用R1-R2-R3搭建MGRE环境
中心站点
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 10.1.2.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
[R1-Tunnel0/0/1]source 15.1.1.1
[R1-Tunnel0/0/1]nhrp network-id 100
分支站点
[R2]interface t 0/0/1
[R2-Tunnel0/0/1]ip address 10.1.2.2 24
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp
[R2-Tunnel0/0/1]source Serial 4/0/0
[R2-Tunnel0/0/1]nhrp network-id 100
[R2-Tunnel0/0/1]nhrp entry 10.1.1.1(中心隧道地址) 15.1.1.1(中心公网接口地址) register
R3如R2所示
7. 用R1-R4搭建GRE环境
[R4]interface t 0/0/0
[R4-Tunnel0/0/0]ip address 10.1.1.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre
[R4-Tunnel0/0/0]source 45.1.1.4
[R4-Tunnel0/0/0]destination 15.1.1.1
R1如R4所示
8.R1-R2-R3-R4通过RIP宣告私有网段和隧道(tunnel)网段全网可达
注意:MGRE环境下使用RIP协议需要开启伪⼴播并且关闭⽔平分割
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]undo rip split-horizon
9.NAT配置
[R1]acl 2000
[R1-acl-basic-2000]rule 1 permit source any
[R1-acl-basic-2000]q
[R1]interface s 4/0/0
[R1-Serial4/0/0]nat outbound 2000
R2-R3-R4如R1所示
四.实验结果
1.rip路由
R1:
R2:
R3:
R4:
2.查看MGRE
R1:
R2:
R3:
3.查看GRE
R1:
R4:
4.全网可达
PC1 ping PC4:
PC1 ping R5的环回: