The pfSense Store

Author Topic: web server behind pfsense 2 firewall  (Read 7722 times)

0 Members and 1 Guest are viewing this topic.

Offline lankanatha

  • Newbie
  • *
  • Posts: 13
    • View Profile
web server behind pfsense 2 firewall
« on: April 19, 2012, 02:39:27 am »
Hi,
i want setup web server behind firewall.please tell step by step instruction for fresh installation of pfsense 2.
thank you.

i have pc with two NIC
wan-----> real ip(xxx.xxx.xx.xx/27)
LAN----->172.16.1.1/24



Offline M.I.Bovrd

  • Jr. Member
  • **
  • Posts: 55
  • M.I.Bovrd
    • View Profile
    • CQRITEŽ
Re: web server behind pfsense 2 firewall
« Reply #1 on: April 19, 2012, 12:54:10 pm »
Step by Step instructions are posted here.

http://doc.pfsense.org/index.php/Main_Page
Tweet: MIBovrd@cqrite http://www.cqrite.com

Offline lankanatha

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #2 on: April 20, 2012, 02:32:06 am »
Step by Step instructions are posted here.

http://doc.pfsense.org/index.php/Main_Page

but i cant forward port???
i want to redirect web request port 80,81,82 to my local (172.16.24.20) webserver.
it doesnt working?

Offline biggsy

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #3 on: April 20, 2012, 05:38:26 am »
172.16.24.20 isn't in the 172.16.1.1/24 subnet.

Offline lankanatha

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #4 on: April 22, 2012, 11:09:25 pm »
172.16.24.20 isn't in the 172.16.1.1/24 subnet.

it means i have to change subnet as 172.16.24.20/16
???

Offline M.I.Bovrd

  • Jr. Member
  • **
  • Posts: 55
  • M.I.Bovrd
    • View Profile
    • CQRITEŽ
Re: web server behind pfsense 2 firewall
« Reply #5 on: April 23, 2012, 12:21:20 am »
You have a couple of options:

Use another interface for the server, better keeping servers separate anyway.
Use VLANS, one for the current 172.16.1.1/24 and the other 172.16.24.20/32.
Change the server IP or the network range so they are in the same range.

The pfSense book explains VLAN's really well, but you do need a managed switch that supports VLAN's, some say they do but don't do it very well.
Tweet: MIBovrd@cqrite http://www.cqrite.com

Offline lankanatha

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #6 on: April 23, 2012, 12:51:52 am »
You have a couple of options:

Use another interface for the server, better keeping servers separate anyway.
Use VLANS, one for the current 172.16.1.1/24 and the other 172.16.24.20/32.
Change the server IP or the network range so they are in the same range.

The pfSense book explains VLAN's really well, but you do need a managed switch that supports VLAN's, some say they do but don't do it very well.

Thank you.. for your reply,
i just follow that pfsense documentation for solve this,its very SIMPLE
1.add NAT
2.add Rule for allow access webser server thats all
but still i cant open port 80-82
this is what i did,
1.wan ip ------------xxx.xxx.xx.xx/27
lan ip 172.16.24.20/24
my internal web server ip 172.16.24.20/24
my web is running http://172.16.24.20:80
and some other services on 81 and 82

i want to access my local web through http://xxx.xxx.xx.xx:80 and 81,82
this is the scenario, its simple
please help me.
what i did
1.1. Browse to Firewall | NAT.
2. Select the Port Forward tab.
3. Click the "plus" button to create a new NAT port forward rule.
4. For Destination port range, choose HTTP for the from and to drop-down boxes.(80-82)
5. For Redirect target IP specify the web server this traffic will be forwarded to, by alias or IP address.(172.16.24.20)
6. For Redirect target Port choose HTTP.(80-82)
7. Add a Description, such as Forward HTTP to webserver1.
8. Save the changes.
then i did
1. Browse to Firewall | Rules.
2. Select the WAN tab.
3. Click the "plus" button to create a new firewall rule.
4. Specify the WAN Interface.
5. Specify the TCP Protocol.
6. Specify any as the Source.
7. Specify any as the Source Port Range.
8. Specify Webserver1 as our Destination.
9. Specify HTTP as our Destination Port Range.
10. Specify a Description.
11. Save the changes.

and unchecked nat reflection.


Offline M.I.Bovrd

  • Jr. Member
  • **
  • Posts: 55
  • M.I.Bovrd
    • View Profile
    • CQRITEŽ
Re: web server behind pfsense 2 firewall
« Reply #7 on: April 23, 2012, 09:44:16 am »
Sorry, I am confused, I think there is a language barrier here, I am not sure if you solved the problem or not? You say it is simple, but then say please help me?

Did you change your internal network range from 172.16.1.1/24 to something else? i.e. /16 or change the the LAN range to 172.16.24.0/24? I think that you have  changed range to 172.16.24.0/24 otherwise it wont work?!

Does the IP of the server have to be where you have it?

If you want to access internal servers from inside you need NAT Reflection on, as a general rule.

If you really have to supernet then a mask of /19 or 255.255.255.224 will give you a NET of 172.16.0.0-172.16.31.255 Broadcast. So you'd have to change your LAN. This will increase memory use though I am pretty sure.
Tweet: MIBovrd@cqrite http://www.cqrite.com

Offline lankanatha

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #8 on: April 24, 2012, 02:24:25 am »
Sorry, I am confused, I think there is a language barrier here, I am not sure if you solved the problem or not? You say it is simple, but then say please help me?

Did you change your internal network range from 172.16.1.1/24 to something else? i.e. /16 or change the the LAN range to 172.16.24.0/24? I think that you have  changed range to 172.16.24.0/24 otherwise it wont work?!

Does the IP of the server have to be where you have it?

If you want to access internal servers from inside you need NAT Reflection on, as a general rule.

If you really have to supernet then a mask of /19 or 255.255.255.224 will give you a NET of 172.16.0.0-172.16.31.255 Broadcast. So you'd have to change your LAN. This will increase memory use though I am pretty sure.
Thank you...
:-) it means this scenario is simple,
but i couldn't overcome this fault,
webserver ip 172.16.24.60/24

Offline M.I.Bovrd

  • Jr. Member
  • **
  • Posts: 55
  • M.I.Bovrd
    • View Profile
    • CQRITEŽ
Re: web server behind pfsense 2 firewall
« Reply #9 on: April 24, 2012, 12:43:43 pm »
Well, the only other thing I can suggest is to apply the Server IP to a VIP outside of your network, change the actual IP of the server to one inside your network range, and then create a 1:1 NAT between them.

Or your back to VLAN's again.

« Last Edit: April 24, 2012, 12:48:28 pm by M.I.Bovrd »
Tweet: MIBovrd@cqrite http://www.cqrite.com

Offline nahid

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #10 on: April 27, 2012, 06:14:00 pm »
lankanatha,

Create aliases for both of the IP's (Internal Web Server and External IP that you use for your domain).
Then make port forward for the desired ports.

Attached you can get the example.

Offline lankanatha

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #11 on: May 02, 2012, 01:35:25 am »
Thank you.
:-)
lankanatha,

Create aliases for both of the IP's (Internal Web Server and External IP that you use for your domain).
Then make port forward for the desired ports.

Attached you can get the example.

Offline lankanatha

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: web server behind pfsense 2 firewall
« Reply #12 on: May 03, 2012, 02:56:05 am »
but still it doesnt work,
please provide step by step configuration for redirect port 80 to internal server.
thank you.

lankanatha,

Create aliases for both of the IP's (Internal Web Server and External IP that you use for your domain).
Then make port forward for the desired ports.

Attached you can get the example.

Online cmb

  • Administrator
  • Hero Member
  • *****
  • Posts: 6314
    • LinkedIn
    • Twitter
    • View Profile
    • Chris Buechler
Re: web server behind pfsense 2 firewall
« Reply #13 on: May 03, 2012, 05:50:09 am »
That last post's screenshot is correct assuming the WANIF alias contains an IP assigned to your WAN (or an IP routed to you, or a virtual IP). What's in that alias?

Offline nipstech

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
    • NIPSTech
Re: web server behind pfsense 2 firewall
« Reply #14 on: May 04, 2012, 07:23:46 am »
I'm having what appears to be a related problem. My pfSense 2.0.1 box was running great until a thunderstorm knocked out the power. When I tried to bring the firewall back up, the file system was corrupt to the point where I had to do an install from scratch. I used the latest config backup I had, which was from Feb 2012, but when it got to  "conifguring firewall" on the console, it would hang. So, I started from scratch. I have a web server behind the firewall that I make accessible to the outside world but whenever I try to access a web page on it, it tries to go in as https instead of http. Is there something I'm missing here? I tried the suggestions below and it still isn't working. This shouldn't be rocket science and I've done it before...

Thank You,
Jon