Cấu hình ACL cho phép các kết nối FTP và WWW đến các server cụ thể. Không chặn các traffic cần thiết (routing, v …v).
Bước 1: Cấu hình cơ bản: địa chỉ IP, định tuyến OSPF, NAT tĩnh
Router R4
interface Loopback0
ip address 150.1.4.4 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
ip address 155.1.45.4 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 10.0.0.4 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 150.1.4.0 0.0.0.255 area 0
network 155.1.45.0 0.0.0.255 area 0
!
ip nat inside source static 10.0.0.1 150.1.4.4
Router R5
interface Loopback0
ip address 150.1.5.5 255.255.255.0
!
interface FastEthernet0/0
ip address 155.1.45.5 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 150.1.5.0 0.0.0.255 area 0
network 155.1.45.0 0.0.0.255 area 0
Router R1
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
duplex auto
speed auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.0.0.4
Bước 2: Cấu hình extended access-list FROM_OUTSIDE trên R4
ip access-list extended FROM_OUTSIDE
permit icmp any any echo
permit icmp any any echo-reply
permit udp any any range 33434 33464
permit icmp any any time-exceeded
permit icmp any any port-unreachable
permit ospf any any
permit tcp any host 150.1.4.4 range ftp-data ftp
permit tcp any host 150.1.4.4 range 1023 65535
permit tcp any host 150.1.4.4 eq www
deny ip any any log
Apply ACL lên các interface outside của R4
interface FastEthernet0/0
ip access-group FROM_OUTSIDE in
Bước 3: Cấu hình R1 thành FTP server và HTTP server
R1(config)#ip http server
R1(config)#ftp-server enable
R1(config)#ftp-server topdir flash:
Tạo file test.txt trên R1 để kiểm tra FTP
R1#copy running-config flash:test.txt
Destination filename [test.txt]?
Erase flash: before copying? [confirm]n
Verifying checksum... OK (0xC5CD)
910 bytes copied in 6.647 secs (137 bytes/sec)
Bước 4: Kiểm tra
R5#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)#no ip ftp passive
R5#copy ftp://150.1.4.1/test.txt null:
Accessing ftp://150.1.4.1/test.txt...
Loading test.txt !
[OK - 910/4096 bytes]
910 bytes copied in 2.560 secs (355 bytes/sec)
R5#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)#ip ftp passive
R5(config)#do copy ftp://150.1.4.1/test.txt null:
Accessing ftp://150.1.4.1/test.txt...
Loading test.txt !
[OK - 910/4096 bytes]
910 bytes copied in 2.584 secs (352 bytes/sec)
R5(config)#
R5#telnet 150.1.4.1 80
Trying 150.1.4.1, 80 ... Open
R5#disc 1
Closing connection to 150.1.4.1 [confirm]
R5#telnet 150.1.4.1
Trying 150.1.4.1 ...
% Destination unreachable; gateway or host down
------------------------------------