Question

pix501 static ip mapping and port forwarding

Asked by: daveky

I looked at this:

http://www.experts-exchange.com/Security/Firewalls/Q_21562130.html?qid=21562130

and it makes perfect sense to me. We are doing similar stuff:

static (inside,outside) tcp interface 2121 [internal IP of hosted server] ftp netmask 255.255.255.255 0 0
access-list OUTSIDEACL permit tcp host [ip of our office] host [external IP avalaible on pix] eq 2121

ie we map a port (2121 in this case) on the external ip of the pix throught to a different port (21 here) on a specific intenal ip at our dedicated hosting.

However we also have specific external-to-intenal ip mappings. Like:

static (inside,outside) [available external IP on pix] [internal IP of hosted server] netmask 255.255.255.255 0 0

Then we allow certain ports through for that mapping (sometimes only allowing access from specific ips as is sensible for ssh):

access-list OUTSIDEACL permit tcp any host [available external IP on pix] eq www
access-list OUTSIDEACL permit host [ip of our office] host [available external IP on pix] eq ssh

Super. But my boss now wants to mask those ports. So that ssh(22) or ftp(21) are not available on the outside but perhaps 2121 and 2222 are. But I am not able to work out the syntax for this port mapping when we have a dedicated external IP for an inernal server. I can only do "pass through" ports. I would guess for the access-list it would be:

access-list OUTSIDEACL permit host [ip of our office] [ecernal port to connect on] host [available external IP on pix] eq [internal port to forward to]

But this does not actually forward the port, it just allows the traffic. How do you forward one port to another if you have all traffic for an external ip pushed to an internal ip. Not possible? Cheers, D.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-09-25 at 03:36:07ID22001279
Tags

ip

,

port

,

pix

,

static

,

mapping

Topic

Network Software Firewalls

Participating Experts
3
Points
125
Comments
16

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Dynamic Cisco 837 to Static Cisco Pix501 VPN
    Hi Folks, I have a Cisco PIX501 Firewall setup on a static VPN - it accepts VPN clients fine using the Cisco VPN Client Software (as well as PPTP clients if I want them to). The problem I have at the moment is trying to get a Site to Site VPN working from a Cisco ADSL route...
  2. Cisco VPN client passing through a Pix501 to connect to …
    Hello All. I have a PIX501 6.3(3). I am trying to connect using the Cisco VPN client to another PIX501. I can connect and authenticate to the PIX, however traffic will not traverse. in the stats I see traffic benig sent however none comes back. Client will connect and ship t...
  3. How to open port 22 for ssh on PIX501 and Windows S…
    I would like to setup a secure shell (ssh) link to a windows 2003 server through a pix501 firewall. How would I do this on the windows server and the pix??
  4. PIX501 FIREWALL
    hi i have the firewall pix501 , and i have a config file. in e:\ciscopix.txt , how can i load those into the firewall. please guide asap. useing hyperterminal i am blocked, i dont know what to do. Q. how can i have it remote access , how can i put ip , subnet , gatewa...
  5. Pix501
    Running Cisco PIX Firewall Version 6.3(3) Cisco PIX Device Manager Version 3.0(1) Compiled on Wed 13-Aug-03 13:55 by morlee pixfirewall up 1 year 2 days Hardware: PIX-501, 16 MB RAM, CPU Am5x86 133 MHz Flash E28F640J3 @ 0x3000000, 8MB BIOS Flash E28F640J3 @ 0xfffd800...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: InteraXPosted on 2006-09-25 at 03:52:13ID: 17590995

Hi daveky,

The full syntax of the static command can e found at http://www.cisco.com/en/US/customer/products/sw/secursw/ps2120/products_command_reference_chapter09186a00801cd841.html#wp1026694

It is possible to map ports. Basically, the command for PIX V6.3 should read as follows.

STATIC (INSIDE,OUTSIDE) TCP OutsideIP OutsidePort InsideIP InsidePort

Good Luck,

Chris

 

by: davekyPosted on 2006-09-25 at 04:03:43ID: 17591041

I think I get it. But I would have to map each port individually in this way even if I wanted most ports to "pass through" without being changed. Is that correct? By which I mean: there is no way to map ip to ip to allow simple pass-though traffic AND say but map this port to this other port in one case.

We use quite a lot of ports an this would make our fire wall rules much longer. But, if that's what we have to do...

 

by: InteraXPosted on 2006-09-25 at 04:12:49ID: 17591100

daveky,

If you need to map ports on an IP, then all the mappings on that IP should be mapped seperately. Any other mappings can be mapped using an IP to IP mapping.

 

by: davekyPosted on 2006-09-25 at 04:31:32ID: 17591189

So to hide the real ports I need to remove the IP to IP mapping and add IP:port to IP:port mapping for each port we need as well as add an access rule for each? Can you confirm that the access rule for your example would be along the lines of:

access-list OUTSIDEACL permit host [ip of our office] [exernal port to connect on] host [available external IP on pix] eq [internal port to forward to]

OR (where 4.3.2.1 = our office; and 1.2.3.4 = an external pix IP):

STATIC (INSIDE,OUTSIDE) TCP 1.2.3.4 2222 192.168.1.x 22
access-list OUTSIDEACL permit host 4.3.2.1 2222 host 192.168.1.x eq 22

 

by: InteraXPosted on 2006-09-25 at 05:12:55ID: 17591481

daveky,

Your existing ACLs should still work OK as these are applied to the outside interface. You only need to adjust the NAT/PAT mappings.

 

by: keith_alabasterPosted on 2006-09-25 at 05:32:08ID: 17591651

As you will be changing the dynamics of the external interface you will need to perform a clear xlate.

Not having seen your original config, you will also need to consider the ordering of the lines within your ACL. For example, a one-to-one static mapping allowing all tcp traffic from external to internal address would negate any following rules allowing only particular ports to the same destination.

 

by: davekyPosted on 2006-09-25 at 06:43:52ID: 17592227

InteraX: I follow. It's not as bad as it seems then.

keith_alabaster: Thanks, I could easily have missed using clear xlate.

I'm think I'll be removing the one-to one in favour of specific ip and port mapping. However, are you saying a one-to-one static would override any following rules? Is this a case of first that matches applies? In which case can I have rules for those ports I need to forward/change before a one-to-one and so not have to map every port I need?

Eg If I need to map 21, 22 and 80, but only mask 22 into 2222 I could have:

STATIC (INSIDE,OUTSIDE) TCP 1.2.3.4 2222 192.168.1.2 22
STATIC (INSIDE,OUTSIDE) TCP 1.2.3.4 192.168.1.2

and this would map external port 2222 to internal port 22 but all other ports would be passed through Unaffected. (I guess this would not black external port 22 from accessing internal port 22 though defeating the object of the exercise - is there a block rule?). D.

 

by: InteraXPosted on 2006-09-25 at 07:13:50ID: 17592498

You would block access to port 22 on the Outside interface via an ACL.

 

by: davekyPosted on 2006-09-25 at 09:42:57ID: 17593820

So there is a way to block as well as allow! Could you give me a clue on the syntax? I just assumed it was block unless you allowed traffic. It somehow seemed silly to have allow rules you would need to then block again (before now).

Is it just

access-list OUTSIDEACL block tcp any host [available external IP on pix] eq 22

that I need? (Sorry, I have no pix to mess with. Just a live service. If I mess it up I'll get my fingers chopped off!)

 

by: keith_alabasterPosted on 2006-09-25 at 09:43:39ID: 17593826

Sorry, just to intercede, because you have applied an ACL to the outside interface, only traffic that you have specifically permitted is allowed through; all other traffic is denied automatically via the explicit deny all.  ie If you have NOT autorised port 22 then it is blocked anyway.

 

by: davekyPosted on 2006-09-25 at 10:58:09ID: 17594480

Yes, but is it possible to say (pseudo rules):

Access list:
block port 22 on [external ip] going to [internal ip]
Allow port 2222 on [external ip] through to port 22 on [internal ip]
Allow ALL traffic on [external ip] throught to [internal ip]

NAT:
Map port 2222 on [external ip] to port 22 on [internal ip]
Map [external ip] to [internal ip]

If the pix matches and allows block IN ORDER, this should allow me to map 2222 to 22, pass all other traffic straight through, but block access on port 22. Shouldn't it? Am I getting this entiely wrong or finally getting the idea?

 

by: keith_alabasterPosted on 2006-09-25 at 11:05:26ID: 17594560

No, you are correct. You can place a deny statement on that port followed by a permit statement for the additional traffic that you DO want to pass through.

Regards

Keith

 

by: prueconsultingPosted on 2006-09-25 at 11:15:54ID: 17594676

PIxs apply Acl's top down with an implicit deny all at the end

 

by: davekyPosted on 2006-09-26 at 09:19:35ID: 17602781

Well, I'll give this a go when I can. As I havn't pix I can test these things on I will have to wait for a go ahead from my boss that he wants me to try this out. At least I know it's possible. I have no idea how to re-order rules without removing and re-adding them so I'll probably be asking questions about that next... Thanks to all.

 

by: keith_alabasterPosted on 2006-09-26 at 09:46:45ID: 17603137

Thanks :)

 

by: InteraXPosted on 2006-09-26 at 09:48:57ID: 17603168

Thanks. ;-)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...