一、实验要求
1、 R6为isp,接口Ip地址均为公有地址;该设备只能配置Ip地址,之后不能再对其进行其他任何配置;
2 、R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
3 、R1,R2,R4,各有两个环回地址;R5,R6各有一个环回地址;所有路由器上环回均代表连接用户的接口;
4 、R3下的两台Pc通过DHCP自动获取Ip地址;选路最佳,路由表尽量小,避免环路;
5、R1-R5均可以访问R6的环回;
6 、R6telnetR5的公有Ip地址时,实际登陆到R1上;
7 、R4与R5正常通过1000M链路,故障时通过100M链路;
二、实验目的
1、拓扑
2、需求分析
3、配置
4、验证
三、实验步骤
1、拓扑
2、需求分析
(1)子网划分,配置IP地址
首先将192.168.1.0/24划分为(取其6):
192.168.1.0/27 (骨干) 192.168.1.32/27 192.168.1.64/27 192.168.1.96/27 (R3)
192.168.1.128/27 192.168.1.160/27 (R5环回) 192.168.1.192/27 192.168.1.224/27
将192.168.1.0/27用于骨干网段在此进行划分,避免地址浪费,便于管理直接划分为(取其6):
192.168.1.0/30 192.168.1.4/30 192.168.1.8/30 192.168.1.12/30
192.168.1.16/30 192.168.1.20/30 192.168.1.24/30 192.168.1.128/30
将R1,R2 , R4的网段二次划分为两个环回地址:
R1--192.168.1.32/27:192.168.1.32/28、192.168.1.48/28
R2--192.168.1.64/27 :192.168.1.64/28、192.168.1.80/28
R4--192.168.1.128/27 :192.168.1.128/28、192.168.1.144/28
(2)分配ip地址
(3)开启DHCP服务
(4)填写缺省路由
(5)NAT(一对多)
(6)配置R1、R2、R3的空缺口,避免环路
(7)R4与R5正常通过1000M链路,故障时通过100M链路
(8)R6telnetR5的共有IP地址时,实际登陆到R1上
3、配置
AR1
<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 address 192.168.1.1 30
Mar 18 2024 19:30:46-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
Mar 18 2024 19:32:33-08:00 R1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]int loopback0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]int loopback1
[R1-LoopBack1]ip address 192.168.1.49 28
AR2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.9 30
Mar 18 2024 19:42:29-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.2 30
Mar 18 2024 19:42:46-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R2-GigabitEthernet0/0/1]int loopback0
[R2-LoopBack0]ip address 192.168.1.65 30
[R2-LoopBack0]int loopback1
[R2-LoopBack1]ip address 192.168.1.81 30
AR3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
Mar 18 2024 19:47:03-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
Mar 18 2024 19:47:23-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]int g 0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.97 27
Mar 18 2024 19:47:23-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
AR4
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
Mar 18 2024 19:53:58-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
Mar 18 2024 19:54:11-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R4-GigabitEthernet0/0/1]int g 0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
Mar 18 2024 19:54:25-08:00 R4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R4-GigabitEthernet0/0/2]int g 4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
Mar 18 2024 19:55:12-08:00 R4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state.
[R4-GigabitEthernet4/0/0]int loopback0
[R4-LoopBack0]ip address 192.168.1.129 28
[R4-LoopBack0]int loopback1
[R4-LoopBack1]ip address 192.168.1.145 28
AR5
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
Mar 18 2024 19:58:34-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R5-GigabitEthernet0/0/0]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip address 12.0.0.1 24
Mar 18 2024 19:59:12-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R5-GigabitEthernet0/0/1]int g 0/0/2
[R5-GigabitEthernet0/0/2]ip address 192.168.1.22 30
Mar 18 2024 19:59:33-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R5-GigabitEthernet0/0/2]int loopback0
[R5-LoopBack0]ip address 192.168.1.161 27
AR6
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R6
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip address 12.0.0.2 24
Mar 18 2024 20:04:58-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R6-GigabitEthernet0/0/0]int loopback0
[R6-LoopBack0]ip address 1.1.1.2 24
开启DHCP服务
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip pool a
Info: It's successful to create an IP address pool.
[R3-ip-pool-a]network 192.168.1.96 mask 27
[R3-ip-pool-a]gateway-list 192.168.1.97
[R3-ip-pool-a]dns-list 114.114.114.114 8.8.8.8
[R3-ip-pool-a]int g 0/0/0
[R3-GigabitEthernet0/0/0]dhcp select global
[R3-GigabitEthernet0/0/0]q
PC1
PC2
关闭百兆接口,简化实验
<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]int g 4/0/0
[R4-GigabitEthernet4/0/0]shutdown
Mar 18 2024 21:55:50-08:00 R4 %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEthern
et4/0/0 has turned into DOWN state.
[R4-GigabitEthernet4/0/0]
[R4-GigabitEthernet4/0/0]
Mar 18 2024 21:55:50-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the DOWN state.
[R4-GigabitEthernet4/0/0]
填写缺省路由
<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.8 27 192.168.1.2
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.1.0/27 was generated.
[R1]ip route-static 192.168.1.8 30 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.6
[R1]ip route-static 192.168.1.12 30 192.168.1.6
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 0.0.0.0 0 192.168.1.6
<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]ip route-static 192.168.1.32 27 192.168.1.1
[R2]ip route-static 192.168.1.4 30 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.10
[R2]ip route-static 0.0.0.0 0 192.168.1.10
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]ip route-static 192.168.1.32 27 192.168.1.5
[R3]ip route-static 192.168.1.0 30 192.168.1.5
[R3]ip route-static 192.168.1.64 27 192.168.1.5
[R3]ip route-static 192.168.1.64 27 192.168.1.14
[R3]ip route-static 0.0.0.0 0 192.168.1.14
<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]ip route-static 192.168.1.64 27 192.168.1.9
[R4]ip route-static 192.168.1.0 30 192.168.1.9
[R4]ip route-static 192.168.1.32 27 192.168.1.9
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.4 30 192.168.1.13
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R4]ip route-static 0.0.0.0 0 192.168.1.22
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]ip route-static 192.168.1.128 27 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 0.0.0.0 0 12.0.0.2
NAT
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5-acl-basic-2000]int g 0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
[R5-GigabitEthernet0/0/1]q
配置R1、R2、R3的空缺口
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R3]ip route-static 192.168.1.128 27 NULL 0
R4与R5正常通过1000M链路,故障时通过100M链路
开启百兆接口,将百兆接口的优先级修改为61
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
Info: Succeeded in modifying route.
[R5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 61
R6telnetR5的共有IP地址时,实际登陆到R1上
<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]aaa
[R1-aaa]local-user liuu password cipher 1234
Info: Add a new user.
[R1-aaa]local-user liuu service-type telnet
[R1-aaa]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
[R1-ui-vty0-4]q
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]int g 0/0/1
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
4、验证