[ASA Firewall] Tập lệnh cơ bản

1.Cấu hình mặc định: ASA dòng 5510 và cao hơn đã được cấu hình trước management interface, DHCP và ASDM
Cấu hình mặc định của ASA 5505:

2. So sánh 1 số lệnh cơ bản trên ASA với IOS Router/Switch

3. Một số thao tác lệnh khác với IOS Router/Switch
3.1.Thực hiện lệnh ở các mode khác nhau.
Ví dụ: thực hiện lệnh show ở config mode, config-if mode, config-router mode …
ciscoasa(config)# show run
: Saved
:
ASA Version 8.4(2)
!
ciscoasa(config-if)# show run
: Saved
:
ASA Version 8.4(2)
!
ciscoasa(config-router)# show run
: Saved
:
ASA Version 8.4(2)
3.2. Dùng lệnh help để xem mô tả ngắn gọn và cú pháp
Ví dụ:
ciscoasa# help reload
USAGE:
reload [quick] [noconfirm] [save-config] [max-hold-time [hhh:]mm]
[{in [hhh:]mm | at hh:mm [{Mon dd | dd Mon}] }] [reason <text>]
reload cancel
DESCRIPTION:
reload Halt and reload system
SYNTAX:
quick Reload without properly shutting down each subsystem
noconfirm Reload immediately without asking for confirmation
save-config Save configuration before reload
max-hold-time Maximum hold time for orderly reload
at Reload at a specific time/date
in Reload after a time interval
reason Reason for reload
3.3. Để ngắt lệnh show, sử dụng phím Q
Ví dụ:
ciscoasa# show run
: Saved
:
ASA Version 8.4(2)
!
hostname ciscoasa
enable password 8Ry2YjIyt7RRXU24 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
!
interface GigabitEthernet0
shutdown
no nameif
no security-level
no ip address
!
interface GigabitEthernet1
nameif inside
security-level 100
ip address 172.16.1.4 255.255.255.0
!
interface GigabitEthernet2
nameif dmz
security-level 50
ip address 192.168.1.4 255.255.255.0
!
<— More —> // Gõ phím Q để ngắt lệnh
4.Lệnh write
ciscoasa# write ?
erase Clear flash memory configuration // thay thế erase startup-config
memory Save active configuration to the flash // tương đương copy running-config startup-config
net Save the active configuration to the tftp server // tương đương copy running-config tftp:
standby Save the active configuration on the active unit to the flash on
the standby unit
terminal Display the current active configuration // tương đương show running-config
<cr>
5. Cấu hình default route
route interface-name 0.0.0.0 0.0.0.0 next-hop-ip-address
6. Cấu hình Telnet và SSH

Kiểm tra và hủy kết nối Telnet:
ciscoasa(config)# who ?
exec mode commands/options:
Hostname or A.B.C.D IP address
Hostname or X:X:X:X::X IPv6 address
<cr>
ciscoasa(config)# who
0: 10.0.11.17
ciscoasa(config)# kill ?
exec mode commands/options:
<0-2147483647> Session ID as displayed by the who command
ciscoasa(config)# kill 0
7. Cấu hình dịch vụ DHCP


Note: Trong ví dụ này, ASA là DHCP client ở miền outside và là DHCP server đối với inside. Với lệnh dhcpd auto_config outside, ASA sẽ gửi thông tin WINS/DNS/Domain (nhận được từ outside) cho client ở cổng inside
8. Quản lý cấu hình
8.1 Xóa 1 phần của cấu hình hiện tại :
ciscoasa(config)# clear configure ?
configure mode commands/options:
aaa Clear user authentication, authorization and
accounting configuration
aaa-server Clear aaa-server configuration
access-group Clear access-group configuration
access-list Clear configured access control elements
all Clear all configuration
arp Clear arp configuration
asdm Clear Device Manager configuration
auth-prompt Clear configured authentication challenge,
reject and acceptance prompts
auto-update Clear Auto Update configuration
banner Clear login/session banners
boot Clear all boot configuration
call-home Reset Smart Call-Home configuration to default
checkheaps Clear configured checkheaps
class-map Clear class-map configuration
client-update Clear the entire client-update configuration
clock Clear clock configuration
command-alias Clear configured command aliases
compression Clear global compression configuration
console Reset console settings to defaults
coredump Clear coredump configuration, removes coredump
filesystem and its contents
<— More —>
Vd:
ciscoasa(config)# clear configure interface // xóa tất cả cấu hình interface
ciscoasa(config)# clear configure access-list // xóa tất cả cấu hình access-list
8.2. Xóa tất cả cấu hình hiện tại và không cần khởi động lại ASA
ciscoasa(config)# clear configure all
8.3. Khôi phục cấu hình mặc định
ciscoasa(config)# configure factory-default
Tham khảo:
– CCNA Security Curriculum
– Cisco.Press.CCNP.Security.FIREWALL.642-618.Official.Cert.Guide.May.2012
– Cisco ASA All-in-One Next-Generation Firewall, IPS, and VPN Services, Third Edition