首页 > 其他 > 详细

动态路由协议(3)--ospf

时间:2017-12-25 12:21:14      阅读:127      评论:0      收藏:0      [点我收藏+]

技术分享图片

1.设置pc ip 网关

192.168.1.1 192.168.1.254

192.168.4.1 192.168.4.254

2.设置路由器

(1)设置接口ip

Router(config-if)#inter f 0/0
Router(config-if)#ip add 192.168.1.254 255.255.255.0
Router(config-if)#inter f 1/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#inter f 0/0
Router(config-if)#ip ad 192.168.2.2 255.255.255.0
Router(config-if)#inter f 1/0
Router(config-if)#ip add 192.168.3.1 255.255.255.0
Router(config-if)#inter f 0/0
Router(config-if)#ip add 192.168.3.2 255.255.255.0
Router(config-if)#inter f 1/0
Router(config-if)#ip add 192.168.4.254 255.255.255.0

(2)设置动态路由

Router(config)#route ospf 1
Router(config-router)#net 192.168.1.0 0.0.0.255 area 1
Router(config-router)#net 192.168.2.0 0.0.0.255 area 1
Router(config)#route os 1
Router(config-router)#netw 192.168.2.0 0.0.0.255 area 1
Router(config-router)#netw 192.168.3.0 0.0.0.255 area 1
Router(config)#route os 1
Router(config-router)#netw 192.168.3.0 0.0.0.255 area 1
Router(config-router)#netw 192.168.4.0 0.0.0.255 area 1

3.查看路由表

Router#sh ip route 
O    192.168.1.0/24 [110/3] via 192.168.3.1, 00:02:41, FastEthernet0/0
O    192.168.2.0/24 [110/2] via 192.168.3.1, 00:02:41, FastEthernet0/0
C    192.168.3.0/24 is directly connected, FastEthernet0/0
C    192.168.4.0/24 is directly connected, FastEthernet1/0

 

动态路由协议(3)--ospf

原文:http://www.cnblogs.com/excellencesy/p/8108514.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!