实验作业1

文章详细描述了在路由器R1至R6的网络环境中,如何根据需求规划IP地址,汇总网段以减小路由表,以及配置静态路由以实现空接口防环。涉及DHCP服务器的设置和端口映射等内容。
摘要由CSDN通过智能技术生成

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

2.网址分析

3.实验拓补图

4.配置

r1的

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

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]ip address 192.168.1.9 30

[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]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 1Interface                         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)     

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]int g0/0/2

[r4-GigabitEthernet0/0/2]ip address 192.168.1.21 30

[r4-GigabitEthernet0/0/2]int g4/0/0 

[r4-GigabitEthernet4/0/0]ip address 192.168.1.17 30

[r4-GigabitEthernet4/0/0]int lo1

[r4-LoopBack1]ip address 192.168.1.129 28

[r4-LoopBack2]ip address 192.168.1.145 28

[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     

   

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

[r5-GigabitEthernet0/0/1]int g0/0/2

[r5-GigabitEthernet0/0/2]ip address 192.168.1.18 30

[r5-GigabitEthernet0/0/2]int lo1

[r5-LoopBack1]ip address 192.168.1.161 27

[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)     

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]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)     

r3底下的pc要dhcp

[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

配置静态路由

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值