phamminhtuan
02-12-2008, 10:18 AM
A.Filter route:
Khi chạy nhiều giao thức chung với nhau và có nhu cầu redistribution từ giao thức này vào giao thức kia ta có thể gặp phải vấn đề đường dẫn không tối ưu, route feedback [sau khi redistribute route xong route lại quay ngược về nơi sinh ra do distance của giao thức được redistribute vào thấp hơn]
Sử dụng tính năng lọc route giúp nhà quảng trị điều khiển được những route quảng bá, redistribute, …
Việc lọc route những giao thức distance thì hiệu quả hơn những giao thức link-state. Vì giao thức với giao thức distance thì router quảng bá route dựa trên bảng routing table cả nó.
Những router đang chạy link-state protocol xác định route của chúng dựa trên thông tin trong link-state database hơn là những route được neighbors quảng bá vào nó.
Việc lọc route không ảnh hưởng đến quảng bá trạng thái link hay bảng link-state database.
Kết quả việc lọc route có thể tác động trên router được cấu hình lọc nhưng không ảnh hưởng đến route đi vào router neighbor. [đối với Link-state, bởi vì nó quảng bá trạng thái của link mà].
Vì vậy việc lọc route thì thường được sử dụng trên con ASBR vì nơi đây route sẽ đi vào và đi ra giống dạng của distace vector.
vd: OSPF ASBR vì đây là nơi các route đi vào hoặc đi ra domain
Sự hữu dụng của việc lọc route trong domain link-state là hạn chế.
Nhớ rằng yêu cầu cơ bản của giao thức link-sate là: trong một area link-state thì tất cả các router cần có một bảng link-state database giống nhau.
Cho nên việc block một số LSA yêu cầu này sẽ bị vi phạm.
http://img386.imageshack.us/img386/7771/11599717th7.jpg (http://img386.imageshack.us/my.php?image=11599717th7.jpg)
Cấu hình như trên và redistribute 2 chiều tại R2.
Với R3
R3(config)#int loopback 3
R3(config-if)#ip ospf network point-to-point
R3#
Loopback4 is up, line protocol is up
Internet Address 4.4.4.4/25, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type POINT_TO_POINT, Cost: 1
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
Loopback3 is up, line protocol is up
Internet Address 3.3.3.3/8, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type POINT_TO_POINT, Cost: 1
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
Sau đó dừng R2, xem bảng routing table của R4.
R4#sh ip route
R 192.168.12.0/24 [120/1] via 192.168.14.1, 00:00:18, FastEthernet0/0
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 192.168.14.1, 00:00:18, FastEthernet0/0
C 192.168.14.0/24 is directly connected, FastEthernet0/0
O 3.0.0.0/8 [110/2] via 192.168.34.1, 00:05:37, FastEthernet1/0
4.0.0.0/25 is subnetted, 1 subnets
O 4.4.4.0 [110/2] via 192.168.34.1, 00:05:37, FastEthernet1/0
O 192.168.23.0/24 [110/2] via 192.168.34.1, 00:05:37, FastEthernet1/0
C 192.168.34.0/24 is directly connected, FastEthernet1/0
R 12.0.0.0/8 [120/1] via 192.168.14.1, 00:00:18, FastEthernet0/0
R1# show ip route
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback1
C 192.168.14.0/24 is directly connected, FastEthernet1/0
C 12.0.0.0/8 is directly connected, Loopback12
R3# show ip route
C 3.0.0.0/8 is directly connected, Loopback3
4.0.0.0/25 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
C 192.168.23.0/24 is directly connected, FastEthernet1/0
C 192.168.34.0/24 is directly connected, FastEthernet0/0
R2#
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute rip subnets
network 2.2.2.0 0.0.0.255 area 0
network 192.168.23.0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 1 metric 5
network 192.168.12.0
Sau khi xem xong ta start R2 lên.
Và xem lại bảng định tuyến của R4
O E2 192.168.12.0/24 [110/20] via 192.168.34.1, 00:08:21, FastEthernet1/0
1.0.0.0/24 is subnetted, 1 subnets
O E2 1.1.1.0 [110/20] via 192.168.34.1, 00:08:21, FastEthernet1/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 2.2.2.2/32 [110/3] via 192.168.34.1, 00:08:21, FastEthernet1/0
R 2.0.0.0/8 [120/6] via 192.168.14.1, 00:00:14, FastEthernet0/0
C 192.168.14.0/24 is directly connected, FastEthernet0/0
O 3.0.0.0/8 [110/2] via 192.168.34.1, 00:08:21, FastEthernet1/0
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 4.4.4.0/25 [110/2] via 192.168.34.1, 00:08:22, FastEthernet1/0
R 4.0.0.0/8 [120/6] via 192.168.14.1, 00:00:14, FastEthernet0/0
O 192.168.23.0/24 [110/2] via 192.168.34.1, 00:08:22, FastEthernet1/0
C 192.168.34.0/24 is directly connected, FastEthernet1/0
O E2 12.0.0.0/8 [110/20] via 192.168.34.1, 00:08:22, FastEthernet1/0
Ta thấy những mạng học qua RIP lúc nãy giờ đã chuyển sang học qua OSPF [đi xa hơn]. Đây là vấn đề chọn đường đi không tối ưu do AD RIP và 120 lớn hơn của OSPF là 110.
http://img386.imageshack.us/img386/3528/42978740ev8.jpg (http://img386.imageshack.us/my.php?image=42978740ev8.jpg)
Để giải quyết vấn đề này ta có thể dùng một số cách sau.
Filter AD kết hợp ACL.
Dùng distribute-list.
Khi chạy nhiều giao thức chung với nhau và có nhu cầu redistribution từ giao thức này vào giao thức kia ta có thể gặp phải vấn đề đường dẫn không tối ưu, route feedback [sau khi redistribute route xong route lại quay ngược về nơi sinh ra do distance của giao thức được redistribute vào thấp hơn]
Sử dụng tính năng lọc route giúp nhà quảng trị điều khiển được những route quảng bá, redistribute, …
Việc lọc route những giao thức distance thì hiệu quả hơn những giao thức link-state. Vì giao thức với giao thức distance thì router quảng bá route dựa trên bảng routing table cả nó.
Những router đang chạy link-state protocol xác định route của chúng dựa trên thông tin trong link-state database hơn là những route được neighbors quảng bá vào nó.
Việc lọc route không ảnh hưởng đến quảng bá trạng thái link hay bảng link-state database.
Kết quả việc lọc route có thể tác động trên router được cấu hình lọc nhưng không ảnh hưởng đến route đi vào router neighbor. [đối với Link-state, bởi vì nó quảng bá trạng thái của link mà].
Vì vậy việc lọc route thì thường được sử dụng trên con ASBR vì nơi đây route sẽ đi vào và đi ra giống dạng của distace vector.
vd: OSPF ASBR vì đây là nơi các route đi vào hoặc đi ra domain
Sự hữu dụng của việc lọc route trong domain link-state là hạn chế.
Nhớ rằng yêu cầu cơ bản của giao thức link-sate là: trong một area link-state thì tất cả các router cần có một bảng link-state database giống nhau.
Cho nên việc block một số LSA yêu cầu này sẽ bị vi phạm.
http://img386.imageshack.us/img386/7771/11599717th7.jpg (http://img386.imageshack.us/my.php?image=11599717th7.jpg)
Cấu hình như trên và redistribute 2 chiều tại R2.
Với R3
R3(config)#int loopback 3
R3(config-if)#ip ospf network point-to-point
R3#
Loopback4 is up, line protocol is up
Internet Address 4.4.4.4/25, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type POINT_TO_POINT, Cost: 1
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
Loopback3 is up, line protocol is up
Internet Address 3.3.3.3/8, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type POINT_TO_POINT, Cost: 1
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
Sau đó dừng R2, xem bảng routing table của R4.
R4#sh ip route
R 192.168.12.0/24 [120/1] via 192.168.14.1, 00:00:18, FastEthernet0/0
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 192.168.14.1, 00:00:18, FastEthernet0/0
C 192.168.14.0/24 is directly connected, FastEthernet0/0
O 3.0.0.0/8 [110/2] via 192.168.34.1, 00:05:37, FastEthernet1/0
4.0.0.0/25 is subnetted, 1 subnets
O 4.4.4.0 [110/2] via 192.168.34.1, 00:05:37, FastEthernet1/0
O 192.168.23.0/24 [110/2] via 192.168.34.1, 00:05:37, FastEthernet1/0
C 192.168.34.0/24 is directly connected, FastEthernet1/0
R 12.0.0.0/8 [120/1] via 192.168.14.1, 00:00:18, FastEthernet0/0
R1# show ip route
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback1
C 192.168.14.0/24 is directly connected, FastEthernet1/0
C 12.0.0.0/8 is directly connected, Loopback12
R3# show ip route
C 3.0.0.0/8 is directly connected, Loopback3
4.0.0.0/25 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, Loopback4
C 192.168.23.0/24 is directly connected, FastEthernet1/0
C 192.168.34.0/24 is directly connected, FastEthernet0/0
R2#
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute rip subnets
network 2.2.2.0 0.0.0.255 area 0
network 192.168.23.0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 1 metric 5
network 192.168.12.0
Sau khi xem xong ta start R2 lên.
Và xem lại bảng định tuyến của R4
O E2 192.168.12.0/24 [110/20] via 192.168.34.1, 00:08:21, FastEthernet1/0
1.0.0.0/24 is subnetted, 1 subnets
O E2 1.1.1.0 [110/20] via 192.168.34.1, 00:08:21, FastEthernet1/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 2.2.2.2/32 [110/3] via 192.168.34.1, 00:08:21, FastEthernet1/0
R 2.0.0.0/8 [120/6] via 192.168.14.1, 00:00:14, FastEthernet0/0
C 192.168.14.0/24 is directly connected, FastEthernet0/0
O 3.0.0.0/8 [110/2] via 192.168.34.1, 00:08:21, FastEthernet1/0
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 4.4.4.0/25 [110/2] via 192.168.34.1, 00:08:22, FastEthernet1/0
R 4.0.0.0/8 [120/6] via 192.168.14.1, 00:00:14, FastEthernet0/0
O 192.168.23.0/24 [110/2] via 192.168.34.1, 00:08:22, FastEthernet1/0
C 192.168.34.0/24 is directly connected, FastEthernet1/0
O E2 12.0.0.0/8 [110/20] via 192.168.34.1, 00:08:22, FastEthernet1/0
Ta thấy những mạng học qua RIP lúc nãy giờ đã chuyển sang học qua OSPF [đi xa hơn]. Đây là vấn đề chọn đường đi không tối ưu do AD RIP và 120 lớn hơn của OSPF là 110.
http://img386.imageshack.us/img386/3528/42978740ev8.jpg (http://img386.imageshack.us/my.php?image=42978740ev8.jpg)
Để giải quyết vấn đề này ta có thể dùng một số cách sau.
Filter AD kết hợp ACL.
Dùng distribute-list.