Showing posts with label ASDM. Show all posts
Showing posts with label ASDM. Show all posts

Sunday, June 9, 2013

Lab Part 2: ASA and the ASDM

Configuring the ASA with ASDM
Now that we have basic access to the ASA, we'll continue on with the configurations through ASDM.  From reading the study material and the exam blueprints, it looks like you are expected to know how to configure basic access lists, NAT, PAT, and some setup through ASDM.  So in this lab, we'll cover exactly that.

Assuming you followed the first part of the lab, you should be able to reach the ASA at https://172.16.100.1
Since you restricted management access only from 172.16.100.10, your PC will need this address.

Either run ASDM by downloading it locally and running it, or by using the java web start option.  Since I was battling some java issues at the time, I used the java web start app. (You can click on these images to expand them)


Now that we have entered ASDM, it's time to perform some basic configurations.

Review Firewall Configuration
Lets start by reviewing our CLI commands, and seeing what that looks like within ASDM (you should know how to configure that here as well).  We'll look at our interfaces, security levels, and associated VLANs.  Click on the configuration tab, and then on the panel on the left, click on interfaces.



Here we can see the interface names on the first column.  The first row has no name, as these interfaces are all assigned to VLAN 1 by default (we didn't set them up-eth0/1 was reserved for the DMZ, and none of the others were configured).  The switchports will be shut down by default.  We will go ahead and disable this interface for now.

Click edit, which brings up this window.  



You can see that eth0/1, and eth 0/3-7 are assigned to this interface (VLAN 1).  You should be able to see from here how you would configure this if you had just setup the ASA with a barebones configuration for accessing it via ASDM-an IP address assigned to VLAN 1, an ifname, and bringing up say eth0/0 or whichever switchport you wanted to use for the inside.  Then within ASDM, you could configure your other interfaces (SVIs for those of us with the 5505), assign the name, security level, and assign switchports.  If you were to create a new interface, you could set its VLAN ID under the advanced tab. 

A special note for the ASDM-generally speaking, when you configure something within an edit window, it will not apply this configuration to the running-config until you click the Apply button at the bottom of the window.  If you click the Save tab on the menu bar (with home, configuration, monitoring, etc), it will backup the running config to startup config.

Now, select the Switch Ports tab.



Here you can verify the configuration we implemented with the CLI- switchports 0/0 and 0/2 are up.  0/0 is assigned to interface VLAN 10 (outside), and 0/2 is assigned to VLAN 100 (inside).  All other interfaces are set to their default configurations of VLAN 1, disabled.

I have the basic ASA license, so I am unable to fully configure a DMZ at this point in time, so lets move on to configuring our static routes.

Configure Routing
If we want our traffic to go anywhere, we will need to set some default routes for the ASA.  Lets get to the routing configuration tab by clicking on Device Setup>Routing>Static Routes



We have an empty table-we need to configure some routes.  Now according to our overall topology, we have our corp border router connected to our ASA. (not setup yet, but will be in the next lab).  The interface facing us is on the 207.100.100.0/27 block, with IP address 207.100.100.30.  We will configure a default route to that gateway IP address.  With our simple configuration, the ASA will know to send traffic addressed to the inside address range of 172.16.100.0/24 out its directly connected interface, VLAN 100.

Click the add button, and you will see the static route configuration window.

This can be slightly confusing at first.  Which interface should you add the default route to?  The answer, is that it is quite similar to configuring a static route on a regular IOS device.  Remember on a router, the command is ip route <destination network> <destination mask> <gateway IP> OR <forwarding interface>

In this case, the command on the ASA CLI  is route <ifname> <destination net> <destination mask> <gateway IP> 

So keep this in mind while within the GUI-the interface name is the one by which the traffic will be routed out, following the configured route settings.  So in this instance, our default route should be added to the outside interface, as configured below



Make sure to click apply, and then save to your startup config if desired by clicking the Save icon.  Now, on to understanding behavior regarding security levels and configuring access rules.

Access Rules and Security Levels
Start by clicking on Firewall under device setup, while still within the configuration pane.



By default, the firewall will use its security levels for stateful filtering.  
Any traffic sourced from higher security interfaces is permitted out to lower security interfaces
Reply traffic from lower security interfaces is permitted back to higher security interfaces
Any traffic from lower security -> higher security interfaces is denied implicitly.

Since we assigned the outside interface to security level 0, and the inside interface to security level 100, only traffic initially sourced from the inside to outside, and its associated reply traffic from the outside, will be permitted.  What is important to keep in mind, is if we create an access rule, what happens to this filtering behavior in regards to the security levels.  If you create an access rule for the inside, say filtering any IRC traffic from exiting, the ACL will add an implicit deny any at the end of the statement.  This can cause some confusion as the behavior changes from the above security level rules, to using the ACLs.  The stateful reply traffic will remain the same however.  

I will use the packet tracer tool to demonstrate this behavior.  The packet tracer tool is a very useful feature which can act as a policy review to let you know what types of traffic will be denied or permitted, without having to send actual traffic through the firewall.

Start by configuring your inside incoming ACL to filter any IRC traffic.



Now you will see your access rule icons change from the "any, any less secure networks" to deny any any IRC.



  There is an associated global deny any any rule attached onto this ACL-we can confirm that all of the remaining traffic will be denied (probably something we don't want to happen) by using the packet tracer tool.  The tool is located under Tools.  We'll emulate a user attempting to browse out to their favorite business site, facebook (simulated IP).



As you can see, the traffic would be denied.  You can drill down into the Access-List phase and see which rule denied this traffc.



See how it says "Config Implicit Rule".  Remember our rule with access lists?  There is always a implicit deny rule at the end of every access rule.  To correct this, we will need to add a permit any at the end of our inbound filtering statement for the inside interface.  Make sure you add the rule after your deny rule-same logic with standard/extended ACLs on IOS systems, the rules are processed in order and processing will end at the first matched statement.  Don't forget to click the apply button and save the configuration to running config.

After you do so, lets run the packet tracer rule again.



So going out, according to packet tracer, our configuration will work.  We still have a problem, however.  How will traffic from our facebook browser be returned to that inside address of 172.16.100.58?  Since there is no NAT or PAT configured yet, our traffic will likely be filtered out within the ISP to begin with-this is an unroutable, private IP.  Lets fix this issue.

Configure NAT/PAT
You can see the nat configuration directly below Access Rules in the pane on the far left.  Click on NAT Rules to get started.



Now, to fix our NAT issue.  We will click on the add drop down button, and select add NAT rule.  We want to configure PAT for our entire 172.16.100.0/24 block of addresses, with PAT overload so all of our inside hosts can have their IPs translated using the ASA's outside interface IP.



We'll set the source interface to inside, the destination interface to outside, the source, destination, and service fields to ANY.  Now under the translated packet, we will select source NAT type of Dynamic PAT (hide).  To set the source address to translate into, click on the ... button and select the outside interface



Your rule table should look like this



Lets say we wanted to refine these rules abit more, and specify that only hosts from the internal network of 172.16.100.0/24 should be matched to have their addresses translated.  To accomplish this, we need to create a network object.  To allow for better organization, we should ideally create a network object group, which we can later add more network objects into.  We can do this from within the nat rule window.  So edit your rule again, and under the source address for the match section, click on the ... button again to draw up your selection.  Now you can click on the add drop down, and select network object group.



Lets call this group "INSIDE-HOSTS", with a description of "hosts inside the corporate network".  You cannot have spaces in the group name, but you may add spaces in the description.  Now from within this window, you can add your network object groups.  Click the radio button Create new Network Object member.  Set a name if desired, set the type to network, and set the IP address to 172.16.100.0 with a mask of 255.255.255.0.    You can also add in a description if desired. Click Add >> when you are finished, and then OK. Your window should look like this


Now, from your Browse Original Source Address window, you can select your INSIDE-HOSTS network object group, or just select the network object of VLAN100.  In the real world, this selection would depend on your network design.  We will select our newly created network object group of INSIDE-HOSTS.



Click ok, and now your NAT rule will apply to any network object that is a member of INSIDE-HOSTS.  In our configuration, that would be any host inside our VLAN 100 network of 172.16.100.0.

Configure ICMP Inspection
Now we just have one last component to configure.  Have you noticed that you are unable to ping the neighboring router's address (if you are following the topology) at 207.100.100.30, from your management workstation off the inside interface of the ASA?  In fact, any ICMP traffic crossing the ASA, and returning through it will fail.



By default, the ASA won't statefully inspect icmp traffic.  This means that any ping attempts crossing the firewall will fail, as there is no stateful inspection, the traffic cannot be returned.  For troubleshooting purposes, lets enable this.  Below the NAT Rules icon is Service Policy Rules.  It is within here that we can get ICMP inspection enabled.



Right click and edit the inspection default policy.  This policy is present on the default configuration of the ASA

Now browser over to default inspections.  You can see that ICMP is listed, by why isn't working?  The answer is within the Rule Actions tab-these are the actions (hence the name) that are applied to traffic that meets the inspection criteria.



Click on the rule actions tab, browse down until you see ICMP-you will see that it is unchecked.  Check the box next to ICMP, click ok, and apply the configuration.  Now try to ping again from the inside interface to the neighboring router.  Your ping should be successful this time.



That completes our ASA configuration for now, later we will return to configure the VPNs!

Sunday, June 2, 2013

Lab part 1: Initial ASA Configuration


At the end of this post you can see the complete topology of what this lab series covers (I couldn't really find another more practical way of cramming everything in, I usually use GNS3 just to create a clean topology quickly).  In the first post of the lab, we are going to start with getting an ASA up and running so that ASDM can be used to connect to it.  This lab starts with a wiped ASA, and rather then following the CLI startup wizard, it will be configured manually.  I think this is the best way to learn as to what is taking place.

Lab Objectives

This lab assumes an ASA 5505 with no initial configuration.  These are the requirements for the configuration:

  • Outside interface, assigned to VLAN 10, security level 0 with an IP of 207.100.100.1/27
  • Inside interface, assigned to VLAN 100, security level 100, with an IP of 172.16.100.1/24
  • Interface eth0/0 should be mapped to the outside 
  • Interface eth0/1 should be reserved for a future DMZ config
  • Interface eth0/2 should be assigned to the inside
  • Host with an IP address of 172.16.100.10 should be able to use ASDM to connect to the ASA

ASA Setup

As you can see, we are starting from scratch with no configuration, and the ASA has prompted to pre-configure the firewall following the interactive prompts.  We'll say no and continue with the configuration.

Configure Credentials

Now moving to enable mode you'll notice it asks for a password.  By default, there is no password, so just press enter to continue.


The first thing we will do is add an enable password, and create an admin user for the ASA.  Note that the ASA uses the command enable password vs the traditional enable secret in IOS devices.  However if you check the configuration, you will see that the password is encrypted.  Use a password of your choice, and you can use the following commands:

ciscoasa(config)# enable password cisco
ciscoasa(config)# username admin password cisco privilege 15

Another thing that I noticed was interesting was the placement of the command privilege behind the configuration of the password.  Normally it seems you configure the privilege first and then the password.

Configure Interfaces

Now since the ASA 5505 model uses switchports for its 8 interfaces, we need to accomplish any IP address assignment by creating SVIs-switched virtual interfaces.  If you've ever setup a switch before and configured it with a management IP address-then you have created an SVI.  On an ASA 5505, we create VLANs, assign them IP addresses, configure the name and security level, and then move into the switchport configuration and assign them to the corresponding VLANs.

We will start by creating the SVIs for the outside and inside interfaces.  The two differences here between a switch SVI and a ASA SVI, is that we also need to define a name using the nameif command, and we need to define a security level using the security-level <100-0> command.  By default, an ASA will only allow traffic to flow from higher security level interfaces, down to lower security level interfaces.  Traffic from lower security levels (using the default rules-and this will be explained in detail in a later post), cannot access higher security level zones unless it was initiated from a higher security zone-this is the stateful, default behavior.  I use the following commands to setup my inside and outside interfaces:

ciscoasa# conf t
ciscoasa(config)# int vlan 10
ciscoasa(config)# nameif outside
ciscoasa(config-if)# security-level 0
ciscoasa(config-if)# ip address 207.100.100.1 255.255.255.224
ciscoasa(config-if)# no shut
ciscoasa(config-if)# exit
ciscoasa(config)# int vlan 100
ciscoasa(config-if)# nameif inside
ciscoasa(config-if)# security-level 100
ciscoasa(config-if)# ip address 172.16.100.1 255.255.255.0
ciscoasa(config-if)# no shut

ciscoasa(config-if)# exit

Now that we have our inside and outside interfaces, we need to assign the correct switchports to them.  This is done exactly like one would be used to when working with a switch.  Except that the switchport names are slightly different, they are "ethernet x/x", and by default, the switchports are shut down.  So you can use et for shorthand here.  These are the commands that I use now to assign my switchports to their SVI interfaces.

ciscoasa(config)# int et0/0
ciscoasa(config-if)# switchport access vlan 10
ciscoasa(config-if)# no shut
ciscoasa(config-if)# exit
ciscoasa(config)# int et0/2
ciscoasa(config-if)# switchport access vlan 100
ciscoasa(config-if)# no shut
ciscoasa(config-if)# exit


Configure Access to ASDM

If you check back in the list, you see that we need to configure the ASA so that it can be reached via ASDM.  To do so, we need to start the HTTPS server, and add the IP address for the management workstation to a special management access list.  By default, the ASA will deny access from any IP to its HTTPS server.  The commands used to do this are:

ciscoasa(config)# http server enable
ciscoasa(config)# http 172.16.100.10 255.255.255.255 inside

Now you might be thinking-wait, that says HTTP, not HTTPS.  Not to worry, the command will only allow the ASA to be reached via HTTPS.  For some reason that I do not know, the command is HTTP.
The second line allows a management machine to access the ASA at the inside interface.  Also, wildcards are not generally used in the configuration of the ASA, instead it is the normal subnet mask format.


You should now be able to access the ASA via the ASDM by opening a browser and typing in https://172.16.100.1 (or whichever IP you have picked for your inside address)  The certificate will be untrusted by the browser since it is a self signed cert.


 After you continue through you'll see the option to download the ASDM and install it on your local machine.  Alternatively, you can launch the ASDM using java webstart, and run it off the ASA's flash memory

  .  I will cover the ASDM in the next part of my lab.


At this point, we have met all of our required goals!