多边界多向路由重分布

R2的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Ethernet0/0
ip address 192.168.21.2 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 192.168.24.2 255.255.255.0
half-duplex
!
interface Ethernet0/2
ip address 192.168.25.2 255.255.255.0
half-duplex
!
interface Ethernet0/3
ip address 192.168.26.2 255.255.255.0
ip router isis
half-duplex
!
router eigrp 1
redistribute isis level-1-2
redistribute rip
redistribute ospf 1
network 2.0.0.0
network 192.168.24.0
default-metric 1000 2500 255 1 1500
auto-summary
!
router ospf 1
log-adjacency-changes
redistribute isis level-1-2 subnets
redistribute rip subnets
redistribute eigrp 1 subnets
network 2.2.2.0 0.0.0.255 area 0
network 192.168.25.0 0.0.0.255 area 0
distance ospf external 170
!
router isis
net 49.0001.2222.2222.2222.00
redistribute rip
redistribute eigrp 1
redistribute ospf 1
!
router rip
version 2
redistribute isis level-1-2
redistribute eigrp 1
redistribute ospf 1
network 2.0.0.0
network 192.168.21.0
default-metric 4
distance 111
no auto-summary

注:多边界多向路由重分布会有次优路由的问题,本路由器发出去的路由会被另一个协议重分发回来。如果AD值高的路由协议向AD值低的路由协议中重分发,就会产生次优路由,路由环路等问题。反之,AD值低的路由协议向AD值高的路由协议重分发,就不会发生这个问题。这个错误发生在边界路由器上,此时需要使用路由策略来解决,方法如下:

①、路由过滤:不让产生环路的路由条目进入我这台路由器,这样也就不会产生次优路径了。

②、修改管理距离AD:把次优路由条目的AD值调高,高到路由器即便看到两条路由条目去往同一目的地,也不会把次优路由写入路由表。这种方法比前一种好在如果最佳路径down了,次优路由变成备份路由使用。

R3的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Ethernet0/0
ip address 192.168.31.3 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 192.168.34.3 255.255.255.0
half-duplex
!
interface Ethernet0/2
ip address 192.168.35.3 255.255.255.0
half-duplex
!
interface Ethernet0/3
ip address 192.168.36.3 255.255.255.0
ip router isis
half-duplex
!
router eigrp 1
redistribute isis level-1-2
redistribute rip
redistribute ospf 1
network 3.0.0.0
network 192.168.34.0
default-metric 1000 2500 255 1 1500
auto-summary
!
router ospf 1
log-adjacency-changes
redistribute isis level-1-2 subnets
redistribute rip subnets
redistribute eigrp 1 subnets
network 3.3.3.0 0.0.0.255 area 0
network 192.168.35.0 0.0.0.255 area 0
distance ospf external 170
!
router isis
net 49.0001.3333.3333.3333.00
redistribute rip
redistribute eigrp 1
redistribute ospf 1
!
router rip
version 2
redistribute isis level-1-2
redistribute eigrp 1
redistribute ospf 1
network 3.0.0.0
network 192.168.31.0
default-metric 4
distance 111

R1的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
!
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Ethernet0/0
ip address 192.168.21.1 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 192.168.31.1 255.255.255.0
half-duplex
!
router rip
version 2
network 1.0.0.0
network 192.168.21.0
network 192.168.31.0
no auto-summary

R4的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Ethernet0/0
ip address 192.168.24.4 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 192.168.34.4 255.255.255.0
half-duplex
!
router eigrp 1
network 4.0.0.0
network 192.168.24.0
network 192.168.34.0
auto-summary

R5的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
!
interface Loopback0
ip address 5.5.5.5 255.255.255.0
!
interface Ethernet0/0
ip address 192.168.25.5 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 192.168.35.5 255.255.255.0
half-duplex
!
router ospf 1
log-adjacency-changes
network 5.5.5.0 0.0.0.255 area 0
network 192.168.25.0 0.0.0.255 area 0
network 192.168.35.0 0.0.0.255 area 0

R6的配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
!
interface Loopback0
ip address 6.6.6.6 255.255.255.0
ip router isis
!
interface Ethernet0/0
ip address 192.168.26.6 255.255.255.0
ip router isis
half-duplex
!
interface Ethernet0/1
ip address 192.168.36.6 255.255.255.0
ip router isis
half-duplex
!
router isis
net 49.0001.6666.6666.6666.00