一.拓扑图
二.实验要求
1、R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址;
2、 R1和R5间使用PPP的PAP认证,R5为主认证方;
R2与R5之间使用PPP的CHAP认证,R5为主认证方;
R3与R5之间使用HDLC封装;
3、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE;
4、整个私有网络基本RIP全网可达;
5、所有PC设置私有IP为源IP,可以访问R5环回。
三.实验思路
1.配置IP
2.R1和R5间使用PPP的PAP认证,R5为主认证方;
R2与R5之间使用ppp的CHAP认证,R5为主认证方;
R3与R5之间使用HDLC封装;
3.先保证公网通(使用静态路由)然后以R1作为中心站点
R1、R2、R3构建一个隧道地址---MGRE
R1、R4构造一个隧道地址---GRE
4.使用rip实现私网通
5.在R1-R5上做nat,实现全网通
四.实验步骤
1.先配置ip
R1
R2
R3
R4
R5
2.配置静态路由
[R1]ip route-static 0.0.0.0 0 15.1.1.2
[R2]ip route-static 0.0.0.0 0 25.1.1.2
[R3]ip route-static 0.0.0.0 0 35.1.1.2
[R4]ip route-static 0.0.0.0 0 45.1.1.2
3.配置PAP,CHAP,HDLC封装
[r1]int s 0/0/3
[r1-Serial0/0/3]ppp pap local-user huawei password cipher 123456
[r5]aaa
[r5-aaa]local-user huawei password cipher 123456
[r5-aaa]local-user huawei service-type ppp
[r5]int s 0/0/2
[r5-Serial0/0/2]ppp authentication-mode pap
R2与R5之间使用PPP的CHAP认证,R5为主认证方
[r2]int s 0/0/3
[r2-Serial0/0/3]ppp chap user nanjing
[r2-Serial0/0/3]ppp chap password cipher 111
[r5-aaa]local-user nanjing password cipher 111
[r5-aaa]local-user nanjing service-type ppp
[r5-Serial0/0/1]ppp authentication-mode chap
r3与r5间使用HDLC封装
[r3]int s 0/0/3
[r3-Serial0/0/3]link-protocol hdlc
[r5]int s 0/0/3
[r5-Serial0/0/3]link-protocol hdlc
r1/r2/r3构建一个MGRE环境
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.1.1.1
[r1-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]ip add 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source Serial 3/0/1
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
[r3-Tunnel0/0/0]ip add 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
r1, r4间为点到点GRE
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]destination 45.1.1.1
[r4-Tunnel0/0/1]ip add 10.1.2.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.1.1.1
[r4-Tunnel0/0/1]destination 15.1.1.1
配置RIP协议
配置NAT
4.整个私有网络基于RIP全网可达
R1
[R1-rip-1]version 2
[R1-rip-1]undo summary
[R1-rip-1]network 10.0.0.0
[R1-rip-1]network 192.168.1.0
R2
[R2-rip-1]version 2
[R2-rip-1]undo summary
[R2-rip-1]network 10.0.0.0
[R2-rip-1]network 192.168.2.0
R3
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]undo summary
[R3-rip-1]network 10.0.0.0
[R3-rip-1]network 192.168.3.0
开启R1伪广播,关闭接口水平分割
[R1]interfaceTunnel 0/0/0
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]undo rip split-horizon
在R2上关闭接口水平分割
[R2-Tunnel0/0/0]undo rip split-horizon
在R3上关闭接口水平分割
[R3-Tunnel0/0/0]undo rip split-horizon
5.所有Pc设置私有IP为源IP,可以访问R5环回,达到全网通。
R1
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]int s 3/0/0
[r1-Serial3/0/0]nat outbound 2000
R2
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]int s 3/0/1
[r2-Serial3/0/1]nat outbound 2000
R3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]int s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
R4
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]q
[r4]int g 0/0/1
[r4-GigabitEthernet0/0/1]nat outbound 2000