Cli Commands For ASA
Cli Commands For ASA
PIX / ASA configuration and monitoring connections. Methods 1 and 2 use CLI commands. 1 Console connection. Serial Port , Rollover cable to device. Secure because you have to physically access the device. No user password required, but privileged password maybe required. 2 Telnet or SSH remote connections. User password and privileged passwords required. 3 PDM or ASDM, GUI Java based web monitoring and configuration. AAA or local based authentication can require a username and password for improved security. CLI commands for console, telnet and SSH connections. PIX> enable Password: <default blank> PIX# disable PIX> help Or PIX> ? PIX> en ? PIX# help ----------<more> PIX# show ? PIX# configure terminal PIX(config)# show ? PIX(config)# hostname <Name> Name(config)# domain-name <dname> Name(config)# console timeout <#_of_minutes> <#_of_minutes> set to 0 and it does not timeout Name(config)# clock set hh:mm:ss day MONTH year MONTH is configured by name Name(config)# name <ip_address> <device_name> Name(config)# names PIX# setup Note: Not all commands are included in the PIX help, the ASAs help is better. Note: Command editing is similar to the switch and router CLI, but some of the advanced editing features depend on the firewalls OS version. (Example tab command completion does not work in pre 7 OSs.) Enter a q to quit long displays. Note: Show commands can be used in privileged or configuration mode.
Privileged exec- used for moving from user to privileged mode on all connection types.
Name(config)# enable password <password> Login Banners Name(config)# banner <banner-type> <banner text> <banner-types> - asdm, exec, login, motd
Motd- message displayed at beginning of all connections Asdm- message displayed post-login of an asdm connection Exec- message displayed before the CLI prompt Login- message displayed before the name and password prompts
ASA is the same except for the key generation, key saving and display. ASA(config)# crypto key generate rsa Follow and answer prompts. ASA# write memory ASA# show crypto key mypubkey rsa Note: Unless a username and password are configured, SSH connections, PIX and ASA use a default username of pix and the user password. (Up to OS 8.3). ASA(config)# username <name> password <password> ASA(config)# aaa authentication ssh console LOCAL ! Required for 8.4.2 or higher.
ASDM
ASDM (OS version 7 and later) PDM (OS version 6) Web and Java based GUI for configuring and monitoring ASA or PIX devices. PDM was included in flash on the PIX 501, but was an option on the other models. Starting with OS 7, ASDM was included and has been included in flash on all the ASAs. A basic configuration must be completed on the device to allow Web access to the device through one or more of its network interfaces. OS and ASDM, PDM versions are dependent on each other, updating one will usually require you to update the other. Also not all versions of the Java component are compatible with different versions of PDM or ASDM. The PIX 501s were never updated to IOS version 7 or later, and thus never were updated to ASDM. Our PIX 501 with PDM are only compatible with Java 1.4.1 or older. ASDM is compatible with 1.4.2 and newer. We will only do ASDM labs on the ASAs so that we wont have to keep changing and downgrading the Java component. ASDM uses HTTPS (SSL) to protect the communications between the desktop and the appliance. The factory default configuration on an ASA 5505 or PIX 501, allow for ASDM or PDM connections from hosts on the inside network. Basic ASA configuration required before ASDM can be used: ASA(config)# hostname <Name> Name(config)# domain-name <dmain> Name(config)# enable password <password> Name(config)# interface <physical_inter_name> Name(config-if)# nameif <logical_if_name> Name(config-if)# ip address <ip_address> <SNM> Name(config-if)# security-level <sec#> Name(config-if)# speed <value> Name(config-if)# duplex <value> Name(config-if)# no shutdown Name(config-if)# exit Name(config)# http server enable [port#] [port#] defaults to the standard value of 443, this option alls for changes. Name(config)# http <ip_address> <SNM> logical_if_name Hostname and domain-name are required, they used to generate the rsa key for SSL. A username and password can also be configured to enhance the ASDM logon security. ASA 5505 interface setting Name(config)# interface vlan <vlan_id> Name(config-if)# nameif <if-name> Name(config-if)# ip address <address> [snm] Name(config-if)# security-level <number> Note: Leave physical interface settings at their default values ( Auto negotiate speed, duplex E0/0 vlan 2, all others vlan1, all ports no shutdown)
Clear Commands
Clear Commands Clear commands are used to perform two functions in the PIX or ASA. 1 Clear counters, statistics or tables for the specified device function. 2 Clear the specified configuration commands. Note: Individual clear commands have been added with different OS versions, with many of them added in versions 7.0 to 7.2. As such, they will not all be available on our PIX 501s using version 6.3. Examples: ASA# clear conn (clears the connection table) ASA# clear interface e0 (clears the interface statistics counter) ASA# clear access-list (clears the access-list counters) ASA# clear mac-address-table (clears the switch address table) ASA# clear xlate (clears the connection and translation tables) Note: clear xlate should be done anytime a change is made to NAT, ACLs etc, but it will remove all current connections and translations. Examples: ASA(config)# clear configure access-list (clears all access-list configuration commands) ASA(config)# clear configure access-list IN (clears only the access-list commands with ID IN) ASA(config)# clear configure banner (clears all the banner commands) ASA(config)# clear configure all (clears the entire configuration in RAM) ASA(config)# clear configure icmp (clears all the icmp commands, Version 7 and newer) PIX(config)# clear icmp (clears all icmp commands, Version 6)
Service Objects
Service Object Creation: ASA(config)# object service <name> ASA(config-service-object)# service <protocol> [source [<operator> <port>]] [destination [<operator> <port>]] ASA(config-service-object)# service tcp [source [<operator> <port>]] [destination [<operator> <port>]] ASA(config-service-object)# service udp [<operator> <port>]] [destination [<operator> <port>]] ASA(config-service-object)# service icmp <icmp-type> ASA(config-service-object)# service icmp6 <icmp6-type> Note: <operator> options eq neq lt gt and range Objects can also be grouped together to create an object group. Create the group name then create the objects within the group. Also, previously created object groups can be nested into another object group.
Network Object Group Creation: ASA(config)# object-group network <name> ASA(config-network-object-group)# description <text> ASA(config-network-object-group)# network-object <same options as network object show above host subnet or range> ASA(config-network-object-group)# group-object <object name>
Protocol Object Group Creation: ASA(config)# object-group protocol <name> ASA(config-protocol-object-group)# protocol-object <protocol> ! Tcp, udp ipsec etc ASA(config-protocol-object-group)# group-object <name>
Object Groups
ICMP Object Group Creation: ASA(config)# object-group icmp-type <name> ASA(config-icmp-object-group)# icmp-object <icmp-type> ASA(config-icmp-object-group)# group-object <name>
Service Object Group Creation: Multiple possible rules, depending on the selected options. ASA(config)# object-group service <name> ASA(config-service-object-group)# service-object <protocol> destination <operator> <port> Or ASA(config)# object-group service <name> [tcp | udp | tcp-udp] ASA(config-service-object-group)# port-object <operator> <port> ASA(config-service-object-group)# group-object <name> To erase objects or object groups, enter the no form of the command. To erase all objects enter: ASA(config)# clear config object [network | service] To erase all object groups enter: ASA(config)# clear configure object-group To verify objects or object groups enter one of the following: ASA# show running-config object ASA# show running-config object-group
Logging
Logging The appliances can log many different events such as denied TCP connections, console logins, IDS or IPS matches , ACL deny matches and many more. Depending on the configuration the device can log to the console, an internal buffer, an SNMP management station, email messages or an external syslog server. The default is to log to the console. The information logged depends or the severity level configured. The lower the severity level number the more important the message is. When a value is set, the device will log the message set and any messages with a lower level value. Severity levels: Level # 0 1 2 3 4 5 6 7
Level Name Emergencies Alerts Critical Errors Warnings Notification Informational Debugging
Description Indicates the device is unusable. You need to take immediate action to fix the problem. A critical condition exists on the device. The device experienced an error. There is a configuration or processing error. A normal, but important event occurred, such as someone configuring the device. Something occurred on the device, such as a match on an ACL deny statement. Displays the output of debug commands.
Logging configuration commands: ASA(config)# logging enable ASA(config)# logging buffered <severity_level> ASA(config)# logging asdm <severity_level> ASA(config)# logging console <severity_level> ASA(config)# logging monitor <severity_level> ASA(config)# logging [no] logging message <message_id> ASA(config)# logging host [(logical_if_name)] syslog_ip_add [tcp|udp [port#]] ASA(config)# logging facility <facility#> ASA(config)# logging trap <severity_level> ASA(config)# logging standby ASA(config)# logging device_id {hostname | ip address <ip_address> | string <text>} ASA(config)# logging timestamp
ASA# show running-config all Displays all the default info. physical port settings etc ASA# show running-config interface e0/0 Displays info on just that interface ASA# show running-config | begin nat Displays info starting at the first instance of nat ASA# show running-config | include ip address include displays the commands that include ip address ASA# show running-config | exclude ip address exclude displays the commands that do not include ip address
(If there is a router between the PIX and the TFTP server>)
rommon>confreg Follow the prompts, accepting the default values until you get to the disable system configuration question. Enter Y, complete the process accepting the default values. Or Rommon>confreg 0x41
rommon> boot The ASA boots up to the IOS without loading the startup-config. 1 Enter privileged mode. 2 Copy the startup-config to the running-config. 3 Reconfigure the new passwords. 4 Change the config_reg back to normal. ASA(config)# config-register 0x1 5 If needed re-enable the interfaces. 6 Save the running-config to the startup-config.