静态路由实验
静态路由是指由管理员手动配置的路由。
配置格式:
ip route 目的网络地址 子网掩码 下一跳主机地址(下个路由的进接口)
ip route 目的网络地址 子网掩码 路由器本身出接口
实验过程:
- 首先这个实验中分为四个网段,其中有12个接口。交换机本身三个接口与其相连路由器上的三个接口应属于一个网段。
- 该实验 网段分为173.3.3.64/26 173.3.3.0/28 173.3.3.128/26 173.3.3.192/26
- 各接口如图所示。
R1配置代码:
interface fa0/0
no shutdown
ip address 173.3.3.66 255.255.255.192
exit
interface fa1/0
no shutdown
ip address 173.3.3.1 255.255.255.240
exit
ip route 173.3.3.128 255.255.255.192 173.3.3.5
ip route 173.3.3.192 255.255.255.192 173.3.3.6
show ip route
R1配置结果:
R2配置代码:
interface fa0/0
no shutdown
ip address 173.3.3.130 255.255.255.192
exit
interface fa1/0
no shutdown
ip address 173.3.3.5 255.255.255.240
exit
ip route 173.3.3.64 255.255.255.192 173.3.3.1
ip route 173.3.3.192 255.255.255.192 173.3.3.6
show ip route
R2配置结果:
R3配置代码:
interface fa0/0
no shutdown
ip address 173.3.3.6 255.255.255.240
exit
interface fa1/0
no shutdown
ip address 173.3.3.194 255.255.255.192
exit
ip route 173.3.3.64 255.255.255.192 173.3.3.1
ip route 173.3.3.128 255.255.255.192 173.3.3.5
show ip route
R3配置结果:
注意事项:
1.PC端必须配置网关。
2.路由接口配置时,注意子网掩码与网段子网掩码一致。