静态路由

  • Post author:
  • Post category:其他




一、实验拓扑要求

在这里插入图片描述



二、实验思路

地址规划,子网划分–配置接口IP,写环回IP–写静态路由–写缺省路由–写空接扣路由–写浮动静态路由



三、实验步骤


1、地址规划(子网划分192.168.1.0/24)

192.168.1.0/27骨干
	192.168.1.0/30
	192.168.1.4/30
	192.168.1.8/30
	192.168.1.12/30
	192.168.1.16/30
	192.168.1.20/30

192.168.1.32/27R1
	192.168.1.32/29
	192.168.1.40/29

192.168.1.64/27R2
	192.168.1.64/29
	192.168.1.72/29

192.168.1.96/27R3
	192.168.1.96/29
	192.168.1.112/29

192.168.1.128/27R4
	192.168.1.128/29
	192.168.1.140/29

在这里插入图片描述


2、 配置接口IP地址,写环回地址

R1
	[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
	[r1-GigabitEthernet0/0/1]ip address 192.168.1.9 30
	[r1-LoopBack0]ip address 192.168.1.33 29
	[r1-LoopBack1]ip address 192.168.1.41 29
R2
	[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
	[r2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
	[r2-LoopBack0]ip address 192.168.1.65 29
	[r2-LoopBack1]ip address 192.168.1.73 29
R3
	[r3-GigabitEthernet0/0/0]ip address 192.168.1.10 30
	[r3-GigabitEthernet0/0/1]ip address 192.168.1.14 30
	[r3-LoopBack0]ip address 192.168.1.97 29
	[r3-LoopBack1]ip address 192.168.1.113 29
R4
	[r4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
	[r4-GigabitEthernet0/0/1]ip address 192.168.1.13 30
	[r4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
	[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
	[r4-LoopBack0]ip address 192.168.1.129 29
	[r4-LoopBack1]ip address 192.168.1.141 29
R5
	[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
	[r5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
	[r5-LoopBack0]ip address 5.5.5.5 24


3、写静态路由

R1:
	[r1]IP route-static 192.168.1.64 27 g0/0/0 192.168.1.2
	[r1]IP route-static 192.168.1.4 30 g0/0/0 192.168.1.2
	[r1]IP route-static 192.168.1.128 27 g0/0/0 192.168.1.2
	[r1]IP route-static 192.168.1.128 27 g0/0/1 192.168.1.10
	[r1]IP route-static 192.168.1.12 30 g0/0/1 192.168.1.10
	[r1]IP route-static 192.168.1.96 27 g0/0/1 192.168.1.10
	[r1]ip route-static 192.168.1.16 30 g0/0/0 192.168.1.2
R2:
	[r2]ip route-static 192.168.1.32 27 g0/0/0 192.168.1.1
	[r2]ip route-static 192.168.1.8 30 g0/0/0 192.168.1.1
	[r2]ip route-static 192.168.1.96 27 g0/0/0 192.168.1.1
	[r2]ip route-static 192.168.1.96 27 g0/0/1 192.168.1.6
	[r2]ip route-static 192.168.1.128 27 g0/0/1 192.168.1.6
	[r2]ip route-static 192.168.1.12 30 g0/0/1 192.168.1.6
	[r2]ip route-static 192.168.1.16 30 g0/0/1 192.168.1.6
R3:
	[r3]ip route-static 192.168.1.32 27 g0/0/0 192.168.1.9
	[r3]ip route-static 192.168.1.0 30 g0/0/0 192.168.1.9
	[r3]ip route-static 192.168.1.64 27 g0/0/0 192.168.1.9
	[r3]ip route-static 192.168.1.128 27 g0/0/1 192.168.1.13
	[r3]ip route-static 192.168.1.4 30 g0/0/1 192.168.1.13
	[r3]ip route-static 192.168.1.64 27 g0/0/1 192.168.1.13
	[r3]ip route-static 192.168.1.16 30 g0/0/1 192.168.1.13
R4:
	[r4]ip route-static 192.168.1.64 27 g0/0/0 192.168.1.5
	[r4]ip route-static 192.168.1.0 30 g0/0/0 192.168.1.5
	[r4]ip route-static 192.168.1.32 27 g0/0/0 192.168.1.5
	[r4]ip route-static 192.168.1.32 27 g0/0/1 192.168.1.14
	[r4]ip route-static 192.168.1.8 30 g0/0/1 192.168.1.14
	[r4]ip route-static 192.168.1.96 27 g0/0/1 192.168.1.14
写到这里,R1-R4之间全部可以通,相当于打通了内部网络

4、写缺省路由(R1-R4上不能直接写到5.5.5.0/24的路由,要到达5.5.5.0/24就要写缺省路由)

[r4]ip route-static 0.0.0.0 0 g0/0/2 192.168.1.18
[r1]ip route-static 0.0.0.0 0 g0/0/0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 g0/0/1 192.168.1.10
[r2]ip route-static 0.0.0.0 0 g0/0/1 192.168.1.6
[r3]ip route-static 0.0.0.0 0 g0/0/1 192.168.1.13
此时R1,R2,R3ping不通5.5.5.5,因为R5没有写回来的路由
给R5写回来的静态路由,此时全通
	[r5]ip route-static 192.168.1.128 27 g0/0/0 192.168.1.17
	[r5]ip route-static 192.168.1.12 30 g0/0/0 192.168.1.17
	[r5]ip route-static 192.168.1.96 27 g0/0/0 192.168.1.17
	[r5]ip route-static 192.168.1.8 30 g0/0/0 192.168.1.17
	[r5]ip route-static 192.168.1.32 27 g0/0/0 192.168.1.17
	[r5]ip route-static 192.168.1.0 30 g0/0/0 192.168.1.17
	[r5]ip route-static 192.168.1.64 27 g0/0/0 192.168.1.17
	[r5]ip route-static 192.168.1.4 30 g0/0/0 192.168.1.17


5、避免环路出现,写空接口路由

[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r3]ip route-static 192.168.1.96 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0


6、R4到R5之间正常1000M通信,故障时100M通信

R5
	[r5]ip route-static 192.168.1.0 255.255.255.252 GigabitEthernet0/0/1 192.168.1.21 pr 61
	[r5]ip route-static 192.168.1.4 255.255.255.252 GigabitEthernet0/0/1 192.168.1.21 pr 61
	[r5]ip route-static 192.168.1.8 255.255.255.252 GigabitEthernet0/0/1 192.168.1.21 pr 61
	[r5]ip route-static 192.168.1.12 255.255.255.252 GigabitEthernet0/0/1 192.168.1.21 pr 61
	[r5]ip route-static 192.168.1.32 255.255.255.224 GigabitEthernet0/0/1 192.168.1.21 pr 61
	[r5]ip route-static 192.168.1.64 255.255.255.224 GigabitEthernet0/0/1 192.168.1.21 pr 61
	[r5]ip route-static 192.168.1.96 255.255.255.224 GigabitEthernet0/0/1 192.168.1.21 pr 61
	[r5]ip route-static 192.168.1.128 255.255.255.224 GigabitEthernet0/0/1 192.168.1.21 pr 61
R4
	[r4]ip route-static 0.0.0.0 0 g4/0/0 192.168.1.22 preference 61



版权声明:本文为qq_54245355原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。