查看完整版本: OE2路由选路

雷风88 2007-11-12 12:57

OE2路由选路

[size=3][font=Times New Roman][img=758,568]http://www.one-tom.com/bbs/uploads/20070328_031406_aa.jpg[/img]
[size=3][font=Times New Roman]R1[/font][font=宋体]:[/font][/size]
[font=Times New Roman][size=3]hostname r1[/size][/font]
[font=Times New Roman][size=3]interface Loopback0[/size][/font]
[font=Times New Roman][size=3]
ip address 1.1.1.1 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]
ip ospf network point-to-point[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]nterface Serial1/0[/size][/font]
[font=Times New Roman][size=3]
ip address 12.1.1.1 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]interface Serial2/0[/size][/font]
[font=Times New Roman][size=3]
ip address 13.1.1.1 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]router ospf 10[/size][/font]
[font=Times New Roman][size=3]
router-id 1.1.1.1[/size][/font]
[font=Times New Roman][size=3]
log-adjacency-changes[/size][/font]
[font=Times New Roman][size=3]
network 12.1.1.0 0.0.0.255 area 0[/size][/font]
[font=Times New Roman][size=3]
network 13.1.1.0 0.0.0.255 area 0[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[size=3][font=Times New Roman]R2[/font][font=宋体]:[/font][/size]
[font=Times New Roman][size=3]hostname r2[/size][/font]
[font=Times New Roman][size=3]interface Loopback0[/size][/font]
[font=Times New Roman][size=3]
ip address 2.2.2.2 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]ip ospf network point-to-point![/size][/font]
[font=Times New Roman][size=3]interface Ethernet0/0[/size][/font]
[font=Times New Roman][size=3]
no ip address[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]interface Ethernet0/0.1[/size][/font]
[font=Times New Roman][size=3]
encapsulation dot1Q 24[/size][/font]
[font=Times New Roman][size=3]
ip address 24.1.1.2 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]
ip ospf network point-to-point[/size][/font]
[font=Times New Roman][size=3]interface Serial2/0[/size][/font]
[font=Times New Roman][size=3]
ip address 12.1.1.2 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]router ospf 10[/size][/font]
[font=Times New Roman][size=3]
router-id 2.2.2.2[/size][/font]
[font=Times New Roman][size=3]
log-adjacency-changes[/size][/font]
[font=Times New Roman][size=3]
network 12.1.1.0 0.0.0.255 area 0[/size][/font]
[font=Times New Roman][size=3]
network 24.1.1.0 0.0.0.255 area 0[/size][/font]
[size=3][font=Times New Roman]R3[/font][font=宋体]:[/font][/size]
[font=Times New Roman][size=3]hostname r3[/size][/font]
[font=Times New Roman][size=3]interface Loopback0[/size][/font]
[font=Times New Roman][size=3]
ip address 3.3.3.3 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]
ip ospf network point-to-point[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]interface Ethernet0/0[/size][/font]
[font=Times New Roman][size=3]
no ip address[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]interface Ethernet0/0.2[/size][/font]
[font=Times New Roman][size=3]
encapsulation dot1Q 34[/size][/font]
[font=Times New Roman][size=3]
ip address 34.1.1.3 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]
ip ospf network point-to-point[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]interface Serial1/0[/size][/font]
[font=Times New Roman][size=3]
ip address 13.1.1.3 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]
router ospf 10[/size][/font]
[font=Times New Roman][size=3]
router-id 3.3.3.3[/size][/font]
[font=Times New Roman][size=3]
log-adjacency-changes[/size][/font]
[font=Times New Roman][size=3]
network 13.1.1.0 0.0.0.255 area 0[/size][/font]
[font=Times New Roman][size=3]
network 34.1.1.0 0.0.0.255 area 0[/size][/font]
[size=3][font=Times New Roman]R4[/font][font=宋体]:[/font][/size]
[font=Times New Roman][size=3]hostname r4[/size][/font]
[font=Times New Roman][size=3]interface Loopback0[/size][/font]
[font=Times New Roman][size=3]
ip address 4.4.4.4 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]
ip ospf network point-to-point[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]interface Ethernet0/0.1[/size][/font]
[font=Times New Roman][size=3]
encapsulation dot1Q 24[/size][/font]
[font=Times New Roman][size=3]
ip address 24.1.1.4 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]
ip ospf network point-to-point[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[font=Times New Roman][size=3]interface Ethernet0/0.2[/size][/font]
[font=Times New Roman][size=3]
encapsulation dot1Q 34[/size][/font]
[font=Times New Roman][size=3]
ip address 34.1.1.4 255.255.255.0[/size][/font]
[font=Times New Roman][size=3]
ip ospf network point-to-point[/size][/font]
[font=Times New Roman][size=3]router ospf 10[/size][/font]
[font=Times New Roman][size=3]
router-id 4.4.4.4[/size][/font]
[font=Times New Roman][size=3]
log-adjacency-changes[/size][/font]
[size=3][font=Times New Roman]
redistribute connected subnets
[/font][font=宋体]在[/font][font=Times New Roman]R4[/font][font=宋体]上将外部路由重发布进[/font][font=Times New Roman]OSPF[/font][/size]
[font=Times New Roman][size=3]
network 24.1.1.0 0.0.0.255 area 0[/size][/font]
[font=Times New Roman][size=3]
network 34.1.1.0 0.0.0.255 area 0[/size][/font]
[font=Times New Roman][size=3]![/size][/font]
[size=3][font=宋体]在[/font][font=Times New Roman]R1[/font][font=宋体]上红字部分显示通过[/font][b][color=red][font=Times New Roman]via 12.1.1.2 [/font][/color][/b][b][color=red][font=宋体]和[/font][/color][/b][font=Times New Roman][b][color=red]via 13.1.1.3[/color][/b]
[/font][font=宋体]同时学到了[/font][font=Times New Roman]R4[/font][font=宋体]的外部路由因为都是[/font][font=Times New Roman]OE2[/font][font=宋体],[/font][font=Times New Roman]COST[/font][font=宋体]值都为[/font][font=Times New Roman]20 [/font][/size]
[font=Times New Roman][size=3]r1#show ip route[/size][/font]
[font=Times New Roman][size=3]34.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]O
34.1.1.0 [110/74] via 13.1.1.3, 00:08:30, Serial2/0[/size][/font]
[font=Times New Roman][size=3]
1.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]C
1.1.1.0 is directly connected, Loopback0[/size][/font]
[font=Times New Roman][size=3]
4.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]O E2
4.4.4.0 [110/20] [b][color=red]via 12.1.1.2[/color][/b][color=red],[/color] 00:08:30, Serial1/0[/size][/font]
[font=Times New Roman][size=3]
[110/20] [b][color=red]via 13.1.1.3[/color][/b], 00:08:30, Serial2/0[/size][/font]
[font=Times New Roman][size=3]
24.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]O
24.1.1.0 [110/74] via 12.1.1.2, 00:08:30, Serial1/0[/size][/font]
[font=Times New Roman][size=3]
12.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]C
12.1.1.0 is directly connected, Serial1/0[/size][/font]
[font=Times New Roman][size=3]
13.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]C
13.1.1.0 is directly connected, Serial2/0[/size][/font]
[size=3][font=宋体]现在我从[/font][font=Times New Roman]R1[/font][font=宋体]到[/font][font=Times New Roman]4.4.4.4[/font][font=宋体]时如果是基于数据包的时候那么它会一边走一个数据包:[/font][/size]
[font=Times New Roman][size=3]r1#show ip route 4.4.4.0[/size][/font]
[font=Times New Roman][size=3]Routing entry for 4.4.4.0/24[/size][/font]
[font=Times New Roman][size=3]
Known via "ospf 10", distance 110, metric 20, type extern 2, forward metric 74[/size][/font]
[font=Times New Roman][size=3]
Last update from 13.1.1.3 on Serial2/0, 00:17:41 ago[/size][/font]
[font=Times New Roman][size=3]
Routing Descriptor Blocks:[/size][/font]
[font=Times New Roman][size=3]
* 12.1.1.2, from 4.4.4.4, 00:17:41 ago, via Serial1/0[/size][/font]
[font=Times New Roman][size=3]
Route metric is 20, traffic share count is 1[/size][/font]
[font=Times New Roman][size=3]
13.1.1.3, from 4.4.4.4, 00:17:41 ago, via Serial2/0[/size][/font]
[font=Times New Roman][size=3]
Route metric is 20, traffic share count is 1[/size][/font]
[size=3][font=宋体]可以看到下一跳的路径为[/font][font=Times New Roman]* 12.1.1.2[/font][/size]
[font=Times New Roman][size=3]r1#ping 4.4.4.4 [/size][/font]
[font=Times New Roman][size=3] [/size][/font]
[font=Times New Roman][size=3]Type escape sequence to abort.[/size][/font]
[font=Times New Roman][size=3]Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:[/size][/font]
[font=Times New Roman][size=3]!!!!![/size][/font]
[font=Times New Roman][size=3]Success rate is 100 percent (5/5), round-trip min/avg/max = 40/56/80 ms[/size][/font]
[font=Times New Roman][size=3]r1#show ip route 4.4.4.0 [/size][/font]
[font=Times New Roman][size=3]Routing entry for 4.4.4.0/24[/size][/font]
[font=Times New Roman][size=3]
Known via "ospf 10", distance 110, metric 20, type extern 2, forward metric 74[/size][/font]
[font=Times New Roman][size=3]
Last update from 13.1.1.3 on Serial2/0, 00:17:54 ago[/size][/font]
[font=Times New Roman][size=3]
Routing Descriptor Blocks:[/size][/font]
[font=Times New Roman][size=3]
12.1.1.2, from 4.4.4.4, 00:17:54 ago, via Serial1/0[/size][/font]
[font=Times New Roman][size=3]
Route metric is 20, traffic share count is 1[/size][/font]
[font=Times New Roman][size=3]
* 13.1.1.3, from 4.4.4.4, 00:17:54 ago, via Serial2/0[/size][/font]
[font=Times New Roman][size=3]
Route metric is 20, traffic share count is 1[/size][/font]
[size=3][font=宋体]可以看到下一跳的路径为[/font][font=Times New Roman]* 13.1.1.3[/font][/size]
[size=3][font=宋体]现在我在[/font][font=Times New Roman]R2[/font][font=宋体]的以太网[/font][font=Times New Roman]E0/0.1[/font][font=宋体]口将其[/font][font=Times New Roman]COST[/font][font=宋体]值该为[/font][font=Times New Roman]5[/font][/size]
[font=Times New Roman][size=3]interface Ethernet0/0.1[/size][/font]
[font=Times New Roman][size=3]
ip ospf cost 5[/size][/font]
[size=3][font=宋体]那么它会优先选择[/font][font=Times New Roman]Ethernet0/0.1[/font][font=宋体]这个口出去到达[/font][font=Times New Roman]4.4.4.4 [/font][font=宋体]验证:[/font][/size]
[font=Times New Roman][size=3]r1#sh ip route[/size][/font]
[font=Times New Roman][size=3] [/size][/font]
[font=Times New Roman][size=3]
34.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]O
34.1.1.0 [110/74] via 13.1.1.3, 00:00:07, Serial2/0[/size][/font]
[font=Times New Roman][size=3]
1.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]C
1.1.1.0 is directly connected, Loopback0[/size][/font]
[font=Times New Roman][size=3]
4.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]O E2
4.4.4.0 [110/20] via 12.1.1.2, 00:00:07, Serial1/0[/size][/font]
[font=Times New Roman][size=3]
24.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]O
24.1.1.0 [110/69] via 12.1.1.2, 00:00:07, Serial1/0[/size][/font]
[font=Times New Roman][size=3]
12.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]C
12.1.1.0 is directly connected, Serial1/0[/size][/font]
[font=Times New Roman][size=3]
13.0.0.0/24 is subnetted, 1 subnets[/size][/font]
[font=Times New Roman][size=3]C
13.1.1.0 is directly connected, Serial2/0[/size][/font]
[size=3][font=宋体]可见到[/font][font=Times New Roman]4.4.4.4[/font][font=宋体]只有一条路由了,[/font][font=Times New Roman]O E2 4.4.4.0 [110/20] via 12.1.1.2[/font][/size]
[size=3][font=宋体]通过[/font][font=Times New Roman]12.1.1.2[/font][font=宋体]口出去,不会再进行负载均衡。[/font][/size]
[font=Times New Roman][size=3]r1#show ip route 4.4.4.4[/size][/font]
[font=Times New Roman][size=3]Routing entry for 4.4.4.0/24[/size][/font]
[size=3][font=Times New Roman]
Known via "ospf 10", distance 110, metric 20, type extern 2, forward metric 69[/font][/size]
[size=3][font=Times New Roman]
Last update from 12.1.1.2 on Serial1/0, 00:02:40 ago[/font][/size]
[size=3][font=Times New Roman]
Routing Descriptor Blocks:[/font][/size]
[size=3][font=Times New Roman]
* 12.1.1.2, from 4.4.4.4, 00:02:40 ago, via Serial1/0[/font][/size]
[size=3][font=Times New Roman]
Route metric is 20, traffic share count is 1[/font][/size]
[/font][/size]

寻衣草 2007-12-8 23:23

恩,看了很多数句,都是讲路由的,好好研究
页: [1]
查看完整版本: OE2路由选路