一、实验环境
二、实验目的
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,可以访问R5的环回。
三、实验步骤
1、划分网段
R1 - R5之间划分的网段为----- 15.0.0.0/24
R2 - R5之间划分的网段为----- 25.0.0.0/24
R3 - R5之间划分的网段为----- 35.0.0.0/24
R4 - R5之间划分的网段为----- 45.0.0.0/24
R1 - R4的私有网段划分为:192.168.1.0/24;192.168.2.0/24;192.168.3.0/24;192.168.4.0/24
R5的环回接口为:5.5.5.5/24
2、配置ip
R1
[r1]int Serial 4/0/0
[r1-Serial4/0/0]ip address 15.0.0.1 24[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
R2
[r2]int s4/0/0
[r2-Serial4/0/0]ip address 25.0.0.1 24
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
R3
[r3]int s4/0/0
[r3-Serial4/0/0]ip address 35.0.0.1 24
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip address 45.0.0.1 24
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
R5
[Huawei]sys isp
[isp]int s3/0/0
[isp-Serial3/0/0]ip address 15.0.0.2 24
[isp]int s3/0/1
[isp-Serial3/0/1]ip ad 25.0.0.2 24
[isp]int s4/0/0
[isp-Serial4/0/0]ip address 35.0.0.2 24
[isp]int g0/0/0
[isp-GigabitEthernet0/0/0]ip address 45.0.0.2 24[isp]int LoopBack 0
[isp-LoopBack0]ip address 5.5.5.5 24
[isp-LoopBack0]q
3、配置缺省路由指向isp
[r1]ip route-static 0.0.0.0 0 15.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
4、R1的公网接口地址使用PPP的PAP认证获取
主认证方R5的配置
[isp]aaa
[isp-aaa]
[isp-aaa]local-user r1 password cipher 123456
Info: Add a new user.
[isp-aaa]local-user r1 service-type ppp
[isp]int s3/0/0
[isp-Serial3/0/0]ppp authentication-mode pap
被认证方R1的配置
[r1]int s 4/0/0
[r1-Serial4/0/0]
[r1-Serial4/0/0]ppp pap local-user r1 password cipher 123456
5、R2的公网接口地址使用CHAP的认证获取
主认证方R5的配置
[isp]aaa
[isp-aaa]local-user r2 password cipher 123456
Info: Add a new user.[isp-aaa]local-user r2 service-type ppp
[isp]
[isp]int s3/0/1
[isp-Serial3/0/1]
[isp-Serial3/0/1]ppp authentication-mode chap
被认证方R2的配置
[r2]int s 4/0/0
[r2-Serial4/0/0]
[r2-Serial4/0/0]ppp chap user r2
[r2-Serial4/0/0]
[r2-Serial4/0/0]ppp chap password cipher 123456
6.R3与R5之间使用HDLC封装
R3接口的配置
[r3]int s 4/0/0
[r3-Serial4/0/0][r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
R5接口的配置
[isp]int s4/0/0
[isp-Serial4/0/0]
[isp-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
7、构建MGRE环境
R1的配置
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.5.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
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
R2的配置
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip address 192.168.5.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source Serial 4/0/0
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
R3的配置
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.5.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 192.168.5.1 15.0.0.1 register
8.构建GRE环境
R1的配置
[r1]int t 0/0/1
[r1-Tunnel0/0/1]
[r1-Tunnel0/0/1]ip address 192.168.6.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.0.0.1
[r1-Tunnel0/0/1]destination 45.0.0.1
R4的配置
[r4]int t 0/0/0
[r4-Tunnel0/0/0]
[r4-Tunnel0/0/0]ip address 192.168.6.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre
[r4-Tunnel0/0/0]source 45.0.0.1
[r4-Tunnel0/0/0]destination 15.0.0.1
9、RIP全网可达
R1的RIP路由
[r1]rip
[r1-rip-1]v 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.5.0
[r1-rip-1]network 192.168.6.0
R2的RIP路由
[r2]rip
[r2-rip-1]v 2[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
R3的RIP路由
[r3]rip
[r3-rip-1]v 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
R4的RIP路由
[r4]rip
[r4-rip-1]v 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.6.0
10.所有PC设置私有IP,可以访问R5的环回
PC1
PC4
PC3
PC2
访问R5环回需要用nat进行配置
R1的配置
[r1]acl 2000
[r1-acl-basic-2000]
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1-Serial4/0/0]nat outbound 2000
同理,R2,R3,R4均配置acl
最后,互相ping通即可完成本次实验