SSH Port forward from a specific IP

Posted on 2007-12-06
Last Modified: 2010-04-21
Ok I read thru the other port forward questions and they didn't really help me. What I want to do is allow SSH thru the PIX. I only want the SSH session to be able to come from one static IP address. I want this SSH to point to one specific machine on my internal network. Here is a show run from the pix. Its pretty default. My son has played with it so his X-Box will work. If you have a suggestion I am more than willing to give it a try. Thanks in Advance


home-firewall# sho run
: Saved
PIX Version 6.3(4)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password xxxxxxxx encrypted
passwd xxxxxxxxx encrypted
hostname home-firewall
clock timezone EST -5
clock summer-time EDT recurring
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
object-group service XBLTCP tcp
  description Needed to make X-Box Live work
  port-object range 3074 3074
object-group service XBL-UDP udp
  description This it to make X-Box Work
  port-object range 3074 3074
  port-object range 88 88
object-group service NWN2 udp
  description allows me to host
  port-object range 5121 5121
access-list MY_INBOUND permit tcp any interface outside eq ssh
pager lines 24
mtu outside 1500
mtu inside 1500
ip address outside xx.xx.xx.xx
ip address inside
ip audit info action alarm
ip audit attack action alarm
pdm logging informational 100
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0 0
route outside xx.xx.xx.1 1
route inside xx.xx.xx.1 1
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
http server enable
http inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
telnet inside
telnet timeout 5
ssh inside
ssh timeout 5
console timeout 0
dhcpd address inside
dhcpd dns xx.xx.xx.xx xx.xx.xx.xx
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd domain
dhcpd auto_config outside
dhcpd enable inside
username xxxx password xxxxxxxx encrypted privilege 15
terminal width 80
Question by:psd_steve
  • 3
  • 2
LVL 28

Accepted Solution

batry_boy earned 500 total points
ID: 20425369
Assuming the following value:

x.x.x.x = inside IP address of machine you want to allow SSH to
y.y.y.y = external IP address you wish to allow inbound SSH from

Put in these commands:

static (inside,outside) tcp interface ssh x.x.x.x ssh netmask
access-list outside_access_in permit tcp host y.y.y.y interface outside eq ssh
access-group outside_access_in in interface outside

That should do it...

Author Comment

ID: 20425411
Ok, it seemed to work like a charm. I have a follow up question however. How would I add an additional host? Just redo:

access-list outside_access_in permit tcp host y.y.y.y interface outside eq ssh

with the additional IP address? or do I need to do the entire thing over and create a new access list?

Also in my screwing around, I seem to have added:

access-list MY_INBOUND permit tcp any interface outside eq ssh

to my PIX. How do I delete this line from memory?
LVL 28

Expert Comment

ID: 20425429
>>Just redo:

access-list outside_access_in permit tcp host y.y.y.y interface outside eq ssh

with the additional IP address?

Yes, that is correct.  You can only have one access list applied to an interface in the same direction at a time, so you wouldn't be able to create a new access list and apply it in the same way.  Therefore you have to add another line to the same access list that references the additional source IP address.

>>access-list MY_INBOUND permit tcp any interface outside eq ssh

How do I delete this line from memory?

Enter the following command to delete that line:

no access-list MY_INBOUND permit tcp any interface outside eq ssh

You just put a "no" in front of the entire command it negates (deletes) the command.  This is true for nearly all the configuration commands on a PIX.

Hope this helps...

Author Closing Comment

ID: 31413335
Well deserved Wizard, more like a Guru to me! Thanks for the quick help

LVL 28

Expert Comment

ID: 20425458
Glad to help!

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Cisco Pix/ASA hairpinning The term, hairpinning, comes from the fact that the traffic comes from one source into a router or similar device, makes a U-turn, and goes back the same way it came. Visualize this and you will see something that looks …
This article assumes you have at least one Cisco ASA or PIX configured with working internet and a non-dynamic, public, address on the outside interface. If you need instructions on how to enable your device for internet, or basic configuration info…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now