题目
1、R5为ISP,R5环回为5.5.5.0/24,只能进行IP地址配置,其所有地址均配置为公有IP地址;
2、R1和R5间使用PPP的PAP认证;
R2与R5之间使用PPP的chap认证,R5为主认证方;
R3与R5之间使用HDLC封装;
3、R1/R2/R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE;
4、整个私有网络基于RIP全网可达;
5、所有PC设置私有IP为源IP,可以访问R5环回。
实验步骤
第一步、规划IP地址
路由器
设备 | 接口IP地址规划 |
R1 | G0/0/0:192.168.1.1/24 S4/0/0:15.1.1.1/24 T0/0/0:10.1.1.1/24 T0/0/1:100.1.1.1/24 |
R2 | G0/0/0:192.168.2.1/24 S4/0/0:25.1.1.2/24 T0/0/0:10.1.1.2/24 |
R3 | G0/0/0:192.168.3.1/24 S4/0/0:35.1.1.3/24 T0/0/0:10.1.1.3/24 |
R4 | G0/0/1:192.168.4.1/24 S4/0/0:45.1.1.4/24 T0/0/1:100.1.1.2/24 |
R5(ISP) | G0/0/0:45.1.1.5/24 S3/0/0:15.1.1.5/24 S3/0/1:25.1.1.5/24 S4/0/0:35.1.1.5/24 LoopBack0:5.5.5./24 |
PC
设备 | 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 |
如图所示:
第二步、配置IP地址
R1
<Huawei>system-view
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int s4/0/0
[R1-Serial4/0/0]ip address 15.1.1.1 24
R2
<Huawei>system-view
[Huawei]sysname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R2-GigabitEthernet0/0/0]int s4/0/0
[R2-Serial4/0/0]ip address 25.1.1.2 24
R3
<Huawei>system-view
[Huawei]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[R3-GigabitEthernet0/0/0]int s4/0/0
[R3-Serial4/0/0]ip address 35.1.1.3 24
R4
<Huawei>system-view
[Huawei]sysname R4
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
[R4-GigabitEthernet0/0/1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 45.1.1.4 24
R5
<Huawei>system-view
[Huawei]sysname ISP
[ISP]int s3/0/0
[ISP-Serial3/0/0]ip address 15.1.1.5 24
[ISP-Serial3/0/0]int s3/0/1
[ISP-Serial3/0/1]ip address 25.1.1.5 24
[ISP-Serial3/0/1]int s4/0/0
[ISP-Serial4/0/0]ip address 35.1.1.5 24
[ISP-Serial4/0/0]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip address 45.1.1.5 24
[ISP-GigabitEthernet0/0/0]int lo0
[ISP-LoopBack0]ip address 5.5.5.5 25
注:需要用串线接口得设备需要加模块,选中设备,右击点击设置进入下面这个界面,把2SA这个模块选中网往上面拖。
第三步、配置缺省路由
指向公网
R1
[R1]ip route-static 0.0.0.0 0 15.1.1.5
R2
[R2]ip route-static 0.0.0.0 0 25.1.1.5
R3
[R3]ip route-static 0.0.0.0 0 35.1.1.5
R4
[R4]ip route-static 0.0.0.0 0 45.1.1.5
第四步、配置NAT
让私网能够访问公网
R1
[R1]acl 2000
[R1-acl-basic-2000]rule 1 permit source any
[R1-acl-basic-2000]q
[R1]int s4/0/0
[R1-Serial4/0/0]nat outbound 2000
R2
[R2]acl 2000
[R2-acl-basic-2000]rule 1 permit source any
[R2-acl-basic-2000]q
[R2]int s4/0/0
[R2-Serial4/0/0]nat outbound 2000
R3
[R3]acl 2000
[R3-acl-basic-2000]rule 1 permit source any
[R3-acl-basic-2000]q
[R3]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000
R4
[R4]acl 2000
[R4-acl-basic-2000]rule 1 permit source any
[R4-acl-basic-2000]q
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]nat outbound 2000
第五步、R1-R5之间PAP认证
R5为主认证方
[ISP]aaa
[ISP-aaa]local-user huawei password cipher 123456
[ISP-aaa]local-user huawei service-type ppp
[ISP-aaa]q
[ISP]int s3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap
R1为被认证方
R1]int s4/0/0
[R1-Serial4/0/0]ppp pap local-user huawei password cipher 123456
第六步、R2-R5之间CHAP认证
R5为主认证方
[ISP]aaa
[ISP-aaa]local-user huawei password cipher 123456
[ISP-aaa]local-user huawei service-type ppp
[ISP-aaa]q
[ISP]int s3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
R2为被认证方
[R2]int s4/0/0
[R2-Serial4/0/0]ppp chap user huawei
[R2-Serial4/0/0]ppp chap password cipher 123456
第七步、R3-R5之间DHLC封装
R5
[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
R3
[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
第八步、R1/R2/R3构建一个MGRE环境
R1为中心站点
[R1]int 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]int 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 Serial 4/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
R3分站点
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip address 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 entry 10.1.1.1 15.1.1.1 register
[R3-Tunnel0/0/0]nhrp network-id 100
第九步、R1、R4构建为点到点的GRE环境
R1配置
[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 100.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
R4配置
[R4]int Tunnel 0/0/1
[R4-Tunnel0/0/1]ip address 100.1.1.4 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 45.1.1.4
[R4-Tunnel0/0/1]destination 15.1.1.1
第十步、配置动态路由RIP
MGRE环境
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
注:MGRE环境需要关闭RIP的水平分割和开启伪广播
R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]undo rip split-horizon
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
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
GRE环境
R1
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 100.0.0.0
R4
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 100.0.0.0
[R4-rip-1]network 192.168.4.0
第十一步、测试全网可达
PC1
PC2
PC3
PC4