静态路由1

1.首先分析需要多少个网段
一个环回需要配置一个独立网段,R1,R2,R4各自有两个环回,R5,R6各自有一个环回,因为R6已经给定了网段,所以需要7个网段;R3也需要一个独立网段连接交换机,此时需要8个网段;骨干链路也需要独立网段,所以一共需要14个网段。因为题目要求路由表尽量小,所以需要汇总,所以把R1、R2、R4的两个两个环回地址汇总一下,变成一个网段;六个骨干链路,每个骨干链路需要2个地址,所以进行地址分配的时候要本着节约地址的原则,所以借出三个网段,所以,只需要6个网段。

2.网址分配

3.实验过程

r1~r6 的地址分配结果

其下的pc用dhcp

然后配置路由信息

给r5 配置NAT

实现:R6 telnet R5 的公有IP地址时,实际登录到R1上

使用NAT的端口映射实现telnetR5的公有IP,实际登录到R1上

<r1>sys
Enter system view, return user view with Ctrl+Z.
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
Mar 18 2024 19:33:13-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
Mar 18 2024 19:33:32-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]int lo1

[r1-LoopBack1]ip address 192.168.1.33 28
[r1-LoopBack1]int lo2

[r1-LoopBack2]ip address 192.168.1.49 28
[r1-LoopBack2]q   
[r1]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/30       up         up        
GigabitEthernet0/0/1              192.168.1.5/30       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack1                         192.168.1.33/28      up         up(s)     
LoopBack2                         192.168.1.49/28      up         up(s)     
NULL0                             unassigned           up         up(s)     
[r1]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<r1>

  Please check whether system data has been changed, 

[Huawei]sys r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
Mar 18 2024 19:35:26-08:00 r2 %%01IFNET/4/LINK_STATE(l)[2]: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]192.168.1.9 30
                         ^
Error: Unrecognized command found at '^' position.
[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
Mar 18 2024 19:35:57-08:00 r2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r2-GigabitEthernet0/0/1]int lo1
[r2-LoopBack1]ip address 192.168.1.65 28
[r2-LoopBack1]int lo2
[r2-LoopBack2]ip address 192.168.1.81 28
[r2-LoopBack2]q
[r2]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.2/30       up         up        
GigabitEthernet0/0/1              192.168.1.9/30       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack1                         192.168.1.65/28      up         up(s)     
LoopBack2                         192.168.1.81/28      up         up(s)     
NULL0                             unassigned           up         up(s)     
[r2]
[r2]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<r2>sys
Enter system view, return user view with Ctrl+Z.
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.

[Huawei]sys r3
[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
[r3-ip-pool-a]q  
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global 
[r3-GigabitEthernet0/0/2]q
[r3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 1
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEthernet0/0/1              unassigned           up         down      
GigabitEthernet0/0/2              unassigned           up         down      
NULL0                             unassigned           up         up(s)     
[r3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 1
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEther

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.14 30
Mar 18 2024 19:48:43-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 g0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.10 30
[r4-GigabitEthernet0/0/1]
Mar 18 2024 19:49:03-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 address 192.168.1.21 30
[r4-GigabitEthernet0/0/2]
Mar 18 2024 19:49:16-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 address 192.168.1.17 30
[r4-GigabitEthernet4/0/0]
Mar 18 2024 19:49:47-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 lo1
[r4-LoopBack1]ip address 192.168.1.129 28
[r4-LoopBack1]int lo2
[r4-LoopBack2]ip address 192.168.1.145 28
[r4-LoopBack2]q
[r4]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 7
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 7
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.14/30      up         up        
GigabitEthernet0/0/1              192.168.1.10/30      up         up        
GigabitEthernet0/0/2              192.168.1.21/30      up         up

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys 5
[5]sys r5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.22 30
[r5-GigabitEthernet0/0/0]
Mar 18 2024 19:50:52-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/1
[r5-GigabitEthernet0/0/1]ip address 12.0.0.1 24
Mar 18 2024 19:51:22-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 g0/0/2
[r5-GigabitEthernet0/0/2]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/2]
Mar 18 2024 19:51:39-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 lo1
[r5-LoopBack1]ip address 192.168.1.161 27
[r5-LoopBack1]q
[r5]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.22/30      up         up        
GigabitEthernet0/0/1              12.0.0.1/24          up         up        
GigabitEthernet0/0/2              192.168.1.18/30      up         up        
LoopBack1                         192.168.1.161/27     up         up(s)     
NULL0                             unassigned           up         up(s)     
[r5]
[r5]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r6
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip address 12.0.0.2 24
Mar 18 2024 19:52:27-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 lo1
[r6-LoopBack1]ip address 1.1.1.1 24
[r6-LoopBack1]q
[r6]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              12.0.0.2/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack1                         1.1.1.1/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
[r6]
[r6]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on
<r6>
<r6>sys
Enter system view, return user view with Ctrl+Z.
[r6]ping 192.168.1.1
  PING 192.168.1.1: 56  data bytes, press CTRL_C to break
    Request time out

配置静态路由
R1:
空接口防环路由:
ip route-static 192.168.1.32 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.10
静态路由:
ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
ip route-static 192.168.1.12 255.255.255.252 192.168.1.10
ip route-static 192.168.1.16 255.255.255.248 192.168.1.2
ip route-static 192.168.1.16 255.255.255.248 192.168.1.10
ip route-static 192.168.1.64 255.255.255.224 192.168.1.2
ip route-static 192.168.1.96 255.255.255.224 192.168.1.10
ip route-static 192.168.1.128 255.255.255.224 192.168.1.2
ip route-static 192.168.1.128 255.255.255.224 192.168.1.10

R2:
空接口防环路由:
ip route-static 192.168.1.64 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
静态路由:
ip route-static 192.168.1.8 255.255.255.252 192.168.1.1
ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
ip route-static 192.168.1.16 255.255.255.248 192.168.1.6
ip route-static 192.168.1.24 255.255.255.248 192.168.1.6
ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
ip route-static 192.168.1.96 255.255.255.224 192.168.1.1
ip route-static 192.168.1.96 255.255.255.224 192.168.1.6
ip route-static 192.168.1.128 255.255.255.224 192.168.1.6

R3:
空接口防环路由:
ip route-static 192.168.1.96 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.9
ip route-static 0.0.0.0 0.0.0.0 192.168.1.14
静态路由:
ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
ip route-static 192.168.1.4 255.255.255.252 192.168.1.14
ip route-static 192.168.1.16 255.255.255.248 192.168.1.14
ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
ip route-static 192.168.1.64 255.255.255.224 192.168.1.9
ip route-static 192.168.1.64 255.255.255.224 192.168.1.14
ip route-static 192.168.1.128 255.255.255.224 192.168.1.14

R1:
空接口防环路由:
ip route-static 192.168.1.32 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
ip route-static 0.0.0.0 0.0.0.0 192.168.1.10
静态路由:
ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
ip route-static 192.168.1.12 255.255.255.252 192.168.1.10
ip route-static 192.168.1.16 255.255.255.248 192.168.1.2
ip route-static 192.168.1.16 255.255.255.248 192.168.1.10
ip route-static 192.168.1.64 255.255.255.224 192.168.1.2
ip route-static 192.168.1.96 255.255.255.224 192.168.1.10
ip route-static 192.168.1.128 255.255.255.224 192.168.1.2
ip route-static 192.168.1.128 255.255.255.224 192.168.1.10

R2:
空接口防环路由:
ip route-static 192.168.1.64 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
静态路由:
ip route-static 192.168.1.8 255.255.255.252 192.168.1.1
ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
ip route-static 192.168.1.16 255.255.255.248 192.168.1.6
ip route-static 192.168.1.24 255.255.255.248 192.168.1.6
ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
ip route-static 192.168.1.96 255.255.255.224 192.168.1.1
ip route-static 192.168.1.96 255.255.255.224 192.168.1.6
ip route-static 192.168.1.128 255.255.255.224 192.168.1.6

R3:
空接口防环路由:
ip route-static 192.168.1.96 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.9
ip route-static 0.0.0.0 0.0.0.0 192.168.1.14
静态路由:
ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
ip route-static 192.168.1.4 255.255.255.252 192.168.1.14
ip route-static 192.168.1.16 255.255.255.248 192.168.1.14
ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
ip route-static 192.168.1.64 255.255.255.224 192.168.1.9
ip route-static 192.168.1.64 255.255.255.224 192.168.1.14
ip route-static 192.168.1.128 255.255.255.224 192.168.1.14

R4:
空接口防环路由:
ip route-static 192.168.1.128 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 61

静态路由:
ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
ip route-static 192.168.1.8 255.255.255.252 192.168.1.13
ip route-static 192.168.1.24 255.255.255.248 192.168.1.13
ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
ip route-static 192.168.1.32 255.255.255.224 192.168.1.13
ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
ip route-static 192.168.1.96 255.255.255.224 192.168.1.13


R5:
空接口防环路由:
ip route-static 192.168.1.160 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
静态路由:
ip route-static 192.168.1.0 27 192.168.1.17
ip route-static 192.168.1.0 27 192.168.1.21 preference 61
ip route-static 192.168.1.32 255.255.255.224 192.168.1.17
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 preference 61
ip route-static 192.168.1.64 255.255.255.192 192.168.1.17
ip route-static 192.168.1.64 255.255.255.192 192.168.1.21 preference 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.17
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 61

r5的配置
[R5]acl 2000
[R5-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255

[R5-acl-basic-2000]int g 0/0/0
[R5-GigabitEthernet0/0/1]nat outbound 2000
端口映射
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface telnet inside 192.168.1.33 telnet
Are you sure to continue?[Y/N]:y

静态路由:
ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
ip route-static 192.168.1.8 255.255.255.252 192.168.1.13
ip route-static 192.168.1.24 255.255.255.248 192.168.1.13
ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
ip route-static 192.168.1.32 255.255.255.224 192.168.1.13
ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
ip route-static 192.168.1.96 255.255.255.224 192.168.1.13


R5:
空接口防环路由:
ip route-static 192.168.1.160 255.255.255.224 NULL0
缺省路由:
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
静态路由:
ip route-static 192.168.1.0 27 192.168.1.17
ip route-static 192.168.1.0 27 192.168.1.21 preference 61
ip route-static 192.168.1.32 255.255.255.224 192.168.1.17

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值