Lab 1.2 Redistribute - part 2

root

Leader IT/Architect
Dec 31, 2012
1,153
72
48
I. Mô hình và yêu cầu
1. Mô hình


2. yêu cầu
1. config domain routing RIP, OSPF, EIGRP như hình vẽ
2. Thông tin Area 200 không được quảng bá đến bất kì OSPF area nào khác
3. redistribute​

  • [*=1]redistribute OSPF qua EIGRP và ngược lại
    [*=1]Chú ý Redistribute OSPF -> EIGRP chỉ thực hiện duy nhất tại R4
    [*=1]Chú ý link R4 và R5 down. R5 vẫn có thể đi được tới mạng 10.4.4.0/24
4. Redistribute EIGRP -> RIP​

  • [*=1]4.1 Redistribute từ OSPF vào RIP trên R1 (1 đường)
    [*=1]4.2 Tại R1 tạo default-route cho vùng OSPF
    [*=1]4.5 Khi traceroute từ R5 -> Router thuộc Ripv2. Đưa ra giải pháp để tối ưu hệ thống

II. Triển khai
1. Cấu hình IP và các doamin routing
- trên R1
R1(config-if)#int f0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#int f0/1
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#int s1/0
R1(config-if)#ip address 10.3.3.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#int s1/1
R1(config-if)#ip address 10.4.4.1 255.255.255.0
R1(config-if)#no shutdown

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 10.1.1.0
R1(config-router)#no auto-summary

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 10.3.3.0 0.0.0.255 area 0
R1(config-router)#network 10.4.4.0 0.0.0.255 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 200

- Trên R2
R2(config-if)#int f0/1
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#no shutdown

R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 10.1.1.0
R2(config-router)#no auto-summary

- Trên R3

R3(config-if)#int f0/1
R3(config-if)#ip address 50.3.3.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#int s1/0
R3(config-if)#ip address 10.3.3.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#int s1/2
R3(config-if)#ip address 30.3.3.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#int s1/3
R3(config-if)#ip address 40.4.4.3 255.255.255.0
R3(config-if)#no shutdown

R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 10.3.3.0 0.0.0.255 area 0
R3(config-router)#network 30.3.3.0 0.0.0.255 area 0

R3(config)#router eigrp 1
R3(config-router)#network 40.4.4.0 0.0.0.255
R3(config-router)#network 50.3.3.0 0.0.0.255
R3(config-router)#no auto-summary

- Trên R4
R4(config-if)#int f0/1
R4(config-if)#ip address 50.4.4.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#int s1/0
R4(config-if)#ip address 10.4.4.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#int s1/2
R4(config-if)#ip address 30.3.3.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#int s1/3
R4(config-if)#ip address 40.4.4.4 255.255.255.0
R4(config-if)#no shutdown

R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4

R4(config-router)#network 10.4.4.0 0.0.0.255 area 0
R4(config-router)#network 30.3.3.0 0.0.0.255 area 0

R4(config)#router eigrp 1
R4(config-router)#network 40.4.4.0 0.0.0.255
R4(config-router)#network 50.4.4.0 0.0.0.255
R4(config-router)#no auto-summary

- Trên R5

R5(config-if)#int f0/0
R5(config-if)#ip address 50.3.3.5 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#int f0/1
R5(config-if)#ip address 50.4.4.5 255.255.255.0
R5(config-if)#no shutdown

R5(config)#router eigrp 1
R5(config-router)#network 50.3.3.0 0.0.0.255
R5(config-router)#network 50.4.4.0 0.0.0.255
R5(config-router)#no auto-summary

Show các bảng định tuyến
- Trên R1
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

10.0.0.0/24 is subnetted, 3 subnets
C 10.4.4.0 is directly connected, Serial1/1
C 10.3.3.0 is directly connected, Serial1/0
C 10.1.1.0 is directly connected, FastEthernet0/1
C 192.168.1.0/24 is directly connected, FastEthernet0/0
30.0.0.0/24 is subnetted, 1 subnets
O 30.3.3.0 [110/128] via 10.4.4.4, 00:16:58, Serial1/1
[110/128] via 10.3.3.3, 00:18:41, Serial1/0
- Trên R2
R2#sh ip route
10.0.0.0/24 is subnetted, 3 subnets
R 10.4.4.0 [120/1] via 10.1.1.1, 00:00:04, FastEthernet0/1
R 10.3.3.0 [120/1] via 10.1.1.1, 00:00:04, FastEthernet0/1
C 10.1.1.0 is directly connected, FastEthernet0/1
- Trên R3
R3#sh ip route

50.0.0.0/24 is subnetted, 2 subnets
D 50.4.4.0 [90/307200] via 50.3.3.5, 00:03:36, FastEthernet0/1
C 50.3.3.0 is directly connected, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
D 5.5.5.5 [90/409600] via 50.3.3.5, 00:03:36, FastEthernet0/1
40.0.0.0/24 is subnetted, 1 subnets
C 40.4.4.0 is directly connected, Serial1/3
10.0.0.0/24 is subnetted, 2 subnets
O 10.4.4.0 [110/128] via 30.3.3.4, 00:03:41, Serial1/2
[110/128] via 10.3.3.1, 00:03:41, Serial1/0
C 10.3.3.0 is directly connected, Serial1/0
O IA 192.168.1.0/24 [110/74] via 10.3.3.1, 00:03:42, Serial1/0
30.0.0.0/24 is subnetted, 1 subnets
C 30.3.3.0 is directly connected, Serial1/2
- Trên R4
R4#sh ip route

50.0.0.0/24 is subnetted, 2 subnets
C 50.4.4.0 is directly connected, FastEthernet0/1
D 50.3.3.0 [90/307200] via 50.4.4.5, 00:04:32, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
D 5.5.5.5 [90/409600] via 50.4.4.5, 00:04:32, FastEthernet0/1
40.0.0.0/24 is subnetted, 1 subnets
C 40.4.4.0 is directly connected, Serial1/3
10.0.0.0/24 is subnetted, 2 subnets
C 10.4.4.0 is directly connected, Serial1/0
O 10.3.3.0 [110/128] via 30.3.3.3, 00:19:07, Serial1/2
[110/128] via 10.4.4.1, 00:19:07, Serial1/0
O IA 192.168.1.0/24 [110/74] via 10.4.4.1, 00:06:31, Serial1/0
30.0.0.0/24 is subnetted, 1 subnets
C 30.3.3.0 is directly connected, Serial1/2
- Trên R5
R5#sh ip route

50.0.0.0/24 is subnetted, 2 subnets
C 50.4.4.0 is directly connected, FastEthernet0/1
C 50.3.3.0 is directly connected, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
40.0.0.0/24 is subnetted, 1 subnets
D 40.4.4.0 [90/2195456] via 50.4.4.4, 00:05:14, FastEthernet0/1
[90/2195456] via 50.3.3.3, 00:05:14, FastEthernet0/0

 

2. Cấu hình để area 200 không được quảng bá đến bất kì vùng ospf nào khác

- Các bạn thấy ở trong bảng định tuyến của các Router R3 và R4 đều có lớp mạng 192.168.1.0 của area 200. Bây giờ chúng ta sẽ tiến hành filter route để lớp mạng này không được nhìn thấy trên R4 và R4 nữa.
- Để giải quyết vấn đề này mình sẽ dùng ACL+ prefix-list + distribute list để thực hiện filter-route của area 200. Mặc dùng việc filter Router này trên OSPF không triệt để vì OSPF sử dụng LSA type 1 nên ko filter route được. Nhưng ở đây do 2 area khác nhau nên nó dùng LSA type 3 để trao đổi topology nên chúng ta có thể filter route được
R1(config)#ip prefix-list FILTER-ROUTE deny 192.168.1.1/32

R1(config)#router ospf 1
R1(config-router)#area 200 filter-list prefix FILTER-ROUTE out
- Bây giờ các bạn lên R3 và R4 show ip route thì sẽ thấy lớp mạng 192.168.1.0 đã không còn trên bảng định tuyến của nó
- Trên R3

R3#sh ip route

Gateway of last resort is not set

50.0.0.0/24 is subnetted, 2 subnets
D 50.4.4.0 [90/307200] via 50.3.3.5, 00:09:59, FastEthernet0/1
C 50.3.3.0 is directly connected, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
D 5.5.5.5 [90/409600] via 50.3.3.5, 00:09:59, FastEthernet0/1
40.0.0.0/24 is subnetted, 1 subnets
C 40.4.4.0 is directly connected, Serial1/3
10.0.0.0/24 is subnetted, 2 subnets
O 10.4.4.0 [110/128] via 30.3.3.4, 00:10:04, Serial1/2
[110/128] via 10.3.3.1, 00:10:04, Serial1/0
C 10.3.3.0 is directly connected, Serial1/0
30.0.0.0/24 is subnetted, 1 subnets
C 30.3.3.0 is directly connected, Serial1/2
- Trên R4

R4#sh ip route

Gateway of last resort is not set

50.0.0.0/24 is subnetted, 2 subnets
C 50.4.4.0 is directly connected, FastEthernet0/1
D 50.3.3.0 [90/307200] via 50.4.4.5, 00:11:34, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
D 5.5.5.5 [90/409600] via 50.4.4.5, 00:11:34, FastEthernet0/1
40.0.0.0/24 is subnetted, 1 subnets
C 40.4.4.0 is directly connected, Serial1/3
10.0.0.0/24 is subnetted, 2 subnets
C 10.4.4.0 is directly connected, Serial1/0
O 10.3.3.0 [110/128] via 30.3.3.3, 00:26:09, Serial1/2
[110/128] via 10.4.4.1, 00:26:09, Serial1/0
30.0.0.0/24 is subnetted, 1 subnets
C 30.3.3.0 is directly connected, Serial1/2

3. Redistribute
- Tiếp theo chúng ta sẽ thực hiện redistribute để các lớp mạng vùng OSPF và EIGRP có thể thấy nhau. Yêu cầu đề bài chỉ được thực hiện Redistribute trên R4. Nên chúng ta sẽ thực hiện Redistribute trên R4

R4(config)#router ospf 1
R4(config-router)#redistribute eigrp 1 subnets

R4(config)#router eigrp 1
R4(config-router)#redistribute ospf 1 metric 100000 100 255 1 1500

- Để kiểm tra các bạn tiến hành show ip route các Router
- Trên R1: đã thấy các lớp mạng thuộc vùng EIGRP

50.0.0.0/24 is subnetted, 2 subnets
O E2 50.4.4.0 [110/50] via 10.4.4.4, 00:00:17, Serial1/1
O E2 50.3.3.0 [110/50] via 10.4.4.4, 00:00:17, Serial1/1

5.0.0.0/32 is subnetted, 1 subnets
O E2 5.5.5.5 [110/50] via 10.4.4.4, 00:00:17, Serial1/1
40.0.0.0/24 is subnetted, 1 subnets
O E2 40.4.4.0 [110/50] via 10.4.4.4, 00:00:17, Serial1/1
10.0.0.0/24 is subnetted, 3 subnets
C 10.4.4.0 is directly connected, Serial1/1
C 10.3.3.0 is directly connected, Serial1/0
C 10.1.1.0 is directly connected, FastEthernet0/1
C 192.168.1.0/24 is directly connected, FastEthernet0/0
30.0.0.0/24 is subnetted, 1 subnets
O 30.3.3.0 [110/128] via 10.4.4.4, 00:29:46, Serial1/1
[110/128] via 10.3.3.3, 00:31:28, Serial1/0
- Trên R5: cũng đã thấy các lớp mạng thuộc OSPF

R5#sh ip route
Gateway of last resort is not set

50.0.0.0/24 is subnetted, 2 subnets
C 50.4.4.0 is directly connected, FastEthernet0/1
C 50.3.3.0 is directly connected, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
40.0.0.0/24 is subnetted, 1 subnets
D 40.4.4.0 [90/2195456] via 50.4.4.4, 00:18:43, FastEthernet0/1
[90/2195456] via 50.3.3.3, 00:18:43, FastEthernet0/0
10.0.0.0/24 is subnetted, 2 subnets
D EX 10.4.4.0 [170/307200] via 50.4.4.4, 00:03:43, FastEthernet0/1
D EX 10.3.3.0 [170/307200] via 50.4.4.4, 00:03:43, FastEthernet0/1

30.0.0.0/24 is subnetted, 1 subnets
D EX 30.3.3.0 [170/307200] via 50.4.4.4, 00:03:43, FastEthernet0/1

4. Khi link giữa R4 và R5 down, R5 vẫn đi tới mạng 10.4.4.0 được
- Bây giờ giả sử link R4 và R5 down bằng cách shutdown interface f0/1 của R5.
R5(config)#int f0/1
R5(config-if)#shutdown

- Sau đó các bạn thực hiện show ip route của R5 thì thấy nó không thấy mạng 10.4.4.0/24

R5#sh ip route
Gateway of last resort is not set

50.0.0.0/24 is subnetted, 2 subnets
D 50.4.4.0 [90/2221056] via 50.3.3.3, 00:00:05, FastEthernet0/0
C 50.3.3.0 is directly connected, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
40.0.0.0/24 is subnetted, 1 subnets
D 40.4.4.0 [90/2195456] via 50.3.3.3, 00:00:05, FastEthernet0/0
- Mặc dù link giữa R4 và R5 bị down nhưng R5 vẫn còn neighber với R3, Mà bảng định tuyến của R3 vẫn thấy subnet 10.4.4.0/24. Vậy tại sao lại không thấy mạng 10.4.4.0/24 ?
- Nguyên nhân là R3 đi tới mạng 10.4.4.0/24 là nó sử dụng Route của OSPF chứ không phải Route được Redistribute từ OSPF sang EIGPR trên R4. Mà R5 thì lại không nhìn thấy được OSPF vì nó đang dùng EIGRP
R3#sh ip route

Gateway of last resort is not set

50.0.0.0/24 is subnetted, 2 subnets
D 50.4.4.0 [90/2195456] via 40.4.4.4, 00:04:41, Serial1/3
C 50.3.3.0 is directly connected, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
D 5.5.5.5 [90/409600] via 50.3.3.5, 00:26:47, FastEthernet0/1
40.0.0.0/24 is subnetted, 1 subnets
C 40.4.4.0 is directly connected, Serial1/3
10.0.0.0/24 is subnetted, 2 subnets
O 10.4.4.0 [110/128] via 30.3.3.4, 00:26:51, Serial1/2
[110/128] via 10.3.3.1, 00:26:51, Serial1/0
C 10.3.3.0 is directly connected, Serial1/0
30.0.0.0/24 is subnetted, 1 subnets
C 30.3.3.0 is directly connected, Serial1/2
- Như bạn biết thì AD của OSPF là 110 và AD khi redistribute từ OSPF sang EIGRP là 170 nên Router sẽ chọn OSPF, nên chúng ta cần sửa AD trên R3 để R3 nhận subnet 10.4.4.0/24 qua redistribute trên R4 chứ ko phải là OSPF

R3(config)#router eigrp 1
R3(config-router)#distance eigrp 90 100

- Bây giờ bạn show bảng đinh tuyến R3 sẽ thấy nó nhận subnet 10.4.4.0/24 là bằng redistribute từ OSPF sang EIGRP trên R4

R3#sh ip route

Gateway of last resort is not set

50.0.0.0/24 is subnetted, 2 subnets
D 50.4.4.0 [90/2195456] via 40.4.4.4, 00:00:18, Serial1/3
C 50.3.3.0 is directly connected, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
D 5.5.5.5 [90/409600] via 50.3.3.5, 00:00:19, FastEthernet0/1
40.0.0.0/24 is subnetted, 1 subnets
C 40.4.4.0 is directly connected, Serial1/3
10.0.0.0/24 is subnetted, 2 subnets
D EX 10.4.4.0 [100/2195456] via 40.4.4.4, 00:00:18, Serial1/3
C 10.3.3.0 is directly connected, Serial1/0
30.0.0.0/24 is subnetted, 1 subnets
C 30.3.3.0 is directly connected, Serial1/2

- Show ip route trên R5 các bạn thấy nó đã nhìn thấy mạng 10.4.4.0/24
R5#sh ip route

Gateway of last resort is not set

50.0.0.0/24 is subnetted, 2 subnets
D 50.4.4.0 [90/2221056] via 50.3.3.3, 00:00:08, FastEthernet0/0
C 50.3.3.0 is directly connected, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
40.0.0.0/24 is subnetted, 1 subnets
D 40.4.4.0 [90/2195456] via 50.3.3.3, 00:00:09, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
D EX 10.4.4.0 [170/2221056] via 50.3.3.3, 00:00:08, FastEthernet0/0

 
4. Thực hiện Redistribute từ OSPF vào RIP trên R1
- Trên R1

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#redistribute ospf 1 metric 5

- Ở đây bạn chú ý là R2 vẫn nhìn thấy mạng 192.168.1.0/24 mặc dù chúng ta đã filter route ở trên. Nhưng các bạn chú ý ở trên chúng ta dùng là distribute list theo chiều out với lệnh " area 200 filter-list prefix FILTER-ROUTE out" trên còn ASBR nên việc filter route chỉ ảnh hưởng tới LSA type 3. Mà ở đây R2 nhận được vì nó được redistribute, mà redistribute thì sử dụng SLA type 5 nên không bị filter

R2#sh ip route


Gateway of last resort is not set


50.0.0.0/24 is subnetted, 2 subnets
R 50.4.4.0 [120/5] via 10.1.1.1, 00:00:10, FastEthernet0/1
R 50.3.3.0 [120/5] via 10.1.1.1, 00:00:10, FastEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
R 5.5.5.5 [120/5] via 10.1.1.1, 00:00:10, FastEthernet0/1
40.0.0.0/24 is subnetted, 1 subnets
R 40.4.4.0 [120/5] via 10.1.1.1, 00:00:10, FastEthernet0/1
10.0.0.0/24 is subnetted, 3 subnets
R 10.4.4.0 [120/1] via 10.1.1.1, 00:00:10, FastEthernet0/1
R 10.3.3.0 [120/1] via 10.1.1.1, 00:00:12, FastEthernet0/1
C 10.1.1.0 is directly connected, FastEthernet0/1
R 192.168.1.0/24 [120/5] via 10.1.1.1, 00:00:12, FastEthernet0/1
30.0.0.0/24 is subnetted, 1 subnets
R 30.3.3.0 [120/5] via 10.1.1.1, 00:00:13, FastEthernet0/1

5. Tại R1 tạo 1 default-route
- Với key world "always" thì R1 có thể lan truyền deufault route cho vùng OSPF mà trên nó không cần có default route
R1(config)#router ospf 1
R1(config-router)#default-information originate always


- Với default route này thì R5 sẽ đi được tới R2 mặc dù bảng định tuyến của R5 ko có subnet của R2 (10.1.1.0/24)

R5#sh ip route


Gateway of last resort is 50.3.3.3 to network 0.0.0.0


50.0.0.0/24 is subnetted, 2 subnets
D 50.4.4.0 [90/2221056] via 50.3.3.3, 01:11:59, FastEthernet0/0
C 50.3.3.0 is directly connected, FastEthernet0/0
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
40.0.0.0/24 is subnetted, 1 subnets
D 40.4.4.0 [90/2195456] via 50.3.3.3, 01:12:00, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
D EX 10.4.4.0 [170/2221056] via 50.3.3.3, 01:11:59, FastEthernet0/0
D*EX 0.0.0.0/0 [170/2221056] via 50.3.3.3, 00:00:30, FastEthernet0/0
R5#
R5#ping 10.1.1.2


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/66/76 ms
 
Hi bạn,

Bài này chỉ có hình Topology thôi bạn, hình show bảng định tuyến của Router mình để trong thẻ Quote nhé bạn!
 

About us

  • Securityzone.vn là một trang web chuyên về an ninh mạng và công nghệ thông tin. Trang web này cung cấp các bài viết, tin tức, video, diễn đàn và các dịch vụ liên quan đến lĩnh vực này. Securityzone.vn là một trong những cộng đồng IT lớn và uy tín tại Việt Nam, thu hút nhiều người quan tâm và tham gia. Securityzone.vn cũng là nơi để các chuyên gia, nhà nghiên cứu, sinh viên và người yêu thích an ninh mạng có thể trao đổi, học hỏi và chia sẻ kiến thức, kinh nghiệm và giải pháp về các vấn đề bảo mật trong thời đại số.

Quick Navigation

User Menu