一、实验内容:
二、实验分析:
第一点要求R5为ISP设备只能配置公有IP地址,不能对他进行任何其他操作。第二点要求我们在R1-R5之间配置ppp的pap认证,且R5为主认证方;R2-R5之间配置ppp的chap认证,且R5为主认证方;R3-R5之间更改为以HDLC方式封装。第三点要求我们以R1为中心R2,R3为成员的基础上搭建一个MGRE环境且还要以R1,R4为基础搭建一个点到点的GRE环境。第四点要求配置rip实现pc间的通讯。最后要求所有的pc可以与R5的环回通讯,这就要求配置nat来完成要求。
三、实验步骤:
注意:串口的接入要在路由器上加接口
方法如下:
右键-->设置-->找到2sa接口卡--> 拖拽到上方-->关闭即可
第一步:IP地址规划
设备 | 地址 | 网关/接口 |
PC1 | 192.168.1.2/24 | 192.168.1.1/24 |
PC2 | 192.168.2.2/24 | 192.168.2.1/24 |
PC3 | 192.168.3.2/24 | 192.168.3.1/24 |
PC4 | 192.168.4.2/24 | 192.168.4.1/24 |
R1 | 15.1.1.1/24 | S4/0/0 |
R2 | 25.1.1.2/24 | S4/0/0 |
R3 | 35.1.1.3/24 | S4/0/0 |
R4 | 45.1.1.4/24 | S4/0/0 |
R5 | 15.1.1.5/24 | S3/0/0 |
25.1.1.5/24 | S3/0/1 | |
35.1.1.5/24 | S4/0/0 | |
45.1.1.5/24 | G0/0/0 | |
5.5.5.5.5/24 | LOOPBACK0 |
Tunnel地址:
设备 | 地址 |
R1 | 10.1.1.1/24 |
R2 | 10.1.1.2/24 |
R3 | 10.1.1.3/24 |
R4 | 10.1.1.4/24 |
第二步:IP地址配置
以R1和R5为例
R1配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
<Huawei>sysname R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
Jul 20 2023 16:47:38-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[6]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]int s4/0/0
[R1-Serial4/0/0]ip add 15.1.1.1 24
[R1-Serial4/0/0]
R5配置
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R5
[R5]int s3/0/0
[R5-Serial3/0/0]ip add 15.1.1.5 24
[R5-Serial3/0/0]
Jul 20 2023 16:54:47-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial3/0/0 has entered the UP state.
[R5-Serial3/0/0]int s3/0/1
[R5-Serial3/0/1]ip add 25.1.1.5 24
[R5-Serial3/0/1]
Jul 20 2023 16:55:09-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
IPCP on the interface Serial3/0/1 has entered the UP state.
[R5-Serial3/0/1]int s4/0/0
[R5-Serial4/0/0]ip add 35.1.1.5 24
[R5-Serial4/0/0]
Jul 20 2023 16:55:32-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[R5-Serial4/0/0]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 45.1.1.5 24
Jul 20 2023 16:55:55-08:00 R5 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R5-Serial3/0/0]int loop1
[R5-LoopBack1]ip add 5.5.5.5 24
[R5-LoopBack1]
第三步:分别给R1-R4配置缺省路由,以R1为例
[R1]ip route-static 0.0.0.0 0 15.1.1.5
第四步:分别给R1-R4进行NAT配置,以R1为例
[R1]acl 2000
[R1-acl-basic-2000]rule 1 permit source any
[R1-acl-basic-2000]q
[R1]inter s4/0/0
[R1-Serial4/0/0]nat outbound 2000
第五步:根据题目要求进行PAP认证配置
主认证方(R5)配置
[R5]aaa
[R5-aaa]local-user huawei password cipher 123
[R5-aaa]local-user huawei service-type ppp
[R5]interface s4/0/0
[R5-Serial3/0/0]ppp authentication-mode pap
被认证方(R1)配置
[R1]interface s4/0/0
[R1-Serial4/0/0]ppp pap local-user huawei password cipher 123
第六步:根据题目要求进行CHAP认证配置
主认证方(R5)配置
[R5]aaa
[R5-aaa]local-user huawei password cipher 123
[R5-aaa]local-user huawei service-type ppp
[R5]interface s3/0/1
[R5-Serial3/0/1]ppp authentication-mode chap
被认证方(R2)配置
[R2]interface s4/0/0
[R2-Serial4/0/0]ppp chap user huawei
[R2-Serial4/0/0]ppp chap password cipher 123
第七步:HDCL封装
R3配置
[R3]inter s4/0/0
[R3-Serial4/0/0]link-protocol hdlc
R5配置
[R5]interface s4/0/0
[R5-Serial3/0/0]link-protocol hdlc
第八步:MGRE环境配置(R1-R3)
中心点配置(R1)
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 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为例)
[R2]interface Tunnel 0/0/0
[R2-Tunnel0/0/0]ip address 10.1.1.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source s4/0/0
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
[R2-Tunnel0/0/0]nhrp network-id 100
第九步:GRE配置(R1与R4间)
R1为例
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 20.1.1.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.4
第十步:RIP配置
R1配置
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0
[R1-rip-1]network 20.0.0.0
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]undo rip split-horizon
R2配置
[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0
R3配置
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0
R4配置
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 20.0.0.0
[R4-rip-1]network 192.168.4.0
第十一步:验证
PC4 ping PC1
PC4 ping R5 的环回