This is likely a common issue, but cannot find a solution.
Here's the problem: in web server environment there are a set of common ports that need to be open, to name a few: 21,25,53,80,110,143,3306, etc.
I know how to create an access-list to allow an external ip on a given port and a static rule to direct port traffic to target internal ip. However, man, that is a lot of drudgery doing single ip + single port rules when you have 15 public IPs all of which need the exact same 20-odd ports open.
Is there a way to per public ip specify an access-list of ports and a corresponding static rule?? Basically I'd like to pull this off in 30 lines ( 15 public ips X (1 access-list + 1 static) ) vs 600!
Ideas much appreciated (in this case, obviously) ;-)
You can use
static
to map IPs 1-to-1. Like this:(These could be condensed if the mapping is in order like the example)
Then have a single access list such as:
Warning! This will open all the ports to all mapped IPs. If all your servers need these ports anyway, then it's a much quicker configuration.
(Obviously change names of things as is appropriate for your site)
Ok for the access list you can use object-groups to make lump them in together.
Fair warning I have not tested this on anything. It's what the documentation says should work.
Object groups are your friend here. Assuming a worst case scenario where your public address block is non contiguous and there is not a direct subnet mapping onto your private subnet, and that your outside access list has the default name of outside_access_in you'll need a configuration along the lines of...
I should caveat that this configuration will need some tweaking to work on ASA version 8.3 and above due to some significant changes Cisco have made around natting.
If you're lucky enough to have contiguous public address space, and a 1:1 host mapping you can condense down the object groups & statics into subnets:
You wouldn't even really need the object group for your outside hosts in this scenario, but i've done it that way just to keep it consistent.