OSPF与静态路由的重分布配置
2009-05-09 09:42
239 查看
OSPF与静态路由分布配置
如上例图所示:“RIP与OSPF路由重分布例子”
switchA(config)#router ospf
switchA(config-router)#network 192.168.10.0 0.0.0.255 area 0
switchA(config-router)#network 192.168.20.0 0.0.0.255 area 0
switchA(config-router)#network 192.168.1.0 0.0.0.255 area 0
switchA(config-router)#exit
switchA(config)#end
router(config)#router ospf
router(config-router)#network 192.168.1.0 0.0.0.255 area 0
router(config-router)#network 192.168.2.0 0.0.0.255 area 0
router(config-router)#exit
router(config)#ip route 192.168.30.0 255.255.255.0 192.168.2.1
router(config)#ip route 192.168.40.0 255.255.255.0 192.168.2.1
router(config)#end
switchB(config)#ip route 192.168.10.0 255.255.255.0 192.168.2.2
switchB(config)#ip route 192.168.20.0 255.255.255.0 192.168.2.2
switchB(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
switchB(config)#end
在互连路由器上进行重分布配置,使其两个不同路由协议的网络进行互通
Router(config)#router ospf
Router(config-router)#redistribute static subnets//将OSPF重分布到静态路由
Router(config-router)#exit
Router(config)#end
此例我只是做了把OSPF重分布到静态路由,是因为静态路由本身就是一个明确的邻接路由,因为我们在switchB上已经明确指定静态路由了,所以就没有做相关的重分布配置,话说过来,网络设备也没有提供相就的静态路由重分布的方法。
配置好后:三台设备的路由表情况如下:
Router:
Router#show ip route
Codes: C - connected, S - static, R - RIP B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
Gateway of last resort is no set
C 192.168.1.0/24 is directly connected, FastEthernet 0/0
C 192.168.1.2/32 is local host.
C 192.168.2.0/24 is directly connected, FastEthernet 0/1
C 192.168.2.2/32 is local host.
O 192.168.10.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
O 192.168.20.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
S 192.168.30.0/24 [1/0] via 192.168.2.1
S 192.168.40.0/24 [1/0] via 192.168.2.1
switchA:
switchA#show ip route
Codes: C - connected, S - static, R - RIP B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
Gateway of last resort is no set
C 192.168.1.0/24 is directly connected, FastEthernet 0/1
C 192.168.1.1/32 is local host.
C 192.168.10.0/24 is directly connected, VLAN 10
C 192.168.10.1/32 is local host.
C 192.168.20.0/24 is directly connected, VLAN 20
C 192.168.20.1/32 is local host.
O 192.168.30.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
O 192.168.40.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
O 192.168.2.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
switchB:
switchB#show ip route
Codes: C - connected, S - static, R - RIP B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
Gateway of last resort is no set
C 192.168.2.0/24 is directly connected, FastEthernet 0/1
C 192.168.2.1/32 is local host.
S 192.168.10.0/24 [1/0] via 192.168.2.2
S 192.168.20.0/24 [1/0] via 192.168.2.2
S 192.168.1.0/24 [1/0] via 192.168.2.2
C 192.168.40.0/24 is directly connected, VLAN 20
C 192.168.40.1/32 is local host.根据上述的路由表的分析我们得知OSPF与static的路由重分布成功。
如上例图所示:“RIP与OSPF路由重分布例子”
switchA(config)#router ospf
switchA(config-router)#network 192.168.10.0 0.0.0.255 area 0
switchA(config-router)#network 192.168.20.0 0.0.0.255 area 0
switchA(config-router)#network 192.168.1.0 0.0.0.255 area 0
switchA(config-router)#exit
switchA(config)#end
router(config)#router ospf
router(config-router)#network 192.168.1.0 0.0.0.255 area 0
router(config-router)#network 192.168.2.0 0.0.0.255 area 0
router(config-router)#exit
router(config)#ip route 192.168.30.0 255.255.255.0 192.168.2.1
router(config)#ip route 192.168.40.0 255.255.255.0 192.168.2.1
router(config)#end
switchB(config)#ip route 192.168.10.0 255.255.255.0 192.168.2.2
switchB(config)#ip route 192.168.20.0 255.255.255.0 192.168.2.2
switchB(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
switchB(config)#end
在互连路由器上进行重分布配置,使其两个不同路由协议的网络进行互通
Router(config)#router ospf
Router(config-router)#redistribute static subnets//将OSPF重分布到静态路由
Router(config-router)#exit
Router(config)#end
此例我只是做了把OSPF重分布到静态路由,是因为静态路由本身就是一个明确的邻接路由,因为我们在switchB上已经明确指定静态路由了,所以就没有做相关的重分布配置,话说过来,网络设备也没有提供相就的静态路由重分布的方法。
配置好后:三台设备的路由表情况如下:
Router:
Router#show ip route
Codes: C - connected, S - static, R - RIP B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
Gateway of last resort is no set
C 192.168.1.0/24 is directly connected, FastEthernet 0/0
C 192.168.1.2/32 is local host.
C 192.168.2.0/24 is directly connected, FastEthernet 0/1
C 192.168.2.2/32 is local host.
O 192.168.10.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
O 192.168.20.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
S 192.168.30.0/24 [1/0] via 192.168.2.1
S 192.168.40.0/24 [1/0] via 192.168.2.1
switchA:
switchA#show ip route
Codes: C - connected, S - static, R - RIP B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
Gateway of last resort is no set
C 192.168.1.0/24 is directly connected, FastEthernet 0/1
C 192.168.1.1/32 is local host.
C 192.168.10.0/24 is directly connected, VLAN 10
C 192.168.10.1/32 is local host.
C 192.168.20.0/24 is directly connected, VLAN 20
C 192.168.20.1/32 is local host.
O 192.168.30.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
O 192.168.40.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
O 192.168.2.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0
switchB:
switchB#show ip route
Codes: C - connected, S - static, R - RIP B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
Gateway of last resort is no set
C 192.168.2.0/24 is directly connected, FastEthernet 0/1
C 192.168.2.1/32 is local host.
S 192.168.10.0/24 [1/0] via 192.168.2.2
S 192.168.20.0/24 [1/0] via 192.168.2.2
S 192.168.1.0/24 [1/0] via 192.168.2.2
C 192.168.40.0/24 is directly connected, VLAN 20
C 192.168.40.1/32 is local host.根据上述的路由表的分析我们得知OSPF与static的路由重分布成功。
相关文章推荐
- 静态路由重分布进OSPF
- OSPF、EIGRP、RIP、静态路由的重分布综合试验
- RIP与静态路由重分布的配置
- 24、OSPF配置实验之不规则区域多进程双向重分布
- 【视频】CCNA——路由协议(静态路由协议、RIP、EIGRP、OSPF)的基本配置
- Junos路由器静态路由及动态路由rip和ospf配置测试
- 配置静态路由
- 配置OSPF负载分担
- ospf 相关配置学习
- 静态路由配置示例_难点
- 思科模拟--静态路由配置
- 配置hadoop伪分布
- 配置多区域OSPF和P2MP、P2P帧中继
- 静态路由默认路由的配置
- OSPF理论,OSPF与RIP重分发配置实例
- ipv6 简单配置和动静态路由
- 帧中继配置之静态路由与ospf
- 详解BSCI实验二、配置ospf验证,汇总,虚链路
- NBMA网络上的OSPF运行模式再次总结与配置
- ensp学会配置单区域的OSPF网络