Thành viên CMGroupvn

CMGroupvn - Toward Professionalist in IT
Nguy?n Anh TúNguyễn Anh Tú
Làm việc tại FIS SRV HN.
tuna@cmgroupvn.com
Nguyễn Đức HòaNguyễn Đức Hòa
Làm việc tại FIS SRV HN.
hoand@cmgroupvn.com
Tôn Vi?t HungTôn Việt Hưng
Năm 5 khoa CNTT - ÐH BKHN.
hungtv@cmgroupvn.com
Bùi Châu PhiBùi Châu Phi
Làm việc tại FIS SRV HN
phibc@cmgroupvn.com
Nguy?n Vi?t HùngNguyễn Việt Hùng
Năm 5 khoa ÐTVT - HV KTQS.
hungnv@cmgroupvn.com
Phạm Việt DũngPhạm Việt Dũng
Năm 4 khoa CNTT - ÐH CNHN.
dungpv@cmgroupvn.com
Nguyễn Tiến AnhNguyễn Tiến Anh
Năm 5 khoa CNTT - ÐH BKHN.
anhnt@cmgroupvn.com
Nguyễn Minh TuệNguyễn Minh Tuệ
Năm 5 khoa CNTT - ÐH Thủy Lợi.
tuenm@cmgroupvn.com
Lâm Viết ThảoLâm Viết Thảo
Làm việc tại FIS SRV HN.
Hoàng Tu?n Vi?tHoàng Tuấn Việt
Năm 3 - ÐH Công nghệ
vietht@cmgroupvn.com
Tôn Huy NamTôn Huy Nam
Năm 1 - HV KTQS
namth@cmgroupvn.com

Thống kê truy cập

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday2
mod_vvisit_counterYesterday89
mod_vvisit_counterThis week2
mod_vvisit_counterLast week693
mod_vvisit_counterThis month91
mod_vvisit_counterLast month2806
mod_vvisit_counterAll days22098

We have: 1 guests, 1 bots online
Your IP: 38.107.191.92
 , 
Today: Aug 01, 2010
Redistribution và Route-map (tiếp theo). PDF Print E-mail
Written by Nguyễn Đức Hòa   
Thursday, 18 March 2010 00:04

Trong bài viết hôm nay, tôi xin giới thiệu bài lab về ứng dụng route-map trong quá trình redistribution giữa các giao thức định tuyến, để lọc route theo ý muốn.
Topo mạng khá đơn giản, R2 chạy RIPv2, với các loopback tương ứng, R1 chạy RIPv2 và OSPF, R3 chạy OSPF, cùng với các loopback tương ứng. Kết nối giữa các router R1,R2,R3 là FastEthernet, sử dụng lần lượt là R2-R1: 1.1.1.0/30; R1-R3:1.1.2.0/30.

 

 

 

 

Sau khi cấu hình RIP và OSPF trên các router, đây là bảng định tuyến của các router sau khi hội tụ.

R1#show ip route
1.0.0.0/30 is subnetted, 2 subnets
C       1.1.1.0 is directly connected, FastEthernet0/1
C       1.1.2.0 is directly connected, FastEthernet0/0
192.168.10.0/24 is variably subnetted, 4 subnets, 2 masks
R       192.168.10.32/28 [120/1] via 1.1.1.1, 00:00:10, FastEthernet0/1
R       192.168.10.0/28 [120/1] via 1.1.1.1, 00:00:10, FastEthernet0/1
R       192.168.10.0/24 [120/1] via 1.1.1.1, 00:02:31, FastEthernet0/1
R       192.168.10.16/28 [120/1] via 1.1.1.1, 00:00:10, FastEthernet0/1
10.0.0.0/32 is subnetted, 3 subnets
O       10.10.10.1 [110/2] via 1.1.2.1, 00:00:39, FastEthernet0/0
O       10.10.10.17 [110/2] via 1.1.2.1, 00:00:39, FastEthernet0/0
O       10.10.10.33 [110/2] via 1.1.2.1, 00:00:39, FastEthernet0/0

R2:

R2#show ip route
Gateway of last resort is not set

1.0.0.0/30 is subnetted, 2 subnets
C       1.1.1.0 is directly connected, FastEthernet0/1
R       1.1.2.0 [120/1] via 1.1.1.2, 00:00:00, FastEthernet0/1
192.168.10.0/28 is subnetted, 3 subnets
C       192.168.10.32 is directly connected, Loopback2
C       192.168.10.0 is directly connected, Loopback0
C       192.168.10.16 is directly connected, Loopback1

Và R3:

R3#show ip route
Gateway of last resort is not set
1.0.0.0/30 is subnetted, 1 subnets
C       1.1.2.0 is directly connected, FastEthernet0/0
10.0.0.0/28 is subnetted, 3 subnets
C       10.10.10.0 is directly connected, Loopback0
C       10.10.10.16 is directly connected, Loopback1
C       10.10.10.32 is directly connected, Loopback2

Đương nhiên, tại thời điểm này từ R3 chưa thể đến được mạng của R2 (Các mạng Loopback cũng như đến đầu Fe của R2)

R3#ping 192.168.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Ta sẽ thực hiện redistribution trên R1 để cho phép 2 giao thức này hiểu được nhau. Trên R1 cấu hình ở mức router RIP.

R1(config-router)#redistribute ospf 5 metric 5

Sau khi thời gian hội tụ kết thúc, trên R2 đã xuất hiện các mạng của R3 đã được R1 chuyển từ OSPF sang RIP

R2#show ip route
Gateway of last resort is not set

1.0.0.0/30 is subnetted, 2 subnets
C       1.1.1.0 is directly connected, FastEthernet0/1
R       1.1.2.0 [120/1] via 1.1.1.2, 00:00:01, FastEthernet0/1
192.168.10.0/28 is subnetted, 3 subnets
C       192.168.10.32 is directly connected, Loopback2
C       192.168.10.0 is directly connected, Loopback0
C       192.168.10.16 is directly connected, Loopback1
10.0.0.0/32 is subnetted, 3 subnets
R       10.10.10.1 [120/5] via 1.1.1.2, 00:00:01, FastEthernet0/1
R       10.10.10.17 [120/5] via 1.1.1.2, 00:00:01, FastEthernet0/1
R       10.10.10.33 [120/5] via 1.1.1.2, 00:00:01, FastEthernet0/1

Tương tự, trên R1 tiếp tục redistrubute những gì học được từ RIP sang OSPF
R1(config-router)#redistribute rip subnets metric 25

Và lúc này, trên bảng định tuyến trên R3 đã được cập nhật

R3#show ip route
Gateway of last resort is not set


1.0.0.0/30 is subnetted, 2 subnets
O E2    1.1.1.0 [110/25] via 1.1.2.2, 00:00:06, FastEthernet0/0
C       1.1.2.0 is directly connected, FastEthernet0/0
192.168.10.0/28 is subnetted, 3 subnets
O E2    192.168.10.32 [110/25] via 1.1.2.2, 00:00:06, FastEthernet0/0
O E2    192.168.10.0 [110/25] via 1.1.2.2, 00:00:06, FastEthernet0/0
O E2    192.168.10.16 [110/25] via 1.1.2.2, 00:00:06, FastEthernet0/0
10.0.0.0/28 is subnetted, 3 subnets
C       10.10.10.0 is directly connected, Loopback0
C       10.10.10.16 is directly connected, Loopback1
C       10.10.10.32 is directly connected, Loopback2.

Và bây giờ, ta sẽ dùng route-map để lọc route. Ví dụ, trên ta muốn R1, khi redistrubute từ RIP sang OSPF thì phải loại trừ mạng 192.168.10.32/28. Nói cách khách, sau khi học được mạng 192.168.10.32 từ giao thức RIP, thì ta muốn R1 khi quảng bá sang cho R3, tuyến đường này sẽ bị chặn. Ta làm như sau.

Trên R1 tạo access-list 10

access-list 10 deny   192.168.10.32 0.0.0.15
access-list 10 permit any

Tạo route-map có tên Loc_Route và match vào access-list 10.

Redistribute lại cho OSPF

R1(config-router)#redistribute rip subnets route-map Loc_route metric 15

Sau khi thời gian hội tụ, trong bảng định tuyến của R3, tuyến đường 192.168.10.32 đã bị mất

R3#show ip route
Gateway of last resort is not set
1.0.0.0/30 is subnetted, 2 subnets
O E2    1.1.1.0 [110/15] via 1.1.2.2, 00:00:18, FastEthernet0/0
C       1.1.2.0 is directly connected, FastEthernet0/0
192.168.10.0/28 is subnetted, 2 subnets
O E2    192.168.10.0 [110/15] via 1.1.2.2, 00:00:18, FastEthernet0/0
O E2    192.168.10.16 [110/15] via 1.1.2.2, 00:00:18, FastEthernet0/0
10.0.0.0/28 is subnetted, 3 subnets
C       10.10.10.0 is directly connected, Loopback0
C       10.10.10.16 is directly connected, Loopback1
C       10.10.10.32 is directly connected, Loopback2

Và như chúng ta thấy, từ R3 vẫn sang được mạng 192.168.10.16/28 nhưng mạng 192.168.10.32/28 thì không được.

R3#ping 192.168.10.17
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.17, timeout is 2 seconds:
!!
*Mar  1 00:32:41.851: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 428/716/864 ms
R3#ping 192.168.10.33
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.33, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R3#

HoàNĐ is a member of CMgroupVN

Last Updated on Saturday, 20 March 2010 20:27
 

Add comment


Security code
Refresh