一实验要求
1.R5为ISP,只能进行IP地址配置,其所有地址均为共有IP地址
2.R1和ISP间使用ppp的PAP认证,ISP为主认证方
R2和ISP之间使用ppp的CHAP认证,ISP为主认证方
R3与ISP之间使用HDLC封装
3.R1,R2,R3构建一个MGRE环境,R1为中心站点,R1,R4间为点到点的GRE
4.整个私有网络基本RIP全网可达
5.所有PV设置私有IP为源IP,可以访问RS环回
二·配置思路
(1)网络规划
确定每个路由器和终端设备的IP地址。
确保所有设备在同一子网内,便于通信。
路由器基本配置
(2)为每个路由器配置主机名、接口IP地址和基本的路由协议(如RIP)。
PPP和GRE配置
(3)根据要求配置PPP认证(PAP/CHAP)和GRE隧道。
RIP配置
(4)启用RIP协议,确保所有路由器能够互相学习路由信息。
测试连通性
- 使用ping和traceroute命令测试各个设备之间的连通性。
三·实验步骤
(1)我们先对R1~R4和ISP的配置:
R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0]int s 4/0/0
[R1-Serial4/0/0]ip add 15.1.1.1 24
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.254 24
[R2]int s4/0/0
[R2-Serial4/0/0]ip add 25.1.1.2 24
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.3.254 24
[R3-GigabitEthernet0/0/0]int s4/0/0
[R3-Serial4/0/0]ip add 35.1.1.3 24
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.4 24
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.4.254 24
[ISP]int s4/0/1
[ISP-Serial4/0/1]ip add 15.1.1.5 24
[ISP-Serial4/0/1]int s3/0/1
[ISP-Serial3/0/1]ip add 25.1.1.5 24
[ISP-Serial3/0/1]int s4/0/0
[ISP-Serial4/0/0]ip add 35.1.1.5 24
[ISP-Serial4/0/0]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 45.1.1.5 24
[ISP]int l0
[ISP-LoopBack0]ip add 5.5.5.5 24
- 我们开始对R1~ISP的PAP认证进行配置
[ISP-aaa]local-user qxb(帐号) password cipher qxb233(密码)
[ISP-aaa]local-user qxb service-type ppp
[ISP]int s4/0/1
[ISP-Serial4/0/1]ppp authentication-mode pap
[R1]int s4/0/0
[R1-Serial4/0/0]ppp pap local-user twj password cipher twj666
[R1-Serial4/0/0]shutdown
[R1-Serial4/0/0]undo shutdown
- 我们对R2与ISP进行CHAP认证,其中ISP为主认证方
[ISP]int s3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
[R2]int s4/0/0
[R2-Serial4/0/0]ppp chap user twj
[R2-Serial4/0/0]ppp chap password cipher twj666
[R2-Serial4/0/0]shutdown
[R2-Serial4/0/0]undo shutdown
- 我们对R3与R5进行HDLC封装
[R3]int s4/0/0
[R3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:Y
[ISP]int s4/0/0
[ISP-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
- 我们开始搭建使用MGRE环境R1为中心站点,R1~R4为点到点GRE
其中我们先使用静态缺省实现全网通
R1]ip route-static 0.0.0.0 0 15.1.1.5
[R2]ip route-static 0.0.0.0 0 25.1.1.5
[R3]ip route-static 0.0.0.0 0 35.1.1.5
[R4]ip route-static 0.0.0.0 0 45.1.1.5
- 我们开始构建隧道,将其贵点MGRE编号为0/0/0,GRE为0/0/1
所以把10.1.10/24给MGRE 10.1.2.0/给GRE
首先搭建MGRE的环境
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 10.1.1.1 24
[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]int Tunnel 0/0/0
[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 4/0/0
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
[R3]int Tunnel 0/0/0
[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
MGRE环境搭建已完成,接下来是进行GRE搭建
[R1]int Tunnel 0/0/1
[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]description 45.1.1.4
[R4]int Tunnel 0/0/1
[R4-Tunnel0/0/1]ip add 10.1.2.4 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 45.1.1.4
[R4-Tunnel0/0/1]description 15.1.1.1
以上两种环境搭配完成
(7)我们开始使用RIP实现私网全网可达
[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]undo summary
[R1-rip-1]net 192.168.1.0
[R1-rip-1]net 10.0.0.0
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]undo rip split-horizon
[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]undo summary
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0
[R2]int t0/0/0
[R2-Tunnel0/0/0]undo rip split-horizon
[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]undo summary
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0
[R3-rip-1]int t0/0/0
[R3-Tunnel0/0/0]undo rip split-horizon
[R4]rip 1
[R4-rip-1]v 2
[R4-rip-1]undo summary
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 10.0.0.0
验证
( 8 )
我们可与在R3上写下dis nhrp peer all观察配置情况如图所示
所以将配置acl使实验完整
[R1]acl 2000
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R1]int s4/0/0
[R1-Serial4/0/0]nat outbound 2000
[R2]acl 2000
[R2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[R2]int s4/0/0
[R2-Serial4/0/0]nat outbound 2000
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[R3]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R4]acl 2000
[R4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]nat outbound 2000
最后达到实验目的实验结束