PDA

View Full Version : Một điểm chú ý khi dùng outbound ACL.



ppp
21-10-2003, 12:03 PM
Khi làm lab CCNP có thể các bạn sẽ gặp một tình huống như sau :

R1(s0) -----------(s1)R2

R1
...
access-list 101 deny ip any any
interface s0
ip access-group 1 out

Cả hai router R1 , R2 đều chạy OSPF. Mặc dù có outbound ACL ở interface S0 của R1 , hai router vẫn thành lập được neighbor???

Từ R1 ping s1 của R2. Kết quả lệnh ping là !!!!!

Nhưng nếu ACL trên được apply vào Inbound của S0 (R1) thì kết quả lại khác. OSPF không thành lập được neighbor và nếu ping từ R1 đến s1 của R2 thì sẽ fail.

Như vậy ta có thể kết luận được điều gì. Outbound ACL không có tác dụng đối với những packet xuất phát từ router. Do đó ICMP packet và OSPF packet sẽ không bị ảnh hưởng bởi ACL nếu ACL được đặt ở outbound. Trong trường hợp này nếu ACL được đặt ở inbound của S0 (R1) thì OSPF không thành lập được neighbor là do các OSPF packet từ R2 sẽ bị filter. Còn kết quả của lệnh ping fail là do các ICMP packet từ R2 sẽ bị filetr ở inbound của S0 (R1).

Một điểm chú ý nhỏ về ACL nhưng cũng gây rắc rối nhiều trong khi làm lab. :D

Cám ơn đã đọc !

1'hpSky
21-10-2003, 06:36 PM
Mình tổng quát lên là "Nếu đặt ACL chiều outbound thì tất cả các traffic xuất phát từ chính router đó sẽ không bị check". Đấy là bản chất của OUTBOUND

Thân

Neo
21-10-2003, 06:56 PM
ppp xem thử cấu hình sau:

R2#sh run
00:16:33: %SYS-5-CONFIG_I: Configured from console by console
Building configuration...

Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R2
!
!
ip subnet-zero
no ip domain-lookup
!
interface Serial0
ip address 10.0.0.2 255.255.255.0
no ip directed-broadcast
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0
!
!
line con 0
transport input none
line aux 0
line vty 0 4
!

R1#
R1#
R1#sh run
Building configuration...

Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R1
!
ip subnet-zero
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
interface Ethernet0
ip address 10.10.10.1 255.255.255.0
no keepalive
!
interface Serial0
ip address 10.0.0.1 255.255.255.0
ip access-group 1 out
clockrate 64000
!
ip classless
no ip http server
!
access-list 1 deny any
!
line con 0
transport input none
line 1 8
line aux 0
line vty 0 4
end

R1#ping
Protocol [ip]:
Target IP address: 10.0.0.2
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 1.1.1.1
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/44/48 ms
R1#

R1#ping
Protocol [ip]:
Target IP address: 10.0.0.2
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 10.10.10.1
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/48/48 ms
R1#

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int e0
R1(config-if)#no keepalive

R1#ping 10.10.10.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/12/12 ms

R1#ping
Protocol [ip]:
Target IP address: 10.0.0.2
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 10.10.10.10
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/48/48 ms
R1#

themask
23-10-2003, 03:12 PM
..."The "in" ACL has a source on a segment of the interface to which it is applied and a destination off of any other interface. The "out" ACL has a source on a segment of any interface other than the interface to which it is applied and a destination off of the interface to which it is applied."...


http://www.cisco.com/warp/public/707/confaccesslists.html