静态路由实验
- 全网所有网段全部基于192.168.1.0/24划分所得
- R1-R4每台设备均有两个环回
- 全网可达
- 尽量减少路由条目,且防止环路
- R5的环回5.5.5.5/24不能出现在其他设备的路由表中

一、ip地址的划分

二、配置端口IP与环回IP地址
R1: Ethernet0/0/0 ip address 192.168.1.1 255.255.255.252
Ethernet0/0/1 ip address 192.168.1.5 255.255.255.252
interface LoopBack1 ip address 192.168.1.33 255.255.255.240
interface LoopBack2 ip address 192.168.1.49 255.255.255.240
R2: Ethernet0/0/0 ip address 192.168.1.2 255.255.255.252#
Ethernet0/0/1 ip address 192.168.1.9 255.255.255.252
interface LoopBack1 ip address 192.168.1.65 255.255.255.240
interface LoopBack2 ip address 192.168.1.81 255.255.255.240
R3: Ethernet0/0/0 ip ddress 192.168.1.10 255.255.255.252
Ethernet0/0/1 ip address 192.168.1.14 255.255.255.252
GigabitEthernet0/0/0 ip address 192.168.1.21 255.255.255.252
GigabitEthernet0/0/1 ip address 192.168.1.17 255.255.255.252
interface LoopBack1 ip address 192.168.1.97 255.255.255.240
interface LoopBack2 ip address 192.168.1.113 255.255.255.240
R4: Ethernet0/0/0 ip address 192.168.1.13 255.255.255.252
Ethernet0/0/1 ip address 192.168.1.6 255.255.255.252
interface LoopBack1 ip address 192.168.1.129 255.255.255.240
interface LoopBack2 ip address 192.168.1.145 255.255.255.240
R5: Ethernet0/0/0 ip address 192.168.1.22 255.255.255.252
Ethernet0/0/1 ip address 192.168.1.18 255.255.255.252
interface LoopBack1 ip address 5.5.5.5 255.255.255.0
三、配置静态路由,添加缺省路由

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.64 255.255.255.224 192.168.1.2
ip route-static 192.168.1.96 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.6

R2:
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.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.32 255.255.255.224 192.168.1.1
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.1
ip route-static 192.168.1.128 255.255.255.224 192.168.1.10

R3:
ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
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.9
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.9
ip route-static 192.168.1.128 255.255.255.224 192.168.1.13

R4:
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.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.96 255.255.255.224 192.168.1.14

R5:
ip route-static 192.168.1.0 255.255.255.252 192.168.1.17
ip route-static 192.168.1.4 255.255.255.252 192.168.1.17
ip route-static 192.168.1.8 255.255.255.252 192.168.1.17
ip route-static 192.168.1.12 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.64 255.255.255.224 192.168.1.17
ip route-static 192.168.1.96 255.255.255.224 192.168.1.17
ip route-static 192.168.1.128 255.255.255.224 192.168.1.17

查看已配置的端口IP





查看已配置的静态路由





测试直连


目前全网可达
三,备份


空接口防环路由




关闭R3 g0/0/1 端口,使其走千兆路线

打开则又走百兆



该博客围绕静态路由实验展开,全网网段基于192.168.1.0/24划分,R1 - R4各有两个环回。实验步骤包括IP地址划分、配置端口与环回IP、配置静态路由并添加缺省路由,还涉及备份、空接口防环路由等操作,最终实现全网可达。
2916





