Question Locked

Why can't I reach internal Web Server from outside?

0 helpful
42 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a PIX 501 connected to my home ISP providing NAT/PAT, and routing. Internal hosts can get out no problem. Have an Apache web server running internally. I can reach it from inside with no problem. But no matter what I try, I can't seem to reach it from outside.

The local address for the webserver is 192.168.1.201. From outside I'm trying to reach it by typing in the ip address of the outside interface; that's the way to get to it right? So if my public IP was 10.176.101.4, I would type http://10.176.101.4 in the browser, correct? I'm attaching a show config, show version, show interface, show route and show xlate from the PIX. Please let me know if you see where I'm going wrong. Thanks!!

-Bk

PIX2# show run
: Saved
:
PIX Version 6.3(5)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password 123XYZ encrypted
passwd 123XYZ encrypted
hostname PIX2
domain-name ecc.com
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
names
access-list outbound permit ip any any
access-list NoNAT permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
access-list 101 permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
access-list outside-in permit tcp any host 10.176.101.4 eq www
access-list outside-in permit tcp any host 192.168.1.201 eq www
pager lines 24
logging on
logging timestamp
logging trap informational
logging facility 22
logging host inside 192.168.1.201
icmp permit any outside
icmp permit any inside
mtu outside 1500
mtu inside 1500
ip address outside dhcp setroute
ip address inside 192.168.1.199 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list NoNAT
nat (inside) 1 192.168.1.0 255.255.255.0 0 0 (note: I've also tried'nat (inside) 1 0.0.0.0 0.0.0.0 0 0')
static (inside,outside) tcp interface www 192.168.1.201 www netmask 255.255.255.255 0 0
access-group outside-in in interface outside
access-group outbound in interface inside
timeout xlate 3:00: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 sip-disconnect 0:02:00 sip-invite 0:03: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 192.168.1.12 255.255.255.255 inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
crypto ipsec transform-set toyota esp-3des esp-md5-hmac
crypto map bmw 1 ipsec-isakmp
crypto map bmw 1 match address 101
crypto map bmw 1 set peer 10.171.58.125
crypto map bmw 1 set transform-set toyota
crypto map bmw interface outside
isakmp enable outside
isakmp key ******** address 10.171.58.125 netmask 255.255.255.255
isakmp identity address
isakmp policy 1 authentication pre-share
isakmp policy 1 encryption 3des
isakmp policy 1 hash md5
isakmp policy 1 group 1
isakmp policy 1 lifetime 1000
telnet 0.0.0.0 0.0.0.0 inside
telnet timeout 30
ssh 192.168.1.0 255.255.255.0 inside
ssh timeout 30
management-access inside
console timeout 0
dhcpd address 192.168.1.10-192.168.1.50 inside
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd auto_config outside
dhcpd enable inside
terminal width 80
Cryptochecksum:123XYZ
: end

PIX2# show interface
interface ethernet0 "outside" is up, line protocol is up
Hardware is i82559 ethernet, address is 000b.be94.a529
IP address 10.176.101.4, subnet mask 255.255.248.0
MTU 1500 bytes, BW 100000 Kbit full duplex
377294 packets input, 25432436 bytes, 0 no buffer
Received 358219 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
17515 packets output, 1928916 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 babbles, 0 late collisions, 0 deferred
0 lost carrier, 0 no carrier
input queue (curr/max blocks): hardware (128/128) software (0/41)
output queue (curr/max blocks): hardware (0/14) software (0/1)
interface ethernet1 "inside" is up, line protocol is up
Hardware is i82559 ethernet, address is 000b.be94.a52a
IP address 192.168.1.199, subnet mask 255.255.255.0
MTU 1500 bytes, BW 100000 Kbit full duplex
22937 packets input, 2050026 bytes, 0 no buffer
Received 67 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
56998 packets output, 9991631 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 babbles, 0 late collisions, 0 deferred
0 lost carrier, 0 no carrier
input queue (curr/max blocks): hardware (128/128) software (0/14)
output queue (curr/max blocks): hardware (0/27) software (0/1)

PIX2# show ver

Cisco PIX Firewall Version 6.3(5)
Cisco PIX Device Manager Version 3.0(4)

Compiled on Thu 04-Aug-05 21:40 by morlee

PIX2 up 10 hours 52 mins

Hardware: PIX-501, 16 MB RAM, CPU Am5x86 133 MHz
Flash E28F640J3 @ 0x3000000, 8MB
BIOS Flash E28F640J3 @ 0xfffd8000, 128KB

0: ethernet0: address is 000b.be94.a529, irq 9
1: ethernet1: address is 000b.be94.a52a, irq 10
Licensed Features:
Failover: Disabled
VPN-DES: Enabled
VPN-3DES-AES: Enabled
Maximum Physical Interfaces: 2
Maximum Interfaces: 2
Cut-through Proxy: Enabled
Guards: Enabled
URL-filtering: Enabled
Inside Hosts: 50
Throughput: Unlimited
IKE peers: 10

This PIX has a Restricted (R) license.

PIX2# show route
outside 0.0.0.0 0.0.0.0 10.176.96.1 1 DHCP static
outside 10.176.96.0 255.255.248.0 10.176.101.4 1 CONNECT static
inside 192.168.1.0 255.255.255.0 192.168.1.199 1 CONNECT static

PIX2# show xlate
8 in use, 71 most used
PAT Global 10.176.101.4(7505) Local 192.168.1.201(39900)
PAT Global 10.176.101.4(7507) Local 192.168.1.201(41609)
PAT Global 10.176.101.4(7506) Local 192.168.1.201(58216)
PAT Global 10.176.101.4(7509) Local 192.168.1.201(45599)
PAT Global 10.176.101.4(7508) Local 192.168.1.201(33990)
PAT Global 10.176.101.4(1031) Local 192.168.1.13(4302)
PAT Global 10.176.101.4(7510) Local 192.168.1.201(39729)
PAT Global 10.176.101.4(2991) Local 192.168.1.13(32209)

42 replies

by netman1958

10.176.101.4 isn't the actual IP address on the outside interface is it?

by bk6662

No - I just changed it in this posting for security purposes. Let me know if you need the actual public IP. Thx!

by netman1958

If you want to PM me the actual public IP, I will test it from here. Also I'd like for you to do this:
Clear the counters on your access-lists:
"clear access-list outside-in counters"
Then verify that the counters show 0:
"sh access-list outside-in"
Then try to connect to the server from the outside. Next, recheck the access-list counters and see if they incremented.

by bk6662

Counter cleared - public IP sent as you've requested. Please let me know if you haven't received the PM.

-Bk

by netman1958

Try disabling http server on the PIX itself with this:
"no http server enable"

Then give see if you can connect to your web server from outside. If that solves the problem, I think we can use another port to access the PIX itself over http.

by bk6662

When I saw your post I thought "Of course!!!" But I removed that entry from the running config - still can't connect (error 504 Destination not responding). By the way I forgot to add I -can- connect from the remote network over VPN.

Did you see the nat (inside) 1 entry in my config? I made a change to test, based on another post I stumbled across. Do you think I should change it back to 0.0.0.0 0.0.0.0 0 0, and try again? I'm afraid I'll lose remote connectivity once I make that change, but if you think it's worth a shot I may try it....

by cg it

bottom line is:

any traffic arriving on the external interface bound for port 80 needs to be forwarded to the https server and then back to the requestor. That traffic needs inside/outside NAT to make the round trip.

by bk6662

Trust me I can use all the help I can get!! I'm not working on https yet - sticking with port 80 for now. Since I only have a single public IP I'm using PAT. I have it set up identical to the PAT scenario in Cisco DocID 12496. I also found a forum message on Cisco Support (search for "PIX allowing inbound access, 1 external IP") where they did exactly what I'm trying to do.

Thanks!

by netman1958

Leave the PIX http server disabled and run:
"clear xlate"
Then try accessing the web server and let me know the results. Also, can you check again and make sure the access-list counters aren't incrementing since I have tried to connect from here.
You can go ahead and change your NAT back to the 0.0.0.0 0.0.0.0.

by bk6662

I've done as requested - still no go. (I had cleared the xlate table several times already - just did it again). Have also changed nat (inside) 1 as you've advised.

Here is the output of "show access-lists":

access-list cached ACL log flows: total 0, denied 0 (deny-flow-max 256)
alert-interval 300
access-list outbound; 1 elements
access-list outbound line 1 permit ip any any (hitcnt=12382)
access-list NoNAT; 1 elements
access-list NoNAT line 1 permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0 (hitcnt=165)
access-list 101; 1 elements
access-list 101 line 1 permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0 (hitcnt=52)
access-list outside-in; 2 elements
access-list outside-in line 1 permit tcp any host 70.176.101.4 eq www (hitcnt=0)
access-list outside-in line 2 permit tcp any host 192.168.1.201 eq www (hitcnt=0)

by netman1958

Let's try changing this:
access-list outside-in permit tcp any host 10.176.101.4 eq www
access-list outside-in permit tcp any host 192.168.1.201 eq www
to:
access-list outside-in permit tcp any interface outside eq www

by bk6662

I changed the outside-in access list as you've recommended. I then cleared the xlate table, and tried connecting again. Still nothing. Somehow www traffic doesn't seem to be hitting the PIX?

by cg it

isn't getting to the external interface? do you have split tunneling?

If netman is trying to get in using the public address, and your PIX if configured to listen for inbound traffic on the address, there ought to be something showing on the PIX that is gets the traffic and does something with it.

by cg it

while www "should" work, never know with the PIX.

by netman1958

That's a good idea as I have seen the actual port number work when the acronymn didn't. The really wierd thing is that while I can't connect to his web server on port 80, if I use putty and try ssh to his outside IP address I actually get a login prompt for a linux/unix server while the config he posted doesn't show any port-forwarding or static-nat for ssh nor does his access-list permit it.
Very Strange. I'm going to have to think on this one.

by bk6662

I made this change as you recommended. But when I show running config, it changes it back to www.

by cg it

which is a plus for troubleshooting because if he can get in on port 22 then he ought to be in on http.

by bk6662

Exactly. That's why this one is so strange to me. Since I can log in SSH from outside (I'm connected right now) I know connectivity is there. For the life of me I can't figure out why I can't get in over port 80. Somebody else thought the ISP might be blocking port 80, so they recommended the following:

no static (inside,outside) tcp interface www 192.168.1.201 www netmask 255.255.255.255

static (inside,outside) tcp interface 8880 192.168.1.201 www netmask 255.255.255.255

access-list outside-in permit tcp any interface outside eq 8880

Then try to access the web server on port 8880 from outside:

http://:8880

This will let us know if the ISP is blocking port 80.

I made the change as recommended, thinking they were on to something. But nothing - still no indication that anything is coming through.

by cg it

this seems incomplete to me but then I dislike PIX firewalls.

static (inside,outside) tcp interface www 192.168.1.201 www netmask 255.255.255.255 0 0

by cg it

do you have SDM ?

not really a PIX guy PIX to me = pita

by cg it

.. so you used 22? wonder if that any any statement is the problem.

by bk6662

Sorry I didn't broadcast that I currently have "ssh 0 0 outside" enabled. That's why NetMan is able to get a login prompt.

by cg it

that's what you have for ssh

so netman shouldn't get in from outside using the public address and port 22 if your access-lists are right because at the end of eveyr access list is the deny statement.

so port 22 traffic shouldn't match up with any allowed statements unless you have any any or tcp any any in which case http traffic ought to work.

by netman1958

Something is still not right. I'm not getting a login to your PIX, I'm getting a login prompt for a linux/unix server.
I copied this from Putty:
login as: root
Sent username "root"
root@xx.176.101.4's password:

by netman1958

Can you post the complete config again with nothing left out. Maybe there's something we're missing.

by bk6662

Here's the full config, including changes I've been making along the way. All I left out were the password hashes.

PIX Version 6.3(5)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password XYZ encrypted
passwd XYZ encrypted
hostname PIX2
domain-name ecc.com
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
names
access-list outbound permit ip any any
access-list NoNAT permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
access-list 101 permit ip 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0
access-list outside-in permit tcp any interface outside eq www
access-list outside-in permit tcp any interface outside eq 8880
pager lines 24
logging on
logging timestamp
logging trap informational
logging facility 22
logging host inside 192.168.1.201
icmp permit any outside
icmp permit any inside
mtu outside 1500
mtu inside 1500
ip address outside dhcp setroute
ip address inside 192.168.1.199 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list NoNAT
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) tcp interface 8880 192.168.1.201 www netmask 255.255.255.255 0 0
access-group outside-in in interface outside
access-group outbound in interface inside
timeout xlate 3:00: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 sip-disconnect 0:02:00 sip-invite 0:03: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
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
crypto ipsec transform-set toyota esp-3des esp-md5-hmac
crypto map bmw 1 ipsec-isakmp
crypto map bmw 1 match address 101
crypto map bmw 1 set peer 75.171.58.125
crypto map bmw 1 set transform-set toyota
crypto map bmw interface outside
isakmp enable outside
isakmp key ******** address 75.171.58.125 netmask 255.255.255.255
isakmp identity address
isakmp policy 1 authentication pre-share
isakmp policy 1 encryption 3des
isakmp policy 1 hash md5
isakmp policy 1 group 1
isakmp policy 1 lifetime 1000
telnet 0.0.0.0 0.0.0.0 inside
telnet timeout 30
ssh 0.0.0.0 0.0.0.0 outside
ssh 192.168.1.0 255.255.255.0 inside
ssh timeout 30
management-access inside
console timeout 0
dhcpd address 192.168.1.10-192.168.1.50 inside
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd auto_config outside
dhcpd enable inside
terminal width 80
Cryptochecksum:30bf07233d8997ee2944427d3df75465
: end
PIX2#

by cg it

access-group outside-in in interface outside
access-group outbound in interface inside

and

access-list outside-in permit tcp any host 10.176.101.4 eq www
access-list outside-in permit tcp any host 192.168.1.201 eq www

by bk6662

CG,

My gut feeling tells me you are right. Although I don't quite understand, since I'm following the documentation I've been able to find. By the way I've changed the Access-list earlier at NetMan's recommendation. It's now:

access-list outside-in permit tcp any interface outside eq www
access-list outside-in permit tcp any interface outside eq 8880

(Including the second test where I changed to port 8880).

The "Outbound" access group doesn't apply to inbound traffic - "outside-in" is the only one affecting incoming traffic. So if there's an error it has to be with that group / list.

Thanks!

by netman1958

Does your web server display a page that just says "It works!"? If so, I'm able to access it via a web browser. Also from a command prompt:
telnet x.176.101.4 8880

501 Method
Not Implemented

Method Not Implemented

get to /in
dex.html not supported.


Apache/2.2.9 (Debian) PHP/5.2.6-1+
lenny8 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_perl/2.0.4 Perl/v5.1
0.0 Server at debian.mydomain.local Port 80

Connection to host lost.

by bk6662

Ok I just noticed my hit-counter for line-2 of the ACL (permit tcp any interface outside eq 8080) is increasing when I attempt to connect over that port. Even though it still isn't connecting. That's progress right (at least traffic is coming in)? Nothing in the XLATE table showing that port though.

by bk6662

So you are able to connect via port 8880? Apparently:

- The ISP is in fact blocking port 80, and;
- My corporate office must be blocking non-standard ports. (dang don't know why I never thought about that!)

I tried the telnet connection you mentioned but didn't get a response. But then again if they're blocking that port, I guess it wouldn't matter what protocol I'm using.

I guess I will need to keep that in mind whilst testing from the office.

Once again thank you both. I greatly appreciate your assistance!

-Bk

by netman1958

I determined your ISP by doing a whois lookup on your IP address and did some research. Actually they do block port 80 along with several other well-known ports. I'm going to email you a link to a web page with details.

by tobif

Ehhm. If your "public" address begins with 10. then you have a problem, which may be out of your reach. The range 10.x.x.x is (just like 192.168.x.x) used for private addressing, and not routable on the internet.
I.e. You may be reaching internet via two layers of NAT, where you're only able to deal with the settings of the inner layer.

by motrocks

sounds like there maybe more than one firewall here somewhere?

if this is so then there is another to configure. This would explain the different login screen one of the posters was seeing.

example, I have two boxes before I can connect to a machine at home. One is residential router (DSL), then my WIFI box for boradcasting round the house.

Initially I had a similar problem, when connecting to port 80 I was ONLY seeing the residential box. Then when I port forwarded, I was able to see my WIFI box. This didn't fix the issue obviously (I wanted a server on the WIFI box.

A little more tweaking and port forwarding, changed some default ports for config on both boxes and presto. worked.

try login to the ssh and work out what machine you are seeing.

my network diagram

NET -> RB -> WIFI BOX -> SERVER

where:
NET=internet
RB= residential box
WIFI = WIFI
SERVER = SERVER

I couldn't understand why I had ssh and no http until I realised I was connecting to the unix config's of boxes

by tobif

In this type of setup, I'd give the wifi router a fixed IP address in the lan segment of the residential box, and then assign this address as DMZ, so that all arriving traffic from the internet is forwarded to "my own" router.

by tobif

Many internet providers for residential services will, on purpose, block incoming traffic to port 80(TCP) since too many home routers or PCs publish unprotected web services on this port, without the user realizing this.

Try to put your server on a different port, say 8010 and then add the port number like this:
myvirtualserver.dyndns.org:8010/start.html

by bk6662

Hi TechRep,

Thank you for your replies. Yes it turned out the ISP was in fact blocking port 80, as you have implied. Another user on this forum was kind enough to perform a "Whois" lookup on my ISP and confirmed this to be the case. (See subject "Your ISP" in a previous post).

Appreciate your assist.

-bk

by master_key

1- First apart form the pix rules, just enable all ports forwarding to your local web server.
2- Check if it works (from outside your lan)
3- If it works, check each access rules on pix
4- if it didn't then might you are using windows 2008, or windows 7 ? it have special setting to allow Wan access, not only Lan ones.

Hope it guide you ;)

This discussion is closed to new replies.