静态路由综合实验

实验要求

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

配置完成

相关推荐
hunandede2 小时前
Ubuntu网络配置(桥接模式, nat模式, host主机模式)
网络·ubuntu·桥接模式
wellnw2 小时前
[Router]路由器常用的后台判断网络ping 可靠公共 IP 地址整理
网络
廿二又2 小时前
http 请求总结get
网络·网络协议·http
Vin0sen2 小时前
xiaomiR4c openwrt
网络
亚远景aspice2 小时前
亚远景-ISO 21434标准下的汽车网络安全测试:全面要求与实施策略
网络·web安全·汽车
忘川8563 小时前
以太网帧结构
网络·物联网·网络协议
IPdodo全球网络服务3 小时前
如何通过TikTok引流到私域流量池
运维·服务器·网络
手心里的白日梦3 小时前
网络层协议--ip协议
网络·网络协议·tcp/ip
IT 古月方源3 小时前
关于高级acl的配置和讲解
运维·开发语言·网络·tcp/ip·智能路由器
开疆智能3 小时前
ModbusTCP转Profinet:工业通信的利器
linux·服务器·网络