PDA

View Full Version : Trường hợp redistribute nhưng vẫn học qua RIP



phamminhtuan
01-12-2008, 02:49 PM
http://img123.imageshack.us/img123/1711/66627036sv5.jpg (http://img123.imageshack.us/my.php?image=66627036sv5.jpg)


Hình 1:
R2#
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
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
R2#show ip route
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 192.168.12.1, 00:00:10, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback1
O 3.0.0.0/8 [110/2] via 192.168.23.2, 00:03:00, FastEthernet1/0
4.0.0.0/25 is subnetted, 1 subnets
O 4.4.4.0 [110/2] via 192.168.23.2, 00:03:00, FastEthernet1/0
C 192.168.23.0/24 is directly connected, FastEthernet1/0
R 12.0.0.0/8 [120/1] via 192.168.12.1, 00:00:10, FastEthernet0/0

R1#
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
R 2.0.0.0/8 [120/5] via 192.168.12.2, 00:00:17, FastEthernet0/0
R 3.0.0.0/8 [120/5] via 192.168.12.2, 00:00:17, FastEthernet0/0
R 4.0.0.0/8 [120/5] via 192.168.12.2, 00:00:17, FastEthernet0/0
R 192.168.23.0/24 [120/5] via 192.168.12.2, 00:00:17, FastEthernet0/0

Ta thấy với câu lệnh redistribute ospf 1 metric 5 trong mode router rip của R2 thì tất cả những gì tham gia OSPF đều có trong bảng định tuyến của R1 với metric là 5.


http://img123.imageshack.us/img123/2879/28711623hq0.jpg (http://img123.imageshack.us/my.php?image=28711623hq0.jpg)
Hình 2
Cấu hình 2 như trên và redistribute từ OSPF vào RIP

R3#
router ospf 1
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 4.4.4.4 0.0.0.0 area 0
network 192.168.1.6 0.0.0.0 area 0

R2#
interface Loopback1
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.252
!
interface FastEthernet1/0
ip address 192.168.1.5 255.255.255.252
router ospf 1
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 192.168.1.5 0.0.0.0 area 0
!
router rip
network 192.168.1.0

R1#
router rip
network 1.0.0.0
network 12.0.0.0
network 192.168.1.0

R2(config)#router rip
R2(config-router)#redistribute ospf 1 metric 5


Qua R1 show ip route để thấy sự khác biệt
R 2.0.0.0/8 [120/5] via 192.168.1.2, 00:00:16, FastEthernet0/0
R 3.0.0.0/8 [120/5] via 192.168.1.2, 00:00:16, FastEthernet0/0
R 4.0.0.0/8 [120/5] via 192.168.1.2, 00:00:16, FastEthernet0/0
C 12.0.0.0/8 is directly connected, Loopback12
192.168.1.0/30 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
R 192.168.1.4 [120/1] via 192.168.1.2, 00:00:17, FastEthernet0/0

Kết luận:
Mạng 192.168.1.4 là giữa R2 và R3 nhưng tại sao khi redistribute vào nó vẫn metric là 1, tại sao ?
Đó là do trên RIP không quảng bá chính xác cổng được. câu lệnh network 192.168.1.0 đã bao gồm mạng 192.168.1.4 nên học qua RIP chỉ metric là 1 và học qua OSPF redistribute vào thì metric là 5. Cho nên nó học qua RIP tốt hơn với metric là 1.


R1(config)#router rip
R1(config-router)#passive-interface f1/0
Câu lệnh trên nếu dùng trong mode router rip thì có nghĩa cổng này không tham gia quảng bá ra nhưng vẫn nhận vào.
=> Mạng trong cổng này vẫn được cổng khác tham gia RIP quảng bá vì nó vẫn nhận định tuyến vào.
Đây là file đính kèm.