làm từng bước cho bạn:
- cấu hình các địa chỉ , trên R3 trỏ default route về asa, trên dmz trỏ default route về asa, trên asa trỏ default route đến outside và route giải mạng 192.168.1.0/24 qua interface inside, trên outside R1 route giải mạng 100.100.100.0/24 qua 172.16.2.1.
- test thử ping từ asa đến các vùng xem ok ko. ping từ các vùng đến asa xem ok ko.
- để inside (192.168.1.0/24) ra được ngoài outside và ping được từ inside ra ngoài outside
Code:
asa:
nat (inside) 1 192.168.1.0 255.255.255.0
global (outside) 1 interface
access-list INSIDE-PING extended permit icmp any host 172.16.2.1 echo
access-list INSIDE-PING extended permit icmp any host 172.16.2.1 echo-reply
access-group INSIDE-PING in interface outside
route outside 0.0.0.0 0.0.0.0 172.16.2.2
route inside 192.168.1.0 255.255.255.0 172.16.1.1
ping thử từ R3 ra ngoài outside:
R3# ping 172.16.2.2 source 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.2, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/35/52 ms
R3# ping 10.10.10.1 source 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/39/52 ms
- để từ inside ping được vào dmz và thực hiên identity NAT (NAT 0) đối với các packet từ inside vào dmz, hoặc bạn có thể dùng static NAT "static (inside,dmz) 192.168.1.0 192.168.1.0 netmask 255.255.255.0" cũng ok
Code:
asa:
access-list NONAT-INSIDE-DMZ extended permit ip 192.168.1.0 255.255.255.0 10.1.1.0 255.255.255.0
access-list DMZ-PING extended permit icmp 10.1.1.0 255.255.255.0 any echo
access-list DMZ-PING extended permit icmp 10.1.1.0 255.255.255.0 any echo-reply
nat (inside) 0 access-list NONAT-INSIDE-DMZ
access-group DMZ-PING in interface dmz
ping thử từ R3 vào DMZ:
R3#ping 10.1.1.2 source 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.2, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/46/80 ms
- để outside nhìn server trong DMZ dưới địa chỉ 100.100.100.1 và ping được từ outside đến 100.100.100.1
Code:
asa: thêm 2 dòng vào access-list INSIDE-PING được apply vào interface outside
access-list INSIDE-PING extended permit icmp any host 100.100.100.1 echo
access-list INSIDE-PING extended permit icmp any host 100.100.100.1 echo-reply
static (dmz,outside) 100.100.100.1 10.1.1.2 netmask 255.255.255.255
ping thử từ outside R1 tới 100.100.100.1 :
R1#ping 100.100.100.1Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/40/96 ms
R1#ping 100.100.100.1 source 10.10.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.1, timeout is 2 seconds:
Packet sent with a source address of 10.10.10.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/56 ms
ping từ DMZ R2 ra ngoài outside:
R2#ping 172.16.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/88 ms
R2#ping 10.10.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/68 ms
cấu hình đầy đủ trên asa:
Code:
interface Ethernet0
nameif inside
security-level 100
ip address 172.16.1.1 255.255.255.0
!
interface Ethernet1
nameif dmz
security-level 50
ip address 10.1.1.1 255.255.255.0
!
interface Ethernet2
nameif outside
security-level 0
ip address 172.16.2.1 255.255.255.0
!
interface Ethernet3
shutdown
no nameif
no security-level
no ip address
!
interface Ethernet4
shutdown
no nameif
no security-level
no ip address
!
passwd 2KFQnbNIdI.2KYOU encrypted
ftp mode passive
access-list INSIDE-PING extended permit icmp any host 172.16.2.1 echo
access-list INSIDE-PING extended permit icmp any host 172.16.2.1 echo-reply
access-list INSIDE-PING extended permit icmp any host 100.100.100.1 echo
access-list INSIDE-PING extended permit icmp any host 100.100.100.1 echo-reply
access-list NONAT-INSIDE-DMZ extended permit ip 192.168.1.0 255.255.255.0 10.1.1.0 255.255.255.0
access-list DMZ-PING extended permit icmp 10.1.1.0 255.255.255.0 any echo
access-list DMZ-PING extended permit icmp 10.1.1.0 255.255.255.0 any echo-reply
pager lines 24
mtu inside 1500
mtu dmz 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list NONAT-INSIDE-DMZ
nat (inside) 1 192.168.1.0 255.255.255.0
static (dmz,outside) 100.100.100.1 10.1.1.2 netmask 255.255.255.255
access-group DMZ-PING in interface dmz
access-group INSIDE-PING in interface outside
route outside 0.0.0.0 0.0.0.0 172.16.2.2 1
route inside 192.168.1.0 255.255.255.0 172.16.1.1 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout uauth 0:05:00 absolute
dynamic-access-policy-record DfltAccessPolicy
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
no crypto isakmp nat-traversal
telnet timeout 5
ssh timeout 5
console timeout 0
threat-detection basic-threat