root
Well-Known Member
- Joined
- Dec 31, 2012
- Messages
- 1,153
- Reaction score
- 71
- Points
- 48
I. Mô hình và yêu cầu
- Mô hình- Giới thiệu: Các bạn có thể tìm hiểu lý thuyết của bài Lab này tại đây: http://svuit.vn/showthread.php/206-Chapter-4-part-2-Dynamic-Routing
- Yêu cầu:
- Đảm bảo hệ thống mạng hội tụ
- Cấu hình Stub OSPF đặc biệt
1. Cấu hình IP trên các router R1,R2,R3 và R4
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Cấu hình IP trên Router R1
R1(config)#int f0/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#int loopback1
R1(config-if)#ip add 1.1.1.1 255.255.255.0
// Cấu hình IP trên Router R2
R2(config)#int f0/0
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int f0/1
R2(config-if)#ip add 10.2.2.2 255.255.255.0
R2(config-if)#no shut
R2(config)#int f1/0
R2(config-if)#ip add 10.4.4.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int loopback2
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no shut
// Cấu hình IP trên Router R3
R3(config)#int f0/0
R3(config-if)#ip add 10.2.2.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int loopback3
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#int loopback33
R3(config-if)#ip add 33.33.33.33 255.255.255.0
// Cấu hình IP trên Router R4
R4(config)#int f0/0
R4(config-if)#ip add 10.4.4.4 255.255.255.0
R4(config-if)#no shut
R4(config)#interface f0/0
R4(config-if)#int loopback4
R4(config-if)#ip add 4.4.4.4 255.255.255.0[/TD]
[/TR]
[/TABLE]
2. Cấu hình OSPF trên các Router
- Cấu hình OSPF cho các interface của Router thuộc Area 0
- Như bài lab trước các bạn cũng biết rằng, các subnet trên interface loopback được OSPF quảng bá đi với prefix-length là /32 bất kể prefix-length của nó là bao nhiêu đi nữa. Nếu các bạn không muốn nhìn thấy prefix-length /32 như vầy thì các bạn có thể sử dụng thêm lệnh sau
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Trên Router R1
R1(config)#int loopback1
R1(config-if)#ip ospf network point-to-point
// Trên Router R2
R2(config)#int loopback2
R2(config-if)#ip ospf network point-to-point[/TD]
[/TR]
[/TABLE]
- Kiểm tra lại bảng đinh tuyến của Router R1 và R2
- Tiếp theo các bạ thực hiện cấu hình OSPF trên các interface R2 và R3 thuộc Area 23
- Các bạn lên Router R2 kiểm tra lại thì thấy trên bảng đinh tuyến của R2 không có route nào bị đánh dấu là O IA. Vì Router R2 là Router biên, nó nằm giữa 2 vùng (Area 0 và Area 23). Nó còn được gọi là ABR - Area Border Router
3. Cấu hình EIGRP và Redistribute
- Tiếp theo chúng ta sẽ thực hiện cấu hình EIGRP giữa 2 Router R2 và R4
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Cấu hình EIGRP trên R2
R2(config)#router eigrp 1
R2(config-router)#network 10.4.4.2 0.0.0.0
// Cấu hình EIGRP trên R4
R4(config)#router eigrp 1
R4(config-router)#network 10.4.4.4 0.0.0.0
R4(config-router)#network 4.4.4.4 0.0.0.0[/TD]
[/TR]
[/TABLE]
- Tiếp theo các bạn thực hiện Redistribute giữa 2 vùng định tuyến OSPF và EIGPR với nhau. Chúng ta sẽ đứng trên Router biên giới giữa 2 vùng định tuyến trên là R2 để thực hiện quăng các vùng định tuyến qua lại lẫn nhau
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]R2(config)#router eigrp 1
R2(config-router)#redistribute ospf 1 metric 100000 100 255 1 1500
R2(config-router)#router ospf 1
R2(config-router)#redistribute eigrp 1 subnets[/TD]
[/TR]
[/TABLE]
- Các bạn thực hiện kiểm tra bảng đinh tuyến các Router R4 sẽ thấy các route có ký hiệu D EX. Nó chính là các route đinh tuyến ngoại vùng của EIGRP.
- Tương tự các bạn kiểm tra bảng định tuyến của R3, các bạn sẽ thấy các route có ký hiệu O E2, nó chính là các route định tuyến ngoại vùng của OSPF
- Mô hình- Giới thiệu: Các bạn có thể tìm hiểu lý thuyết của bài Lab này tại đây: http://svuit.vn/showthread.php/206-Chapter-4-part-2-Dynamic-Routing
- Yêu cầu:
- Cấu hình IP như mô hình trên
- Cấu hình Route OSPF cho các Router như sau
- Area 0 gồm: loopback1, f0/0 trên R1 và loopback2, f0/0 trên R2
- Area 23 gồm: f0/1 trên R2 và loopback3, f0/0 trên R3
- Đảm bảo hệ thống mạng hội tụ
- Cấu hình Stub OSPF đặc biệt
- Stub
- Totally Stubby
- Not so Stubby area
1. Cấu hình IP trên các router R1,R2,R3 và R4
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Cấu hình IP trên Router R1
R1(config)#int f0/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#int loopback1
R1(config-if)#ip add 1.1.1.1 255.255.255.0
// Cấu hình IP trên Router R2
R2(config)#int f0/0
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int f0/1
R2(config-if)#ip add 10.2.2.2 255.255.255.0
R2(config-if)#no shut
R2(config)#int f1/0
R2(config-if)#ip add 10.4.4.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int loopback2
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no shut
// Cấu hình IP trên Router R3
R3(config)#int f0/0
R3(config-if)#ip add 10.2.2.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int loopback3
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#int loopback33
R3(config-if)#ip add 33.33.33.33 255.255.255.0
// Cấu hình IP trên Router R4
R4(config)#int f0/0
R4(config-if)#ip add 10.4.4.4 255.255.255.0
R4(config-if)#no shut
R4(config)#interface f0/0
R4(config-if)#int loopback4
R4(config-if)#ip add 4.4.4.4 255.255.255.0[/TD]
[/TR]
[/TABLE]
- Cấu hình OSPF cho các interface của Router thuộc Area 0
- R1: f0/0 và loopback1
- R2: f0/0 và loopback2
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Cấu hình OSPF trên Router R1
R1(config)#router ospf 1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 10.1.1.1 0.0.0.0 area 0
// Cấu hình OSPF trên Router R2
R2(config)#router ospf 1
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#network 10.1.1.2 0.0.0.0 area 0[/TD]
[/TR]
[/TABLE]
- Kiểm tra bảng định tuyến của 2 Router R1 và R2[TR]
[TD]// Cấu hình OSPF trên Router R1
R1(config)#router ospf 1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 10.1.1.1 0.0.0.0 area 0
// Cấu hình OSPF trên Router R2
R2(config)#router ospf 1
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#network 10.1.1.2 0.0.0.0 area 0[/TD]
[/TR]
[/TABLE]
Code:
R1#[COLOR=#ff0000][B]sh ip route[/B][/COLOR]
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback1
2.0.0.0/32 is subnetted, 1 subnets
[COLOR=#ff0000]O 2.2.2.2 [110/11] via 10.1.1.2[/COLOR], 00:06:27, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Trên Router R1
R1(config)#int loopback1
R1(config-if)#ip ospf network point-to-point
// Trên Router R2
R2(config)#int loopback2
R2(config-if)#ip ospf network point-to-point[/TD]
[/TR]
[/TABLE]
Code:
R1#[COLOR=#ff0000][B]sh ip route[/B][/COLOR]
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback1
2.0.0.0/24 is subnetted, 1 subnets
[COLOR=#ff0000]O 2.2.2.0 [/COLOR][110/11] [COLOR=#ff0000]via 10.1.1.2[/COLOR], 00:00:06, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
- Tiếp theo các bạ thực hiện cấu hình OSPF trên các interface R2 và R3 thuộc Area 23
- R2: f0/1
- R3: f0/0, loopback3
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Cấu hình OSPF trên R2
R2(config)#router ospf 1
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#network 10.1.1.2 0.0.0.0 area 0
R2(config-router)#int loopback2
R2(config-if)#ip ospf network point-to-point
// Cấu hình OSPF trên R3
R3(config)#router ospf 1
R3(config-router)#network 3.3.3.3 0.0.0.0 area 23
R3(config-router)#network 10.2.2.3 0.0.0.0 area 23
R3(config-router)#int loopback3
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback33
R3(config-if)#ip ospf network point-to-point[/TD]
[/TR]
[/TABLE]
- Kiểm tra bảng định tuyến R3 các bạn sẽ thấy các route O IA như[TR]
[TD]// Cấu hình OSPF trên R2
R2(config)#router ospf 1
R2(config-router)#network 2.2.2.2 0.0.0.0 area 0
R2(config-router)#network 10.1.1.2 0.0.0.0 area 0
R2(config-router)#int loopback2
R2(config-if)#ip ospf network point-to-point
// Cấu hình OSPF trên R3
R3(config)#router ospf 1
R3(config-router)#network 3.3.3.3 0.0.0.0 area 23
R3(config-router)#network 10.2.2.3 0.0.0.0 area 23
R3(config-router)#int loopback3
R3(config-if)#ip ospf network point-to-point
R3(config-if)#int loopback33
R3(config-if)#ip ospf network point-to-point[/TD]
[/TR]
[/TABLE]
- OIA 1.1.1.0
- OIA 2.2.2.0
- OIA 10.1.1.0
Code:
R3#[COLOR=#ff0000][B]sh ip route[/B][/COLOR]
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, [COLOR=#00ff00]O - OSPF, IA - OSPF inter area[/COLOR]
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
1.0.0.0/24 is subnetted, 1 subnets
[COLOR=#ff0000]O IA 1.1.1.0[/COLOR] [110/21] via 10.2.2.2, 00:00:39, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
[COLOR=#ff0000]O IA 2.2.2.0[/COLOR] [110/11] via 10.2.2.2, 00:00:39, FastEthernet0/0
33.0.0.0/24 is subnetted, 1 subnets
C 33.33.33.0 is directly connected, Loopback33
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback3
10.0.0.0/24 is subnetted, 2 subnets
C 10.2.2.0 is directly connected, FastEthernet0/0
[COLOR=#ff0000]O IA 10.1.1.0[/COLOR] [110/20] via 10.2.2.2, 00:00:41, FastEthernet0/0
Code:
R2#sh ip route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
O 1.1.1.0 [110/11] via 10.1.1.1, 00:08:03, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback2
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/11] via 10.2.2.3, 00:06:38, FastEthernet0/1
10.0.0.0/24 is subnetted, 2 subnets
C 10.2.2.0 is directly connected, FastEthernet0/1
C 10.1.1.0 is directly connected, FastEthernet0/0
- Tiếp theo chúng ta sẽ thực hiện cấu hình EIGRP giữa 2 Router R2 và R4
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]// Cấu hình EIGRP trên R2
R2(config)#router eigrp 1
R2(config-router)#network 10.4.4.2 0.0.0.0
// Cấu hình EIGRP trên R4
R4(config)#router eigrp 1
R4(config-router)#network 10.4.4.4 0.0.0.0
R4(config-router)#network 4.4.4.4 0.0.0.0[/TD]
[/TR]
[/TABLE]
[TABLE="class: outer_border, width: 500"]
[TR]
[TD]R2(config)#router eigrp 1
R2(config-router)#redistribute ospf 1 metric 100000 100 255 1 1500
R2(config-router)#router ospf 1
R2(config-router)#redistribute eigrp 1 subnets[/TD]
[/TR]
[/TABLE]
Code:
R4#sh ip route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
[COLOR=#ff0000]D EX 1.1.1.0 [170/307200] via 10.4.4.2[/COLOR], 00:07:21, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
[COLOR=#ff0000]D EX 2.2.2.0 [170/307200] via 10.4.4.2[/COLOR], 00:07:21, FastEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
[COLOR=#ff0000]D EX 3.3.3.0 [170/307200] via 10.4.4.2[/COLOR], 00:06:12, FastEthernet0/0
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 4.4.4.0/24 is directly connected, Loopback4
D 4.0.0.0/8 is a summary, 00:09:49, Null0
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.4.4.0/24 is directly connected, FastEthernet0/0
D EX 10.2.2.0/24 [170/307200] via 10.4.4.2, 00:07:25, FastEthernet0/0
D EX 10.1.1.0/24 [170/307200] via 10.4.4.2, 00:07:25, FastEthernet0/0
D 10.0.0.0/8 is a summary, 00:09:50, Null0
Code:
R3#[COLOR=#ff0000][B]sh ip route[/B][/COLOR]
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, [COLOR=#00ff00]EX - EIGRP external[/COLOR], O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
[COLOR=#00ff00] E1 - OSPF external type 1[/COLOR], [COLOR=#00ff00]E2 - OSPF external type 2[/COLOR]
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
1.0.0.0/24 is subnetted, 1 subnets
O IA 1.1.1.0 [110/21] via 10.2.2.2, 00:09:39, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
O IA 2.2.2.0 [110/11] via 10.2.2.2, 00:09:39, FastEthernet0/0
33.0.0.0/24 is subnetted, 1 subnets
C 33.33.33.0 is directly connected, Loopback33
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback3
[COLOR=#ff0000]O E2 4.0.0.0/8 [110/20] via 10.2.2.2, 00:09:39, FastEthernet0/0[/COLOR]
10.0.0.0/24 is subnetted, 3 subnets
[COLOR=#ff0000]O E2 10.4.4.0 [110/20] via 10.2.2.2, 00:09:41, FastEthernet0/0[/COLOR]
C 10.2.2.0 is directly connected, FastEthernet0/0
O IA 10.1.1.0 [110/20] via 10.2.2.2, 00:09:41, FastEthernet0/0