标签:静态路由 标准 存在 接口 inf src info com ethernet
静态路由通过管理员在网络设备敲静态路由手动添加路由条目 这个路由条目会放到路由表当中 当路由表里面有了这个路由后 网络设备会根据这条已存在的路由进行转发interface GigabitEthernet0/0/0
ip address 192.168.12.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.1.254 255.255.255.0
R2
interface GigabitEthernet0/0/0
ip address 192.168.12.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.23.2 255.255.255.0
R3
interface GigabitEthernet0/0/0
ip address 192.168.23.3 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.34.3 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 192.168.2.254 255.255.255.0
R4
interface GigabitEthernet0/0/0
ip address 192.168.34.4 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.3.254 255.255.255.0
静态路由的配置
静态路由标准配法
[R2]ip route-static X.X.X.X mask 出接口 下一跳
R1
配置到达192.168.2.0/24与192.168.3.0/24网段静态路由
[R1]ip route-static 192.168.2.0 24 GigabitEthernet 0/0/0 192.168.12.2
[R1]ip route-static 192.168.3.0 24 GigabitEthernet 0/0/0 192.168.12.2
R2
配置到达192.168.1.0/24 192.168.2.0/24与192.168.3.0/24网段静态路由
[R2]ip route-static 192.168.1.0 24 GigabitEthernet 0/0/0 192.168.12.1
[R2]ip route-static 192.168.2.0 24 GigabitEthernet 0/0/1 192.168.23.3
[R2]ip route-static 192.168.3.0 24 GigabitEthernet 0/0/1 192.168.23.3
R3
配置到达192.168.1.0/24与192.168.3.0/24网段静态路由
[R3]ip route-static 192.168.1.0 24 GigabitEthernet 0/0/0 192.168.23.2
[R3]ip route-static 192.168.3.0 24 GigabitEthernet 0/0/1 192.168.34.4
R4
配置到达192.168.1.0/24 192.168.2.0/24网段静态路由
[R4]ip route-static 192.168.1.0 24 GigabitEthernet 0/0/0 192.168.34.3
[R4]ip route-static 192.168.2.0 24 GigabitEthernet 0/0/0 192.168.34.3
检查R1路由表
用pc1--ping--pc2
用pc1--ping--pc3
用pc2--ping--pc3
标签:静态路由 标准 存在 接口 inf src info com ethernet
原文地址:https://blog.51cto.com/14845166/2505123