- 实验拓扑
- 实验要求
- R6为ISP,接口IP地址均为公有地址,该设备只能配置IP地址之后不能冉对其进行任何配置。
- R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配。
- R1、R2、R4,各有两个环回IP地址;R5,R6各有一个环回地址;所有路由器上环回均代表连接用户的接口。
- R3下面的两台PC通过DHCP自动获取IP地址。
- 选路最佳,路由表尽量小,避免环路。
- R1-R5均可以访问R6的环回。
- 在R1上配置te1net服务,使R6能通过R5的公有地址te1net到R1上。
- R4与R5正常通过1000M链路,故障时通过100m链路。
- 实验思路
- R1-R4各有环回加上骨干链路,共划分6个网段
所以: 骨干链路--192.168.1.0 27
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
- R1--192.168.1.32 27
L0:192.168.1.32 28
L1:192.168.1.48 28
- R2--192.168.1.64 27
L0:192.186.1.64 28
L1:192.168.1.80 28
- R3--192.168.1.96 27
- R4--192.168.1.128 27
L0:192.168.1.128 28
L1:192.168.1.144 28
- R5:192.168.1.160 27
- 配置R1-R5的IP地址
- 写静态路由到目标网段
- 配置DHCP,使R3下面的两台PC通过DHCP自动获取IP地址
- R1-R4不能直接到达12.0.0.0/24,配置缺省路由
- 写防环
- R4与R5正常通过1000M链路,故障时通过100m链路
- 实验步骤
R1
1.<Huawei>sys
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[R1]int loopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]int loopBack 1
[R1-LoopBack1]ip address 192.168.1.49 28
[R1-LoopBack1]quit
R2
<Huawei>SYS
[Huawei]SYSname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[R2]int loopBack 0
[R2-LoopBack0]ip address 192.168.1.65 28
[R2-LoopBack0]int LoopBack 1
[R2-LoopBack1]ip address 192.168.1.81 28
[R2-LoopBack1]quit
R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.97 28
R4
<Huawei>sys
[Huawei]sysname R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[R4-GigabitEthernet0/0/2]int g4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[R4-LoopBack0]ip address 192.168.1.128 28
[R4-LoopBack0]int LoopBack 1
[R4-LoopBack1]ip address 192.168.1.144 28
[R4-LoopBack1]quit
R5
<Huawei>sys
[Huawei]sysname R5
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
[R5-LoopBack0]ip address 192.168.1.160 28
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]ip add 12.0.0.1 24
R6
<Huawei>sys
[Huawei]sysname R6
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip address 12.0.0.2 24
[R6-GigabitEthernet0/0/0]int l0
[R6-LoopBack0]ip add 1.0.0.2 24
[R6-LoopBack0]quit
2配置R3的DHCP
[R3]dhcp enable
[R3]ip pool aa
[R3-ip-pool-aa]network 192.168.1.96 mask 27
[R3-ip-pool-aa]gateway-list 192.168.1.97
[R3-ip-pool-aa]dns-list 8.8.8.8
[R3-ip-pool-aa]quit
然后下发dhcp
[R3]
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
[R3-GigabitEthernet0/0/2]quit
然后PC进行检查
- 配置每个设备的静态路由
【R1】
【R2】
[R3]
[R4]
[R5]
进行检测
- 给每个路由器进行防环
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R4]ip route-static 192.168.1.128 27 NULL 0
- 使外网联通
给R5配置静态缺省
[R5]ip route-static 0.0.0.0 0 12.0.0.2
6.配置easy IP,使R1-R5均可以访问R6的环回
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5-acl-basic-2000]quit
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]nat outbound 2000
[R5-GigabitEthernet0/0/2]quit
7.使内网可以通过12.0.0.0的网段进入外网
[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]ip route-static 0.0.0.0 0 192.168.1.10
[R3]ip route-static 0.0.0.0 0 192.168.1.14
[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
- 配置远程登录服务
[R1]telnet server enable
Error: TELNET server has been enabled
[R1]aaa
[R1-aaa]local-user wangyeye password cipher wyy123 privilege level 15
[R1-aaa]local-user wangyeye service-type telnet
[R1-aaa]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
[R1-ui-vty0-4]quit
[R1]
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]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
[R5-GigabitEthernet0/0/2]quit
[R5]
- 更改路由优先级
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 66
然后在R1进行检查
最后在R6上进行登录