静态路由综合实验

实验要求

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、R6 telnet R5的公有地址时,实际登录到R1上;

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

1---4小题如下

1.基于以下要求进行Ip地址划分:

节省IP地址;

便于进行汇总减少我们的出错情况;

网段的划分要合理,如该实验中我们需要划分14个网段,但是实际划分的网段要比我们需要的网段要多一些避免故障发生。

骨干链路 --- 192.168.1.0000 0000

R1-R2 --- 192.168.1.0000 0000 --- 192.168.1.0/30

R2-R4 --- 192.168.1.0000 0100 --- 192.168.1.4/30

R1-R3 --- 192.168.1.0000 1000 --- 192.168.1.8/30

R3-R4 --- 192.168.1.0000 1100 --- 192.168.1.12/30

R4-R5(1000M) --- 192.168.1.0001 0000 --- 192.168.1.16/30

R4-R5(100M) --- 192.168.1.0001 0100 --- 192.168.1.20/30

R1环回 --- 192.168.1.0010 0000

L0 --- 192.168.1.0010 0000 --- 192.168.1.32/28

L1 --- 192.168.1.0011 0000 --- 192.168.1.48/28

R2环回 --- 192.168.1.0100 0000

L0 --- 192.168.1.0100 0000 --- 192.168.1.64/28

L1 --- 192.168.1.0101 0000 --- 192.168.1.80/28

R3子网 --- 192.168.1.0110 0000 --- 192.168.1.96/27

R4环回 --- 192.168.1.1000 0000

L0 --- 192.168.1.1000 0000 --- 192.168.1.128/28

L1 --- 192.168.1.1001 0000 --- 192.168.1.144/28

R5环回 --- 192.168.1.1010 0000 --- 192.168.1.160/27

192.168.1.1100 0000 ---多余

192.168.1.1110 0000 ---多余

结果如图

2.在ensp中对路由器进行配置:

(1)给路由器进行IP地址配置以及环回IP地址配置

R1

改名操作

sysname R1

进入相应接口配置IP

interface GigabitEthernet0/0/0

ip address 192.168.1.1 255.255.255.252

interface GigabitEthernet0/0/1

ip address 192.168.1.5 255.255.255.252

配置环回IP

interface LoopBack0

ip address 192.168.1.33 255.255.255.240

interface LoopBack1

ip address 192.168.1.49 255.255.255.240

R2

改名操作

sysname R2

进入相应接口配置IP

interface GigabitEthernet0/0/0

ip address 192.168.1.9 30

interface GigabitEthernet0/0/1

ip address 192.168.1.2 30

配置环回IP

interface LoopBack0

ip address 192.168.1.65 28

interface LoopBack1

ip address 192.168.1.81 28

R3

改名操作

sysname R3

进入相应接口配置IP

interface GigabitEthernet0/0/0

ip address 192.168.1.6 255.255.255.252

interface GigabitEthernet0/0/1

ip address 192.168.1.13 255.255.255.252

interface GigabitEthernet0/0/2

ip address 192.168.1.97 255.255.255.224

配置环回IP(无)

R4

改名操作

sysname R4

进入相应接口配置IP

interface GigabitEthernet0/0/0

ip address 192.168.1.10 255.255.255.252

interface GigabitEthernet0/0/1

ip address 192.168.1.14 255.255.255.252

interface GigabitEthernet0/0/2

ip address 192.168.1.17 255.255.255.252

interface GigabitEthernet4/0/0

ip address 192.168.1.21 255.255.255.252

配置环回IP

interface LoopBack0

ip address 192.168.1.129 255.255.255.240

interface LoopBack1

ip address 192.168.1.145 255.255.255.240

R5

改名操作

sysname R5

进入相应接口配置IP

interface GigabitEthernet0/0/0

ip address 192.168.1.18 255.255.255.252

interface GigabitEthernet0/0/1

ip address 12.0.0.5 255.255.255.0

nat outbound 2000

interface GigabitEthernet0/0/2

ip address 192.168.1.22 255.255.255.252

配置环回IP

interface LoopBack0

ip address 192.168.1.161 255.255.255.224

R6

改名操作

sysname R6

进入相应接口配置IP

interface GigabitEthernet0/0/0

ip address 12.0.0.6 255.255.255.0

配置环回IP

interface LoopBack0

ip address 1.1.1.6 255.255.255.0

(2)给PC端配置IP地址(使用dhcp服务):

R3

dhcp enable

ip pool aa

gateway-list 192.168.1.97

network 192.168.1.96 mask 255.255.255.224

dns-list 114.114.114.114 8.8.8.8

dhcp select global

然后在实验拓扑图中对PC1与PC2启动dhcp服务

并且在命令行使用ipconfig进行查看

pc1

pc2

3.配置静态路由

R1

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.6

ip route-static 192.168.1.8 255.255.255.252 192.168.1.2

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.252 192.168.1.2

ip route-static 192.168.1.16 255.255.255.252 192.168.1.6

ip route-static 192.168.1.20 255.255.255.252 192.168.1.2

ip route-static 192.168.1.20 255.255.255.252 192.168.1.6

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.6

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.6

ip route-static 192.168.1.160 255.255.255.224 192.168.1.2

ip route-static 192.168.1.160 255.255.255.224 192.168.1.6

R2

ip route-static 0.0.0.0 0.0.0.0 192.168.1.10

ip route-static 192.0.0.0 254.0.0.0 192.168.1.10

ip route-static 192.168.1.4 255.255.255.252 192.168.1.1

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.252 192.168.1.10

ip route-static 192.168.1.20 255.255.255.252 192.168.1.10

ip route-static 192.168.1.32 255.255.255.224 192.168.1.1

ip route-static 192.168.1.64 255.255.255.224 NULL0

ip route-static 192.168.1.96 255.255.255.224 192.168.1.10

ip route-static 192.168.1.96 255.255.255.224 192.168.1.1

ip route-static 192.168.1.128 255.255.255.224 192.168.1.10

ip route-static 192.168.1.160 255.255.255.224 192.168.1.10

R3

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.5

ip route-static 192.168.1.8 255.255.255.252 192.168.1.14

ip route-static 192.168.1.16 255.255.255.252 192.168.1.14

ip route-static 192.168.1.20 255.255.255.252 192.168.1.14

ip route-static 192.168.1.32 255.255.255.224 192.168.1.5

ip route-static 192.168.1.64 255.255.255.224 192.168.1.5

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

ip route-static 192.168.1.160 255.255.255.224 192.168.1.14

R4

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.0.0.0 224.0.0.0 192.168.1.13

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.13

ip route-static 192.168.1.32 255.255.255.224 192.168.1.13

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.96 255.255.255.224 192.168.1.13

ip route-static 192.168.1.128 255.255.255.224 NULL0

ip route-static 192.168.1.160 255.255.255.224 192.168.1.18

ip route-static 192.168.1.160 255.255.255.224 192.168.1.22

R5

ip route-static 0.0.0.0 0.0.0.0 12.0.0.6

ip route-static 192.168.1.0 255.255.255.252 192.168.1.17

ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.4 255.255.255.252 192.168.1.17

ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.8 255.255.255.252 192.168.1.17

ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.12 255.255.255.252 192.168.1.17

ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.16 255.255.255.252 192.168.1.17

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.224 192.168.1.17

ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 61

ip route-static 192.168.1.96 255.255.255.224 192.168.1.17

ip route-static 192.168.1.96 255.255.255.224 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

R6

ip route-static 192.168.1.32 255.255.255.224 NULL0

到此已经解决前4小题!!

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

R1

ip route-static 192.168.1.32 255.255.255.224 NULL0

R2

ip route-static 192.168.1.64. 255.255.255.224 NULL0

R4

ip route-static 192.168.1.128 255.255.255.224 NULL0

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

使用ACL抓取流量

acl number 2000

rule 5 permit source 192.168.1.0 0.0.0.255

配置easyIP访问公网

interface GigabitEthernet0/0/0

ip address 192.168.1.18 255.255.255.252

nat server protocol tcp global current-interface telnet inside 192.168.1.1 teln

et

interface GigabitEthernet0/0/1

ip address 12.0.0.5 255.255.255.0

nat outbound 2000

7、R6 telnet R5的公有地址时,实际登录到R1上;

R1配置telnet

aaa

local-user yb password cipher 123

local-user yb privilege level 15

local-user yb service-type telnet

user-interface vty 0 4

authentication-mode aaa

R5配置端口映射

interface GigabitEthernet0/0/0

ip address 192.168.1.18 255.255.255.252

nat server protocol tcp global current-interface telnet inside 192.168.1.1 teln

et

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

因为静态路由默认优先级为60,所以需要把100M的优先级调大

修改R4静态路由优先级

ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 61

修改R5静态路由优先级

ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.4 255.255.255.252 192.168.1.17

ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.8 255.255.255.252 192.168.1.17

ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.12 255.255.255.252 192.168.1.17

ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 61

ip route-static 192.168.1.16 255.255.255.252 192.168.1.17

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.224 192.168.1.17

ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 61

ip route-static 192.168.1.96 255.255.255.224 192.168.1.17

ip route-static 192.168.1.96 255.255.255.224 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

配置完成

相关推荐
范紫涵-19期-工职大7 分钟前
虚拟机之CentOS、网络设置的有趣问题
linux·网络·centos
TeleostNaCl15 分钟前
OpenWrt | 在 PPP 拨号模式下启用 IPv6 功能
网络·经验分享·智能路由器·ip
bantinghy1 小时前
RPC内核细节(转载)
linux·服务器·网络·网络协议·rpc
我言秋日胜春朝★2 小时前
【Linux网络编程】传输层协议-----UDP协议
linux·网络·udp
Nuyoah11klay4 小时前
华清远见25072班网络编程day1
linux·服务器·网络·网络编程
liulilittle9 小时前
OPENPPP2 —— IP标准校验和算法深度剖析:从原理到SSE2优化实现
网络·c++·网络协议·tcp/ip·算法·ip·通信
北极光SD-WAN组网12 小时前
从0到1搭建某铝箔智慧工厂网络:5G与WiFi 6助力智能制造
网络·5g·制造
阿昭L12 小时前
HTTP原理
网络·网络协议·http
hazy1k13 小时前
STM32H750 RTC介绍及应用
网络·stm32·实时音视频
没书读了13 小时前
考研复习-计算机网络-第三章-数据链路层
网络·计算机网络·考研