phamminhtuan
02-12-2008, 11:22 AM
Distribute-list nội.
http://img117.imageshack.us/img117/1290/37493237ly1.jpg (http://img117.imageshack.us/my.php?image=37493237ly1.jpg)
R2#sh ip ro
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.1.1, 00:00:04, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.6, 00:00:04, FastEthernet1/0
192.168.1.0/30 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
C 192.168.1.4 is directly connected, FastEthernet1/0
R3#sh ip route
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.1.1, 00:00:32, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.6, 00:00:32, FastEthernet1/0
12.0.0.0/32 is subnetted, 1 subnets
O 12.12.12.12 [110/2] via 192.168.1.1, 00:00:32, FastEthernet0/0
192.168.1.0/30 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
C 192.168.1.4 is directly connected, FastEthernet1/0
access-list 1 deny 1.1.1.1
access-list 1 permit any
router ospf 1
router-id 2.2.2.2
network 192.168.1.0 0.0.0.255 area 0
distribute-list 1 in FastEthernet0/0
R2# show ip route [đã mất mạng 1.1.1.1/32]
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.6, 00:01:10, FastEthernet1/0
12.0.0.0/32 is subnetted, 1 subnets
O 12.12.12.12 [110/2] via 192.168.1.1, 00:01:10, FastEthernet0/0
192.168.1.0/30 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
C 192.168.1.4 is directly connected, FastEthernet1/0
R3#sh ip route [R3 vẫn còn nguyên mạng 1.1.1.1/32]
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/3] via 192.168.1.5, 00:03:43, FastEthernet1/0
C 3.0.0.0/8 is directly connected, Loopback3
12.0.0.0/32 is subnetted, 1 subnets
O 12.12.12.12 [110/3] via 192.168.1.5, 00:03:43, FastEthernet1/0
192.168.1.0/30 is subnetted, 2 subnets
O 192.168.1.0 [110/2] via 192.168.1.5, 00:03:43, FastEthernet1/0
C 192.168.1.4 is directly connected, FastEthernet1/0
Kết luận:
Trên R2 show ip ospf database router ta thấy mạng 1.1.1.1/32 vẫn được học qua LSA vào bảng topology link-state. Do đó lọc trên chỉ tác dụng giữa bảng topology và bảng routing table. Do đó ta lọc chiều out sẽ không được vì lúc này topology đã tính xong và đưa vào bảng routing table. Và qua đó ta cũng thấy rõ là OSPF chỉ quảng bá LSA khác với các giao thức Distance là quảng bá route.
Nói tóm lại những gì có liên qua tới ACL thì chỉ lọc route là chính.
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 354
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000007
Checksum: 0xBF38
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 12.12.12.12
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 1.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.1.1
(Link Data) Router Interface address: 192.168.1.1
Number of TOS metrics: 0
TOS 0 Metrics: 1
File đính kèm.
http://img117.imageshack.us/img117/1290/37493237ly1.jpg (http://img117.imageshack.us/my.php?image=37493237ly1.jpg)
R2#sh ip ro
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.1.1, 00:00:04, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.6, 00:00:04, FastEthernet1/0
192.168.1.0/30 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
C 192.168.1.4 is directly connected, FastEthernet1/0
R3#sh ip route
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.1.1, 00:00:32, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.6, 00:00:32, FastEthernet1/0
12.0.0.0/32 is subnetted, 1 subnets
O 12.12.12.12 [110/2] via 192.168.1.1, 00:00:32, FastEthernet0/0
192.168.1.0/30 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
C 192.168.1.4 is directly connected, FastEthernet1/0
access-list 1 deny 1.1.1.1
access-list 1 permit any
router ospf 1
router-id 2.2.2.2
network 192.168.1.0 0.0.0.255 area 0
distribute-list 1 in FastEthernet0/0
R2# show ip route [đã mất mạng 1.1.1.1/32]
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.1.6, 00:01:10, FastEthernet1/0
12.0.0.0/32 is subnetted, 1 subnets
O 12.12.12.12 [110/2] via 192.168.1.1, 00:01:10, FastEthernet0/0
192.168.1.0/30 is subnetted, 2 subnets
C 192.168.1.0 is directly connected, FastEthernet0/0
C 192.168.1.4 is directly connected, FastEthernet1/0
R3#sh ip route [R3 vẫn còn nguyên mạng 1.1.1.1/32]
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/3] via 192.168.1.5, 00:03:43, FastEthernet1/0
C 3.0.0.0/8 is directly connected, Loopback3
12.0.0.0/32 is subnetted, 1 subnets
O 12.12.12.12 [110/3] via 192.168.1.5, 00:03:43, FastEthernet1/0
192.168.1.0/30 is subnetted, 2 subnets
O 192.168.1.0 [110/2] via 192.168.1.5, 00:03:43, FastEthernet1/0
C 192.168.1.4 is directly connected, FastEthernet1/0
Kết luận:
Trên R2 show ip ospf database router ta thấy mạng 1.1.1.1/32 vẫn được học qua LSA vào bảng topology link-state. Do đó lọc trên chỉ tác dụng giữa bảng topology và bảng routing table. Do đó ta lọc chiều out sẽ không được vì lúc này topology đã tính xong và đưa vào bảng routing table. Và qua đó ta cũng thấy rõ là OSPF chỉ quảng bá LSA khác với các giao thức Distance là quảng bá route.
Nói tóm lại những gì có liên qua tới ACL thì chỉ lọc route là chính.
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 354
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000007
Checksum: 0xBF38
Length: 60
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 12.12.12.12
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 1.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.1.1
(Link Data) Router Interface address: 192.168.1.1
Number of TOS metrics: 0
TOS 0 Metrics: 1
File đính kèm.