Cha`o !!!

Originally Posted by
canhochoi
các bác cho em hỏi về OSPF. Lệnh no-redeistribute trong cấu hình nssa để làm gì, có ví dụ cụ thể về trường hợp dùng lệnh này ko? lệnh này có lợi ích gì ?? tại sao phải dùng nó ???
area area-id nssa no-redeistribute defau-infor ori
Thanks
Chào bạn !!!
Bạn xem bài LAB bên dưới :
Đầu tiên ta xét câu lệnh :
Code:
area area-id nssa no-redistribution
Trong đó :
·Area-id : OSPF area ID. Tuy nhiên area-id dùng trong bài này là một giá trị nằm từ 1 – 4.294.967.295 (cấu hình trên router CISCO) hoặc dạng IP address : 0.0.0.1 – 255.255.255.255 (cấu hình trên router Juniper,…). Do area 0 hay area 0.0.0.0 không thể nào cấu hình là NSSA được.
Lý thuyết : trong stub hoặc totally stubby area , ABR trong stub area sẽ chống lại OSPF externel routers (type 5) từ bên ngoài quảng bá vào mạng. Có nghĩa là ASBR không thể nào là thành phần của stubby hoặc totally stubby area bời vì ASBR tạo ra OSPF externel type 5 routes.Chính vì tình huống : muốn quảng bá một mạng bên ngoài vào OSPF + vẫn giữa được những tính chất vốn có của stub và totally stubby area , vùng NSSA đã ra đời. Vùng NSSA ngoài những tính chất của 2 vùng trên , nó còn bỏ đi giới hạn "reditribute external OSPF routes" bằng cách :
+ Tại ASBR hay ABR , nó nhận gói tin LSA quảng bá external routes vào mạng OSPF => sau đó nó chuyển dạng gói tin type 5 (quy định chứa external route)này thành gói tin type 7.
-------+ Nếu như gói tin được nhận từ ASBR (do router C quảng bá)nó sẽ chuyển từ type 5 sang type 7 (như trên đã giải thích ở trên) sau đó khi đến vùng standard area tại ABR nó sẽ chuyển dạng type 7 sang type 5.
-------+ Nếu như gói tin được nhận tử ABR (do router E quảng bá) nó sẽ chuyển từ dạng type 5 sang type 7 để trở thành 1 route trong NSSA.
Hình minh họa:

Đầu tiên chúng ta cấu hình cho các Router , ở trạng thái trước khi bật câu lệnh :
Code:
area area-id nssa no-redistribution
cũng như
Code:
Router A
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Serial0/1
ip address 10.1.1.1 255.255.255.252
clockrate 64000
!
router ospf 1
redistribute connected subnets
network 10.1.1.0 0.0.0.3 area 0
_______________________________________________________________________
Router B
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Ethernet0
ip address 172.16.1.1 255.255.255.0
!
interface Serial0
ip address 10.1.1.2 255.255.255.252
!
interface Serial1
ip address 10.1.1.5 255.255.255.252
lockrate 64000
!
router eigrp 1
network 172.16.0.0
!
router ospf 1
redistribute eigrp 1 subnets
network 10.1.1.0 0.0.0.3 area 0
network 10.1.1.4 0.0.0.3 area 1
_______________________________________________________________________
Router C
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface Serial0
ip address 10.1.1.6 255.255.255.252
!
interface Serial1
ip address 10.1.1.10 255.255.255.252
clockrate 64000
!
router ospf 1
redistribute rip subnets
network 10.1.1.4 0.0.0.3 area 1
!
router rip
version 2
passive-interface Serial0
network 10.0.0.0
_______________________________________________________________________
Router D
interface Loopback0
ip address 156.26.32.1 255.255.255.0
!
interface Loopback1
ip address 156.26.33.1 255.255.255.0
!
interface Serial0/0
ip address 10.1.1.9 255.255.255.252
!
router rip
version 2
network 10.0.0.0
network 156.26.0.0
no auto-summary
_______________________________________________________________________
Router E
interface Loopback0
ip address 142.1.4.4 255.255.255.255
!
interface Ethernet0/0
ip address 172.16.1.2 255.255.255.0
!
router eigrp 1
network 142.1.0.0
network 172.16.0.0
no-auto-summary
Router A,B học mạng RIP từ C,D như một external routes và Router học EIGRP từ E cũng vậy.
rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
156.26.0.0/24 is subnetted, 2 subnets
O E2 156.26.32.0 [110/20] via 10.1.1.2, 00:02:29, Serial0/1
O E2 156.26.33.0 [110/20] via 10.1.1.2, 00:02:29, Serial0/1
172.16.0.0/24 is subnetted, 1 subnets
O E2 172.16.1.0 [110/20] via 10.1.1.2, 00:01:28, Serial0/1
142.1.0.0/32 is subnetted, 1 subnets
O E2 142.1.4.4 [110/20] via 10.1.1.2, 00:01:28, Serial0/1
10.0.0.0/30 is subnetted, 3 subnets
O E2 10.1.1.8 [110/20] via 10.1.1.2, 00:02:29, Serial0/1
C 10.1.1.0 is directly connected, Serial0/1
O IA 10.1.1.4 [110/128] via 10.1.1.2, 00:02:30, Serial0/1
_______________________________________________________________________
rtrB#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O E2 1.1.1.1 [110/20] via 10.1.1.1, 00:09:03, Serial0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
156.26.0.0/24 is subnetted, 2 subnets
O E2 156.26.32.0 [110/20] via 10.1.1.6, 00:09:03, Serial1
O E2 156.26.33.0 [110/20] via 10.1.1.6, 00:09:03, Serial1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Ethernet0
142.1.0.0/32 is subnetted, 1 subnets
D 142.1.4.4 [90/409600] via 172.16.1.2, 00:09:41, Ethernet0
10.0.0.0/30 is subnetted, 3 subnets
O E2 10.1.1.8 [110/20] via 10.1.1.6, 00:09:03, Serial1
C 10.1.1.0 is directly connected, Serial0
C 10.1.1.4 is directly connected, Serial1
Bây giờ chúng ta sẽ cấu hình NSSA trên Router B và C (Area 1)
Code:
Router B
router ospf 1
area 1 nssa
redistribute eigrp 1 subnets
network 10.1.1.0 0.0.0.3 area 0
network 10.1.1.4 0.0.0.3 area 1 _______________________________________________________________________ Router C
router ospf 1
area 1 nssa
redistribute rip subnets
network 10.1.1.4 0.0.0.3 area 1
Kiểm tra Area sau khi được cấu hình là NSSA :
Code:
rtrB#show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
Supports only single TOS(TOS0) routes
It is an area border and autonomous system boundary router
Redistributing External Routes from,
eigrp 1, includes subnets in redistribution
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 7. Checksum Sum 0x3F1B4
Number of DCbitless external LSA 0
Number of DoNotAge external LSA 0
Number of areas in this router is 2. 1 normal 0 stub 1 nssa
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm executed 10 times
Area ranges are
Number of LSA 3. Checksum Sum 0x275D9
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Area 1
Number of interfaces in this area is 1
It is a NSSA area
Perform type-7/type-5 LSA translation
Area has no authentication
SPF algorithm executed 23 times
Area ranges are
Number of LSA 9. Checksum Sum 0x4AE6A
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Sau đó ta tiếp tục kiểm tra bảng định tuyến của các Router A,B và C
Code:
rtrB#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O E2 1.1.1.1 [110/20] via 10.1.1.1, 00:02:19, Serial0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
156.26.0.0/24 is subnetted, 2 subnets
O N2 156.26.32.0 [110/20] via 10.1.1.6, 00:02:20, Serial1
O N2 156.26.33.0 [110/20] via 10.1.1.6, 00:02:20, Serial1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Ethernet0
142.1.0.0/32 is subnetted, 1 subnets
D 142.1.4.4 [90/409600] via 172.16.1.2, 00:18:28, Ethernet0
10.0.0.0/30 is subnetted, 3 subnets
O N2 10.1.1.8 [110/20] via 10.1.1.6, 00:02:20, Serial1
C 10.1.1.0 is directly connected, Serial0
C 10.1.1.4 is directly connected, Serial1
_______________________________________________________________________
rtrC#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
156.26.0.0/24 is subnetted, 2 subnets
R 156.26.32.0 [120/1] via 10.1.1.9, 00:00:06, Serial1
R 156.26.33.0 [120/1] via 10.1.1.9, 00:00:06, Serial1
172.16.0.0/24 is subnetted, 1 subnets
O N2 172.16.1.0 [110/20] via 10.1.1.5, 00:04:52, Serial0
142.1.0.0/32 is subnetted, 1 subnets
O N2 142.1.4.4 [110/20] via 10.1.1.5, 00:04:53, Serial0
10.0.0.0/30 is subnetted, 3 subnets
C 10.1.1.8 is directly connected, Serial1
O IA 10.1.1.0 [110/128] via 10.1.1.5, 00:04:53, Serial0
C 10.1.1.4 is directly connected, Serial0
Code:
Ta xét Router A, lúc này những mạng bên ngoài external OSPF route không còn được redistribute từ Router B theo LSA type 5 nữa mà được redistribute theo LSA type 7. Cụ thể :
+ Đối với RIPv2 : Router B sẽ chuyển đổi gói tin từ dạng Type 7 , do router C đã convert Ripv2 từ type 5 sang type 7 khi vào NSSA, sang type 5 khi vào Area 0
+ Đối với EIGRP : Router B sẽ redistribute LSA Type 5 vào Area0 , nhưng nó sẽ convert type 5 thành type 7 khi vào vùng Area 1 NSSA
rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
156.26.0.0/24 is subnetted, 2 subnets
O E2 156.26.32.0 [110/20] via 10.1.1.2, 00:06:14, Serial0/1
O E2 156.26.33.0 [110/20] via 10.1.1.2, 00:06:14, Serial0/1
172.16.0.0/24 is subnetted, 1 subnets
O E2 172.16.1.0 [110/20] via 10.1.1.2, 00:06:46, Serial0/1
142.1.0.0/32 is subnetted, 1 subnets
O E2 142.1.4.4 [110/20] via 10.1.1.2, 00:06:46, Serial0/1
10.0.0.0/30 is subnetted, 3 subnets
O E2 10.1.1.8 [110/20] via 10.1.1.2, 00:06:14, Serial0/1
C 10.1.1.0 is directly connected, Serial0/1
Code:
Cuối cùng , chúng ta xét đến trường hợp dùng câu lệnh :
Code:
area area-id nssa no-redistribution
Ý nghĩa của no-redistribution cho ta biết :
Router trong vùng NSSA sẽ không chấp nhận bất cứ external route nào (nó không convert nó sang LSA type 7), được quảng bá bởi ABR hay ASBR , tuy nhiên nó vẫn cho phép những tuyến trên được redistribute vào những vùng standard, hay NSSA khác.
Ta cấu hình trên Router để ngăn chặn việc redistribute mạng học từ EIGRP
Router B
router ospf 1
area 1 nssa no-redistribution
redistribute eigrp 1 subnets
network 10.1.1.0 0.0.0.3 area 0
network 10.1.1.4 0.0.0.3 area 1
Chúng ta kiểm tra tác dụng của câu lệnh trên
Code:
rtrB#show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
Supports only single TOS(TOS0) routes
It is an area border and autonomous system boundary router
Redistributing External Routes from,
eigrp 1, includes subnets in redistribution
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 7. Checksum Sum 0x3EFB5
Number of DCbitless external LSA 0
Number of DoNotAge external LSA 0
Number of areas in this router is 2. 1 normal 0 stub 1 nssa
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm executed 11 times
Area ranges are
Number of LSA 3. Checksum Sum 0x26FDC
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Area 1
Number of interfaces in this area is 1
It is a NSSA area, no redistribution into this area
Perform type-7/type-5 LSA translation
Area has no authentication
SPF algorithm executed 26 times
Area ranges are
Number of LSA 7. Checksum Sum 0x31A46
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
_______________________________________________________________________
rtrC#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
156.26.0.0/24 is subnetted, 2 subnets
R 156.26.32.0 [120/1] via 10.1.1.9, 00:00:02, Serial1
R 156.26.33.0 [120/1] via 10.1.1.9, 00:00:02, Serial1
10.0.0.0/30 is subnetted, 3 subnets
C 10.1.1.8 is directly connected, Serial1
O IA 10.1.1.0 [110/128] via 10.1.1.5, 00:04:37, Serial0
C 10.1.1.4 is directly connected, Serial0
Kiểm tra trên Router A :EIGRP vẫn được học bình thường
Code:
rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
156.26.0.0/24 is subnetted, 2 subnets
O E2 156.26.32.0 [110/20] via 10.1.1.2, 00:02:45, Serial0/1
O E2 156.26.33.0 [110/20] via 10.1.1.2, 00:02:45, Serial0/1
172.16.0.0/24 is subnetted, 1 subnets
O E2 172.16.1.0 [110/20] via 10.1.1.2, 00:14:41, Serial0/1
142.1.0.0/32 is subnetted, 1 subnets
O E2 142.1.4.4 [110/20] via 10.1.1.2, 00:14:41, Serial0/1
10.0.0.0/30 is subnetted, 3 subnets
O E2 10.1.1.8 [110/20] via 10.1.1.2, 00:02:45, Serial0/1
C 10.1.1.0 is directly connected, Serial0/1
O IA 10.1.1.4 [110/128] via 10.1.1.2, 00:14:42, Serial0/1
Phần thêm của câu lệnh " default-information-originate"
, tôi sẽ thực hiện trong bài LAB sau. Tuy nhiên , ta có thể hiểu ý nghĩa của nó như sau :
Code:
Nó giúp ta quảng bá default route vào NSSA area , do NSSA không chấp nhận default route
chúc bạn vui !!!
Link : http://www.vnpro.org/forum/showpost....97&postcount=3