IGP in ASA Firewall





Routing Information Protocol (RIP)::

       Ø  RIP is a distance-vector protocol.
       Ø  By default, an ASA sends routing updates as RIPv1, but receives updates in either RIPv1 or RIPv2.
       Ø  If ASA has a default route and we would like it to be advertised to other RIPv2 routers, you can use the following command:

Ciscoasa(config-router)# default-information originate

       Ø  Identify any passive interface:

Ciscoasa(config-router)# passive-interface  { default | interface }

      Ø  We can filter RIPv2 routing information that is sent or received on an ASA interface by applying a distribute list.
      Ø  In a nutshell, a distribute list uses a standard IP access-list to identify specific routes; routes matching a permit statement are allowed to be used, whereas routes matching a deny statement are filtered out.

Ciscoasa(config)# access-list acl-id standard {permit|deny}  <ip-address>  <mask>

Ciscoasa(config-router)# distribute-list <acl-id> {in | out} interface <interface>

      Ø  Use RIPv2 Authentication on ASA interface:

Ciscoasa(config-if)# rip authentication mode { text | md5 }

Ciscoasa(config-if)# rip authentication key <key-string> key_id <id>



 Enhanced Interior Gateway Protocol:
 
      Ø  Using IP protocol 88.
    Ø  Passive-interface command same as RIP. However, we want to interface subnet to be advertised, but don’t want the interface to participate in EIGRP routing exchanges.
     Ø  By default, EIGRP will automatically summarize subnets routes into classful network routes when they are advertised.
     Ø  But we have contiguous subnets that are separated across ASA interfaces or across EIGRP routers, we should disable route summarization with the following EIGRP command:

Ciscoasa(config-router)# no auto-summary

      Ø  If we have already disabled automatic summarization, the firewall can still advertise a summary address that is manually configured.

Ciscoasa(config-if)# summary-address  <as-num> <address> <mask> [distance]

      Ø  Redistribution:

Ciscoasa(config-router)# redistribute { rip | static | connected } [metric bandwidth delay reliability load mtu ] [ route-map map_name ]

Ciscoasa(config-router) # redistribute ospf <pid> [match {internal | external [1 | 2 ] | nssa-external [1  | 2 ] } ]  [metric  bandwidth delay reliability load mtu] [route-map map_name ]

       Ø  Use stub routing for an ASA with a single exit point.
       Ø  If the ASA has a single connection to the outside world through a neighboring router, it can become an EIGRP stub router.
       Ø  As a stub, it can receives routes (usually a default route) from its neighbor, but will advertise only specific routes of its own.

Ciscoasa(config-router)# eigrp stub {receive-only | [connected] [redistributed] [static] [summary ] }

      Ø  Authentication:

#Interface <interface>
  # authentication mode eigrp <as-num> md5
  # authentication key eigrp <as-num> <key-string> key-id <key-id>

      Ø  Use filter EIGRP updates by distribution-list

Ciscoasa(config-router)# distribution-list <acl-id>  {in |out} [interface <interface>]


OPEN SHORTEST PATH FIRST


      Ø  By default, an ASA generates logging message to indicate when an OSPF neighbor adjacency goes up or down. We can change the logging behavior with the following command:

# log-adj-changes [ detail ]

      Ø  An ASA can advertise a default routes as an external route by using the following command:

Ciscoasa(config-router)# default-information originate [always] [metric value ] [metric-type { 1 | 2}]  [route-map name]

      Ø  By default, all OSPF routers have an AD of 110, we can change the distance values:

Ciscoasa(config-router)# distance ospf [ inter-area d1 ] [inter-area d2] [external d3]

      Ø  We can adjust the OSPF route calculation timers :

Ciscoasa(config-router)# timers { spf  spf_delay spf_holdtime | lsa-group-pacing seconds }

The OSPF process will wait a delay time of spf-delay (default 5 sec) after receiving a topology change before starting the SPF calculation.
OSPF will wait spf_holdtime (default 10 sec) between two consecutive calculations.
We can also tune the calculation process with the lsa-group-pacing keyword.
LSA are gathered and processed at regular intervals (the default is 240 seconds).

      Ø  Authentication OSPF neighbor in an AREA.

Ciscoasa(config-router)# area <area-id> authentication [message-digest]

# int <interface>
   # ospf message-digest-key <key-id> md5 <key>
   # ospf authentication message-digest

      Ø  In OSPF stub area if there is only one path into and out of the area.

Ciscoasa(config-router)# area <area-id> stub [no-summary]

No-summary keyword to create a totally stubby area.

      Ø  Route Filtering, If an ASA configure as an ABR, it sends type 3 LSA between the areas it touches.
      Ø  This means that the networks in each area are advertised into other areas.
      Ø  We would not want private networks to be advertised towards the outside, for security and network translation reasons., so we define a prefix-list:

Ciscoasa(config)# prefix-list <list-name> [seq seq_number] {permit | deny } prefix/len [ge min_value] [le max_value]

      Ø  Unlike RIPv2 and EIGRP, OSPF does not use a distribute-list to filter routes that are advertised, this is because every OSPF router maintains its own snapshot of the entire routing topology.
      Ø  For Example: to permit advertisement of routes with a prefix of 172.16.0.0/16, but having any mask length between 16 and 24 bits.

Ciscoasa(config)# prefix-list LIST permit 172.16.0.0/16 ge 16 le 24

      Ø  Next, apply the prefix list to filter LSAs into or out of an area with the following command:

Ciscoasa(config-router)# area <area-id> filter-list prefix <list-name> [ in | out ]

      Ø  Summarize routes between areas:

Ciscoasa(config-router)# area area-id range ip-address netmask [advertise | not-advertise]


ROUTE-MAP Redistribution Example::

Asa(config)# access-list REDISTRIBUTE standard permit [ { host } | {network netmask} ]
Asa(config)# route-map RMAP
                         # match ip add REDISTRIBUTE
                     # router eigrp 100
                         # redistribute [ospf | rip] {id} metric <> route-map RMAP

By Er.AJAI SINGH on Friday, 1 February 2013 | , | A comment?

Trunk and MTU configuration on ASA firewall



::Trunks on ASA 5510 and higher::

            Ø  An ASA trunk link supports only the IEEE 802.1q trunk encapsulation method.
            Ø  As each packet is sent over a trunk link, it is tagged with its source VLAN number.
            Ø  As packets are removed from the trunk, the tag is examined and removed so that the packet can be   forwarded to their appropriate VLANs.
            Ø  By default, only packets that are sent out the ASA’s physical interface itself are not tagged, and they appear to use the trunk’s native VLAN.
            Ø  Packets that are sent out a sub-interface do receive a VLAN tag.
            Ø  IEEE 802.1q trunk links support the concept of a native VLAN. Frames coming from the native VLAN are sent over the trunk link without a tag, while frames from other VLANs have a tag added while in the trunk.






           Ø  An ASA trunk link is either on or off, according to the sub-interface configuration.

        Ciscoasa(config)# interface hardware_id.subinterface
        Ciscoasa(config-subif)# vlan vlan_id


    Configure a Trunk Link on an ASA:::

         ciscoasa(config)# interface e0/0
         ciscoasa(config-if)# no shutdown
         ciscoasa(config)# int e0/0.1
         ciscoasa(config-subif)# vlan 10
         ciscoasa(config)# int e0/0.2
         ciscoasa(config-subif)# vlan 20


   CASE:

   Problem: TRUNK CONNECTION PROBLEM BETWEEN ASA and Switch OF CISCO
Whenever, we have setup a trunk link between a cisco ASA (5505 and above)and a cisco switch (2960,3560). However, we do not able to establish a connection between them at either Layer 2 or 3.
If we look at the interface counters on firewall, we may notice that we are piling up a bunch of “L2 decode Drops” errors.

  
 Solution:

        Ø  The most likely cause is the native VLAN on the switch side of the trunk .
        Ø  We have a sub-interface on the ASA that is supposed to route for the native vlan.
        Ø  When switch sends out a frame from the native VLAN, it does not tag it.
        Ø  However, if the ASA has a sub-interface for that VLAN, it expects tagged frames only for it, so communications for the particular VLAN will fail between the switch and the ASA.

  Base:  

       Ø  If we have a sub-interface for a VLAN on the ASA, then it can not also be used as the native VLAN on the switch’s trunk port.
       Ø  Any VLAN setup as such will not work.
       Ø  For solve this, the sub-interface/ VLAN configuration on the ASA to avoid the switch port’s native VLAN , or change the native VLAN on the switch to something else.



::ASA Firewall Interface MTU::

       Ø  Ethernet interface has its maximum transmission unit (MTU) size set to 1500 bytes by default.
       Ø  If a packet is larger than the MTU must be fragmented before being transmitted.
       Ø  And before the packet can be presented at the destination, all of its fragments must be reassembled in their proper order.
       Ø  The fragmentation and reassembly process takes time, memory, and CPU resources, so it must be avoided if possible.
       Ø  Various IEEE standards use expanded frame sizes to carry additional information. Data centers often leverage Ethernet  “Giant”  or “jumbo” frames, which are much larger than normal, to move large amounts of data efficiently.
       Ø  We uses the command for adjust the MTU on an ASA interface:

     Ciscoasa(config)# mtu <nameif> <bytes>

       Ø  The transmitted MTU can be sized from 64 to 9216 bytes.
       Ø  We should also use the command to enable jumbo frame processing as frames are received on an interface:

    Ciscoasa(config-if)# jumbo-frame reservation

       Ø  When we increase the MTU size on any ASA, always remember that the jumbo-frame reservation command is supported only on the ASA 5580.





By Er.AJAI SINGH on Thursday, 31 January 2013 | , | A comment?

File System of Cisco ASA




::The Factory Default Configuration::

Ø  At first time of Boots, ASA comes up running a factory default or initial configuration.
Ø  The initial configuration brings up the following basic functions:
·         One interface is set as a protected “management” network, where a PC will connect.
·         A DHCP server is enabled on management network, at connected have to automatically provide an IP address to PC.
·         An HTTP server also running on management network, to allow the PC to access ASDM with the ASA via TCP port 443.
·         Management interface have IP address 192.168.1.1 and CIDR 24.
·         DHCP server allowed to provide address from a range of 192.168.1.2 to 192.168.1.254
·         HTTP server configured with subnet 192.168.1.0/24 for allow ASDM.
·         ASA’s interface 0/0  works as Management interface at initial configuration.
·         For return to factory default configuration by entering the command:

Ciscoasa(config)# configure factory-default


::Working With Configuration Files::

Ø  An ASA keeps a “startup” configuration file in flash memory.
Ø  The configuration commands in the startup configuration are not lost after a reload or power failure.
Ø  When ASA boots, the Startup Configuration commands are copied to “running” configuration file in RAM.
Ø  ASA have Volatile RAM memory.
Ø  # show startup-config command used to see contents of the startup configuration.
Ø  We can see the running configuration content by entering the # show running-config

Ø  ASA platforms can maintain one or more startup configuration files in flash, depends on space.

Ø  Only one of these can be used at boot time.

Ø  The startup conf contents can be saved in one file during the time that the firewall configuration is stable. If major conf changes need to be made, the new, updated running configuration can be saved to a new , different startup configuration file.

Ø  The next time the ASA is booted, it can use the new startup configuration file.

Ø  If we encounter problems with the new conf, we can force the firewall to roll back or use previous startup configuration in flash memory.

Ø  We can see the startup-conf  file by command: #show startup-configuration

Ø  To force the ASA to use different startup conf file, use the command:

Ciscoasa(config)# boot config <url>

Here url represents the location of the startup configuration file. It can be
·         flash: path
·         disk0: path
·         disk1: path
Where path is directory path. When use above command, be sure to save the running configuration with the “ # copy running-config startup-config  command.
Ø  We can see the current startup configuration file by #show bootvar

Clear an ASA Configuration::
1.       Clear configure all : Clear the entire running configuration.
2.       Clear configure primary : Clear all commands related to connectivity, including ip address, mtu , monitor-interface , boot, route, failover, tftp-server , and shun .
3.       Clear configure secondary : Clears all commands not related to ASA connectivity.
4.       Clear configure command: Clear all commands that use the command keyword.

::Working with the ASA File System::
Ø  A Cisco ASA has a built-in flash (non-volatile) memory file system that contains file such as an operating system image, a management application image , and firewall configuration .
Ø  When an ASA boots, it uncompresses and copies an executable OS image from flash to RAM.
Ø  This image actually run from RAM.
Ø  While an image is being run, a different image can be copied or written into flash memory.
Ø  The running image can be safely overwritten in flash.

Navigating an ASA Flash File System:
Ø  ASA flash file system much like a IOS file system.
Ø  Contain a tree of directories, each containing arbitrary files.
Ø  ASA offers a disk0: and a flash: device. These both refer to the same internal flash memory file system.
Ø  When we connect to an ASA , our session begins in the disk0:/root directory. This directory can contain other files or sub-directories.
Ø  ASA also support a disk1: device, which is a removable flash drive.
Ø  To view the contents of a flash directory, use the #dir [device:][path] command. Example : ciscoasa# dir disk0:/
Working with Files in an ASA File System::
Ø  We can manipulate any files that are stored in an ASA’s file system.
Ø  To view the contents of a file , use command:

More [ / ascii | / binary | / ebcdic ] [ device : ] path

      Ø  By default, the file contents are shown as plain text.
      Ø  We can add the /ascii or /binary option to display both hex and ASCII represents of the file contents.
Ø  As same , /ebcdic option displays the contents in both EBCDIC and ASCII.                                             



Copy Command:::
      Ø  There are 3 different use of the COPY command.
      Ø  First, an ASA image file asa823-k8.bin is copied from a TFTP server to the ASA’s disk0: file system.
      Ø  Second, an ASDM image file is copied from a TFTP server to flash.
      Ø  Final, the running conf is copied from the ASA to a TFTP server.






To Rename an Existing File in Flash ::
         Ø  To rename an existing file in a flash file system, we can use the following command:
   
    Ciscoasa# rename [/noconfirm] [device: ] source-path [ device: ] destination-path

        Ø  Example , the file backup-config is renamed to config-old , Because the CLI session begins in the      disk0:/  directory .







Delete files from an ASA file System::

       Ø  You can delete files from an ASA file system with the following command:

          Ciscoasa# delete [ /noconfirm ] [ /recursive ] [ device:] path





      Ø  Every file, including image files, configuration files , and licensing files, is overwritten with a 0xFF data pattern so that it is completely removed.
      Ø  When flash file system is erased, the ASA can continue to operate because its image file and running configuration are already loaded into RAM.
      Ø  However, once the ASA is rebooted, its operation will be affected.

Reloading an ASA:::

      Ø  An ASA allows one or more OS images to be stored in flash memory.
      Ø  Only one of the image files can be running on the firewall at any time.
      Ø  So we can select one file for use by command:

Ciscoasa(config)# boot system device:path

     Ø  If image file does not exist, then it given warning message.
     Ø  The boot system command is stored in the running configuration after it is entered.
     Ø  It should also be written into the startup configuration so that the image can be identified during the next reload or bootup sequence.





Upgrading the ASA software at the Next Reload::

The upgrade procedure is straight forward by following these steps:
1        .       Copy a new OS image file onto the flash file system.
2        .       Use the boot system command to point to the new image file.
3        .       Save the running conf with the copy running-config startup-config command.
4        .       Reload the ASA.

      Ø  We can see the current boot image setting with the command:
show bootvar

Example: An ASA has two OS image files in the disk0: file system. ASA is currently running the asa802-k8.bin image file . A new image file named asa823-k8.bin has been copied onto the disk0: file system.










       Ø  In example, begins with an empty BOOT variable.
       Ø  The asa802-k8.bin image was the only valid image found at bootup time.
       Ø   The boot system disk0:/asa823-k8.bin command is then entered so that the ASA will run an upgrade  image after its next reload.
       Ø  Immediately afterward, the current BOOT variable line indicates that the new image has been identified, but will not yet be used.
       Ø  Finally, the running configuration is saved to the startup configuration.
       Ø  At that point, the BOOT variable= line shows that the new image file will be booted at the next ASA reload.



Performing a Reload::

      Ø  We can force an ASA to reload immediately by issuing the reload command alone.
      Ø  ASA will check to see if the running configuration has already been saved or not.










 
       Ø  We can also schedule a reload for a specific date and time by using command:

     Ciscoasa# reload at hh:mm [ day month | month day ]

       Ø  To schedule a reload after a time interval:

     Ciscoasa# reload in { mm | hhh:mm }

Manually Upgrading the ASA software during Reload::

       Ø  We want to install or upgrade the OS image file on an ASA before it fully boots.
 Ø  We can do this by downloading an image file from a TFTP server when the ASA has booted into its   ROMMON mode.












      Ø  The Parameter you enter are used only temporarily until the ASA can download and run the new image  file.
      Ø  In below example shows a image download. The ASA interface ethernet0/0 is used because the TFTP server is connected there.
      Ø  Interface given IP address 192.168.100.5
      Ø  The TFTP server is found at IP address 192.168.100.10 and new image file is called asa823-k8.bin.
      Ø  As soon as the tftpdnld command is entered, the TFTP file transfer begins.

      Ø  Image file is downloaded and executed by the ASA, it is not permanently stored anywhere. After the ASA finishes booting, you should copy the same image file onto a flash file system by using the “copy” command.




By Er.AJAI SINGH on Wednesday, 30 January 2013 | , | A comment?