免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1597 | 回复: 0
打印 上一主题 下一主题

[Note] OSPF default-metric cost命令实现细节 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-11 11:36 |只看该作者 |倒序浏览

default-metric cost


结论:
1>除BGP重分布后metric为1,其它路由协议都默认为20。
2>default-metric cost命令影响所有路由协议重分布过来的metric,包括静态路由。
3>直连路由不受default-metric cost命令影响。
3>所有路由(静态、动态、直连)都受redistribute metric影响。




r1#sh run
Building configuration...
Current configuration : 1024 bytes
!
interface Serial1/0
description conn_to_r2_s1/0_192.168.1.2
ip address 192.168.1.1 255.255.255.0
serial restart-delay 0
!
router ospf 100
router-id 10.0.0.1
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
---------------------------------------------
r2#sh run
Building configuration...
Current configuration : 1393 bytes
!
interface Loopback0
ip address 1.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
ip address 2.2.2.2 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
description conn_to_r1_s1/0_192.168.1.1
ip address 192.168.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
description conn_to_r3_s1/0_192.168.2.2
ip address 192.168.2.1 255.255.255.0
serial restart-delay 0
!
router ospf 100
router-id 10.0.0.2
log-adjacency-changes
redistribute connected metric 33 subnets
redistribute static subnets
redistribute rip subnets
network 192.168.1.0 0.0.0.255 area 0
default-metric 7
!
router rip
version 2
network 192.168.2.0
no auto-summary
!
ip route 3.3.3.0 255.255.255.0 Serial1/1
-----------------------------------------------
r3#sh run
Building configuration...
Current configuration : 1299 bytes
!
interface Loopback0
ip address 5.5.5.5 255.255.255.0
!
interface Loopback1
ip address 6.6.6.6 255.255.255.0
!
interface Loopback81
ip address 3.3.3.3 255.255.255.0
!
interface Serial1/0
description conn_to_r2_s1/1_192.168.2.1
ip address 192.168.2.2 255.255.255.0
serial restart-delay 0
no dce-terminal-timing-enable
!
router rip
version 2
network 5.0.0.0
network 6.0.0.0
network 192.168.2.0
no auto-summary
----------------------------------------------------
r1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, 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, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/33] via 192.168.1.2, 00:15:37, Serial1/0
     2.0.0.0/24 is subnetted, 1 subnets
O E2    2.2.2.0 [110/33] via 192.168.1.2, 00:15:37, Serial1/0
     3.0.0.0/24 is subnetted, 1 subnets

//直连路由
O E2    3.3.3.0 [110/7] via 192.168.1.2, 00:12:03, Serial1/0
     5.0.0.0/24 is subnetted, 1 subnets

//静态路由
O E2    5.5.5.0 [110/7] via 192.168.1.2, 00:12:03, Serial1/0
     6.0.0.0/24 is subnetted, 1 subnets
O E2    6.6.6.0 [110/7] via 192.168.1.2, 00:12:03, Serial1/0
C    192.168.1.0/24 is directly connected, Serial1/0

//动态路由
O E2 192.168.2.0/24 [110/33] via 192.168.1.2, 00:15:37, Serial1/0
//直连路由

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/27493/showart_526768.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP