HIA综合实验(复习实验)

实验拓扑

 

实验需求

1、R6为ISP,接口IP地址均为公有地址,该设备只能配置IP地址之后不能冉对其进行任何配置

2、R1-R5为局域网,私有Ip地址192.168.1.0/24,请合理分配;

3、R1、R2、R4,各有两个环回IP地址;R5,R6各有一个环回地址;所有路由器上环回均代表连接用户的接口;

4.R3下面的两台Pc通过DHCP自动获取IP地址;

5.选路最佳,路由表尽量小,避免环路;

6、R1-R5均可以访问R6的环回;

7、在R1上配置telnet服务,使R6能通过R5的公有地址telnet到R1上;

8、R4与R5正常通过1000M链路,故障时通过100m链路;

实验思路:

1.配IP

2.配静态路由,实现内网通

3.防环

4.配外网路由,实现全网通

5.R1上做telent服务器,R5做NAT serve

6.更改优先级

实验步骤

1.改名字

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn    
[Huawei]sysname R1

2、配置IP地址(主机位不能为全0或全1(无效地址))


[R1]INT g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[R1-GigabitEthernet0/0/1]int l0
[R1-LoopBack0]ip add 192.168.1.33 28
[R1-LoopBack0]int loo    
[R1-LoopBack0]int loopback1
[R1-LoopBack1]ip add 192.168.1.49 28
[R1-LoopBack1]q
[R1]disp    
[R1]display ip int    
[R1]display ip interface b    
[R1]display ip interface brief 

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
Jul 21 2024 20:26:30-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 g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
Jul 21 2024 20:26:51-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 l0
[R2-LoopBack0]ip add 192.168.1.65 28
[R2-LoopBack0]int l1
[R2-LoopBack1]ip add 192.168.1.81 28
[R2-LoopBack1]q
[R2]dis    
[R2]display ip     
[R2]display ip int b    
[R2]display ip int brief 

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]
[R3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[R3-GigabitEthernet0/0/0]
Jul 21 2024 20:31:52-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]ip add 192.168.1.6 30
Error: The address already exists.
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
Jul 21 2024 20:32:21-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 g0/0/2
[R3-GigabitEthernet0/0/2]ip add 192.168.1.97 27
Jul 21 2024 20:33:13-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R3-GigabitEthernet0/0/2]q

[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
Jul 21 2024 20:35:23-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]ip add 192.168.1.10 30
Error: The address already exists.
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
Jul 21 2024 20:36:00-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 g0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
Jul 21 2024 20:36:23-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 g4/0/0
[R4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
[R4-GigabitEthernet4/0/0]
Jul 21 2024 20:37:01-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 l0
[R4-LoopBack0]ip add 192.168.1.129 28
[R4-LoopBack0]int l1
[R4-LoopBack1]ip add 192.168.1.145 28
[R4-LoopBack1]q
[R4]disp    
[R4]display ip    
[R4]display ip in    
[R4]display ip interface b    
[R4]display ip interface brief 

[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
Jul 21 2024 20:39:12-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 g0/0/2
[R5-GigabitEthernet0/0/2]ip add 192.168.1.22 30
Jul 21 2024 20:39:30-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R5-GigabitEthernet0/0/2]int l0
[R5-LoopBack0]ip add 192.168.1.161 27
[R5-LoopBack0]q
[R5]disp    
[R5]display ip int    
[R5]display ip interface b    
[R5]display ip interface brief 

[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 12.0.0.5 24
 

[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 12.0.0.6 24
[R6-GigabitEthernet0/0/0]
Jul 21 2024 20:42:50-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 l0
[R6-LoopBack0]ip add 1.1.1.6 24
[R6-LoopBack0]q
[R6]disp    
[R6]display ip     
[R6]display ip int    
[R6]display ip interface  b    
[R6]display ip interface  brief 

[R3]dh    
[R3]dhcp e    
[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]netw    
[R3-ip-pool-a]network 192.168.1.96 ma    
[R3-ip-pool-a]network 192.168.1.96 mask 27
[R3-ip-pool-a]g    
[R3-ip-pool-a]gateway-list 192.168.1.97
[R3-ip-pool-a]dns    
[R3-ip-pool-a]dns-list 8.8.8.8(全球通)(114.114.114.114(全国通))

下发

[R3-ip-pool-a]q
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]d    
[R3-GigabitEthernet0/0/2]dhcp s    
[R3-GigabitEthernet0/0/2]dhcp select g    
[R3-GigabitEthernet0/0/2]dhcp select global 
[R3-GigabitEthernet0/0/2]

3.配静态路由

[R1]ip r    
[R1]ip rd-filter
[R1]ip relay
[R1]ip route-s    
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.8 30 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.6
[R1]ip route-static 192.168.1.16 30 192.168.1.6
[R1]ip route-static 192.168.1.16 30 192.168.1.2
[R1]ip route-static 192.168.1.160 27 192.168.1.2
[R1]ip route-static 192.168.1.160 27 192.168.1.6
[R1]ip route-static 192.168.1.20 30 192.168.1.6
[R1]ip route-static 192.168.1.20 30 192.168.1.2
[R1]ip route-static 192.168.1.12 30 192.168.1.6
[R1]ip route-static 192.168.1.96 27 192.168.1.6
[R1]

[R2]ip ro    
[R2]ip route-s    
[R2]ip route-static 192.168.1.128 27 192.168.1.10
[R2]ip route-static 192.168.1.16 30 192.168.1.10
[R2]ip route-static 192.168.1.160 27 192.168.1.10
[R2]ip route-static 192.168.1.20 30 192.168.1.10
[R2]ip route-static 192.168.1.12 30 192.168.1.10
[R2]ip route-static 192.168.1.96 27 192.168.1.10
[R2]ip route-static 192.168.1.96 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.32 27 192.168.1.1
[R2]

[R3]ip ro    
[R3]ip route-s    
[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 192.168.1.8 30 192.168.1.14
[R3]ip route-static 192.168.1.128 27 192.168.1.14
[R3]ip route-static 192.168.1.16 30 192.168.1.14
[R3]ip route-static 192.168.1.160 27 192.168.1.14
[R3]ip route-static 192.168.1.20 30 192.168.1.14
[R3]

[R4]ip ro    
[R4]ip route-s    
[R4]ip route-static 192.168.1.96 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.32 27 192.168.1.13
[R4]ip route-static 192.168.1.32 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.64 27 192.168.1.9
[R4]ip route-static 192.168.1.160 27 192.168.1.18
[R4]ip route-static 192.168.1.160 27 192.168.1.22
[R4]

[R5]ip route-s    
[R5]ip route-static 192.168.1.128 27 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.21
[R5]ip route-static 192.168.1.12 30 192.168.1.21
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.21
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.21
[R5]
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.21
[R5]
[R5]ip route-static 192.168.1.0 30 192.168.1.21
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]
[R5]ip route-static 192.168.1.64 27 192.168.1.21
[R5]ip route-static 192.168.1.64 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.8 30 192.168.1.21
[R5]

测试全网通

4.防环(空接口防环)

[R1]ip route-static 192.168.1.32 27 NULL 0
[R1]

[R2]ip route-static 192.168.1.64 27 NULL 0
[R2]

[R4]IP route-static 192.168.1.128 27 NULL 0
[R4]

5.配外网路由,实现外网通(R5静态缺省)

[R5]ip route-static 0.0.0.0 0 12.0.0.6

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
[R1]

[R2]ip route-static 0.0.0.0 0 192.168.1.10
[R2]

[R3]ip route-static 0.0.0.0 0 192.168.1.14
[R3]

[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
[R4]

7.做Easy IP,让内网可以访问外网

[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5-acl-basic-2000]
[R5-acl-basic-2000]q

下发

[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]nat o    
[R5-GigabitEthernet0/0/1]nat outbound 2000
[R5-GigabitEthernet0/0/1]q
[R5]

测试

[R5]ping -a 192.168.1.161 1.1.1.6

[R5]ping -a 192.168.1.161(R5上的) 1.1.1.6(目的地址)

(原因:华为设备本身不把自己本身上的地址做nat转换(华为设备自身特性导致))

8.R1上做telent服务器

[R1]telnet server enable 
 Error: TELNET server has been enabled
[R1]

[R1]aaa
[R1-aaa]lo    
[R1-aaa]local-user wang p    
[R1-aaa]local-user wang password c    
[R1-aaa]local-user wang password cipher w12345 p    
[R1-aaa]local-user wang password cipher w12345 privilege l    
[R1-aaa]local-user wang password cipher w12345 privilege level 15
Info: Add a new user.
[R1-aaa]local-user wang service-type telnet
[R1-aaa]q

[R1]user-interface vty 0 4

[R1-ui-vty0-4]authentication-mode aaa
[R1-ui-vty0-4]q

9.R5做NAT server,让公网上的用户可以主动访问私网中的telent服务器。

[R5]
[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]nat s    
[R5-GigabitEthernet0/0/1]nat server p    
[R5-GigabitEthernet0/0/1]nat server protocol tcp g    
[R5-GigabitEthernet0/0/1]nat server protocol tcp global cu    
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
    
[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
[R5-GigabitEthernet0/0/1]q
[R5]

测试

10.修改优先级

方法1: 查看路由,那个走的1.22改那个(改明细)

方法2:有缺省改缺省

[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
Info: Succeeded in modifying route.
Jul 21 2024 22:27:09-08:00 R4 %%01RM/4/IPV4_DEFT_RT_CHG(l)[0]:IPV4 default Route
 is changed. (ChangeType=Delete, InstanceId=0, Protocol=Static, ExitIf=GigabitEt
hernet4/0/0, Nexthop=192.168.1.22, Neighbour=0.0.0.0, Preference=1023410176, Lab
el=NULL, Metric=0) 
[R4]
[R4]display ip routing-table protocol static

[R5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.121 permanent
[R5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.121 preference 61
[R5]ip route-static 192.168.1.4 255.255.255.252 192.168.1.121 preference 61
[R5]ip route-static 192.168.1.8 255.255.255.252 192.168.1.121 preference 61
[R5]ip route-static 192.168.1.12 255.255.255.252 192.168.1.121 preference 61
[R5]ip route-static 192.168.1.32 255.255.255.224 192.168.1.121 preference 61
[R5]ip route-static 192.168.1.64 255.255.255.224 192.168.1.121 preference 61
[R5]ip route-static 192.168.1.96 255.255.255.224 192.168.1.121 preference 61
[R5]ip route-static 192.168.1.128 255.255.255.224 192.168.1.121 preference 61
[R5]dis    
[R5]display ip ro    
[R5]display ip routing-table p    
[R5]display ip routing-table protocol st    
[R5]display ip routing-table protocol static 

测试

[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]sh    
 

[R5-GigabitEthernet0/0/0]shutdown 
Jul 21 2024 22:42:22-08:00 R5 %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEthern
et0/0/0 has turned into DOWN state.
[R5-GigabitEthernet0/0/0]
[R5-GigabitEthernet0/0/0]
Jul 21 2024 22:42:22-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the DOWN state. 
[R5-GigabitEthernet0/0/0]

  • 21
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值