In my last post I taught you how to forward a port on the ASA 5505 running version 8.3 from the CLI. Some of you prefer to use the ASDM to do you changes, so I guess I'll show you how to do it from there. The ASDM is a bit of a learning curve for someone that's used to the CLI, and most CLI guys hate a GUI with a great passion. I can go either way. I use the ASDM to make some changes simply because I want to learn it and there's some guys coming into the field today that were taught on the GUI rather than a command line.
In this lesson I'm using ASDM version 6.3(1) and ASA version 8.3(1). Since we added a web server in the last post, let's make this one an FTP server. The FTP server's IP is the same as the web server, 10.9.8.7/24 and we're running over the standard FTP port, 21.
First off, we want to start up the ASDM and connect to the ASA. Once there, click on the button at the top of the screen, then the button near the bottom left, and finally select near the top left. You'll now be at a screen that looks something like this:
Now we need to create a new object, so click on "Add" under Addresses, then "Network Object".
Now we need to fill out our new window. Once you fill out the name, IP address and description, you need to drop down the NAT box and fill it out. Click the "Add Automatic Address Translation Rules" box, leave the type as "static" and set the translated address as the outside interface.
We now need to go to the Advanced menu from the Add Network Object window and setup the port forwarding. The source will be inside, destination is outside. Protocol in this instance is TCP and our port is 21, both real and mapped.
Click "OK" twice and your object will be created as well as the port forward. Now we just need to add the access rule. On the left side of the screen, just above the NAT Rules is your Access Rules. From there we want to click "Add" and "Access Rule".
We need to create the rule on the outside interface, coming from any IP to the FTPServer using FTP as the service.
Once you click OK, your rule is added. You don't have to add a description like I did in the image above this one, I just did that for the hell of it. When you click "Apply" at the bottom of the screen, the ASDM will issue the commands to the ASA. I have preview turned on, so I can always see what commands are being sent to the device before they are actually sent. If you followed all the steps above and you have preview turned on, you'll see the following:
And you'll notice that those are the exact 4 commands that I gave in the last post about doing it from the CLI! Now you can forward any port you want from either the CLI or the ASDM!
On a side note, I know a lot of guys hate the ASDM. When I was writing this post and going through all of this I was kinda upset when I saw that I had 10 pictures for 4 lines of code. The good thing about the ASDM is that you have everything right there at your disposal and you really don't need to know the vernacular of IOS. The drawback is that it will take you longer to get things done at first, but once you get used to it, it can be just as fast.
So it's been a month and a half since I posted an update, and it's 4:15 am right now. I can't sleep and I found out there's another networking blog out there using the same WP theme as me, so I figured I better put something up here since it was fresh in my mind. Well, now that the niceties are out of the way, let's get to work.
I recently added an ASA 5505 to my home network at the edge. Obviously, when I did, all of my port forwards went to hell because the ASA is now blocking everything. I run a web server on one of my servers here and I like to be able to access it because I keep a lot of tech manuals and other stuff on there. Well, I went about trying to set up port forwarding the old way and learned real quick that this pops up when I do:
ERROR: This syntax of nat command has been deprecated.
Please refer to "help nat" command for more details.
Yeah, that sucks. On the new version of the ASA OS, global has gone the way of the dodo. I did a bunch of searches on Google to figure it out and everything I ran across was very hard to decipher. That's why I'm writing this. You can setup a port forward in 4 quick and easy steps. Just change the things that are underlined to fit your network and you'll be just fine.
In this example, we want to be able to access a web server behind the firewall. We'll assume you are using the standard HTTP port, the web server's internal IP address is 10.9.8.7/24, and that you at least know what you're doing enough to be configuring an ASA in the first place. I'll give you the steps, then I'll explain.
Step 1: Create a new object group for you web server.
asa5505(config)# object network Webserver
Step 2: Add the IP of the web server to the network group.
asa5505(config-network-object)# host 10.9.8.7
Step 3: Forward the port via the NAT command.
asa5505(config-network-object)# nat (inside,outside) static interface service tcp www www
Step 4: Exit back to the root and add the access list
asa5505(config)# access-list outside_access_in permit tcp any object Webserver eq www
That's it! Now, let's explain what's going on here. Cisco has started moving more and more towards use of object groups in their configs. It makes things easier, especially when you have a situation where you have 20 web servers behind the firewall and you want to add 1 more in. Rather than having to rewrite a whole bunch of ACL's, you just add the IP of the new web server into the object group and everything is done for you. After you create the object group (in this instance a network object, you can also create service objects), you add the IP of the specific object (or objects) that you want to point to. So here our web server is 10.9.8.7. If you want to send port 80 to more than 1 IP on your internal network, just add more IP's to that object group.
Now is the fun part. While we're in the object group, we need to NAT port 80 only to that specific object group, hence you're still at "asa5505(config-network-object)#" prompt. Now type "end" to get back to the regular config terminal and we need to open that port in the ACL. Yes, www = 80. You can type either one and you get the same result. If I have to go through and explain NAT, how it works and why I enter in that specific command to forward the port, then there's a possibility that I'd need to send you an invoice for my time because we would be here for a while.
This works for ANY port forward. If you want to RDP into a machine, simply replace port 80 (all those www's you see up there) with 3389. There is one caveat. You can only do one port forward per object group. So let's say that our web server is also an FTP server and you want port 21 to forward as well as port 80. You're going to have to create a whole new object group (object network FTPServer), put the same IP in the group (host 10.9.8.7), do the nat command again (nat (inside,outside) static interface service tcp ftp ftp), exit back to the root of config, and add the access list (access-list outside_access_in permit tcp any object FTPServer eq ftp).
This should get you up and running with you port forwards in no time flat. It is a bit of a pain in the ass to have to create a new object group for every port you want to forward, and maybe there's someone out there that's reading this right now thinking "dude, you don't have to create more than one group! You can just do...". Well, you need to enlighten the world with this knowledge and post it in the comments section. And if you're too scared to do so, shoot me an email to greg(at)gregledet(dot)net.
I'd also like to thank Stefan Fouant for an excellent class today on JUNOS Switching. I learned a lot in his class and you can learn a lot from his website. Check it out and tell him Greg sent ya!
Friday I had an interview with a large insurance company in Columbus. Actually, I had 2. I went there to interview for a firewall job and once I was done with that the recruiter pulled me into another interview for a route/switch job. In the first interview, there were 5 guys in there. 4 of them actually spoke to me and 1 just sat in a corner typing away on his laptop. I don't know why, but that made me really nervous. Now, I NEVER get nervous around people, it's just not in me to do so, but this time I got real shaken up. And it hurt me in the next interview.
I was completely honest with the people in the first interview. If I didn't know a question, I told them I didn't know the answer and how I would find the answer. In the second interview though, I drew a complete blank mind. I didn't remember simple trunking protocols, something that I should remember from my CCNA. I stumbled over many questions that they asked and most of the stuff was simple things that any CCNA should know, but my mind was clouded. I choked up, I got even more nervous, and I found out this morning that they passed on me. I was told that I wasn't strong enough to work there.
I haven't heard back from the firewall job yet and I'm hoping that something comes of it. I have been in Ohio for a year and 3 days now and I have worked for a total of 3 weeks. I guess I'm really going to have to hit the books hard and get some of this basic knowledge back to the front of my mind!
I just wanted to go through a few things with you guys before we move on to intensive things like DAI and DHCP snooping. These are commands that are good to put into your configs that will help raise your security and, if you need to follow them, help you come into compliance with STIGS.
First off, we really don't want anyone to be able to auto-trunk on your network. Auto-trunking is actually not that hard to do, and it relies on a bad network admin not disabling it from the start. You want your individual ports to be either access or trunk, and you start by entering these commands:
For an access port:
Switch (config-if)# switchport mode access
Switch (config-if)# switchport nonegotiate
For a trunk port:
Switch (config-if)# switchport mode trunk
Switch (config-if)# switchport trunk native vlan 69
Switch (config-if)# switchport trunk allowed vlan 9, 10, 68, 70, 119
Switch (config-if)# switchport nonegotiate
Now, the commands for the access port first told the port "You are an access port", then told it "If someone tells you that they are a trunk and want you to be a truck, tell them to go to hell". There is NO negotiation, get it?
For the trunk port, we told the port "You are a trunk port and here's the VLAN that's native to you", followed by "These are the only VLANs you're allow to pass traffic for". It finishes with "If someone tells you to become an access port, explain to them in a series of 1's and 0's where they can get off". You'll notice that I highlighted the "nonegotiate" commands. That's because you should have already known how to create an access and trunk port, but you probably forgot to tell them that "we do not negotiate with terrorists". Or something like that...
Now I want to speak to you for a minute about STP. Even though Scott Weiland's voice stinks... wait... wrong STP... Spanning Tree Protocol is your friend. We all love it; we all use it (hopefully). Let's guard it.
Switch (config-if)# spanning-tree bpduguard enable
Switch (config-if)# spanning-tree guard root
What we're doing by implementing the BPDU (I call them "bippy-du's") guard is allowing you to enforce the STP domain borders and keep the active topology predictable. The devices behind the ports that have STP PortFast enabled are not able to influence the STP topology. At the reception of BPDUs, the BPDU guard puts the port in errdisable.
The "root guard" feature provides a way to enforce the root bridge placement in the network. The root guard ensures that the port on which root guard is enabled is the designated port. Normally, root bridge ports are all designated ports, unless two or more ports of the root bridge are connected together. If the bridge receives superior STP BPDUs on a root guard-enabled port, root guard moves this port to a root-inconsistent STP state. This root-inconsistent state is effectively equal to a listening state. No traffic is forwarded across this port. In this way, the root guard enforces the position of the root bridge.
Now, you can leave it like this, or you can add a timeout to the errdisabled state caused by the Bippy-du's. When BPDU guard disables the port, the port remains in the disabled state unless the port is enabled manually. You can configure a port to reenable itself automatically from the errdisable state. The command is:
Switch (config-if)# errdisable recovery cause bpduguard
Switch (config-if)# errdisable revovery interval 500
The default timeout interval is 300 seconds and, by default, the timeout feature is disabled. If you want to know what ports are in errdisable, enter:
Switch# show interfaces status err-disabled
If you need to get it out of errdisabled manually, you'll need to enter a "shutdown" then "no shutdown" on the port to bring it back up.