pfSense Gold Subscription

Author Topic: NAT (Port Forwarding) and web failover  (Read 2963 times)

0 Members and 1 Guest are viewing this topic.

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
NAT (Port Forwarding) and web failover
« on: February 27, 2012, 04:31:23 am »
Hi all,
I am new to pfSense and to this forum as well, so forgive me if I am posting it in wrong place.
I am using 2.0-RELEASE (amd64)
This is my network

I am trying to set up a failover for the web.
I have 2 problems.
1) I have created the NAT port forwarding but it doesn't work. If I create a NAT rule to access directly the web server then it works, but it doesn't work for the virtual server.
The virtual server for the failover is accessible from the VPN but not from internet.
2) The web-slave is not accessible when I am connected to the VPN of pfSense1 but the load balancer status shows it online. The traffic is not being blocked by any FW.
Any idea what am I doing wrong/what do i miss to make this work?

Thnx in advance.
« Last Edit: February 28, 2012, 07:45:06 am by skipper »

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 10006
  • Karma: +6/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #1 on: February 27, 2012, 04:54:13 am »
Remove nat rules for http as you have configured the load balance for these servers.

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #2 on: February 27, 2012, 05:07:52 am »
Hi marcelloc,
virtual server: 192.168.100.100
web:192.168.125.101
web-slave:192.168.129.101
I have a nat rule, source:wan address https, destination:192.168.100.100
if i remove that how will it work?

Offline cpk

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #3 on: February 27, 2012, 08:46:00 am »
skipper,

I think that load balancing by definition has to use NAT, so creating a NAT rule manually would conflict with the automatically created settings used by load balancing.

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 10006
  • Karma: +6/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #4 on: February 27, 2012, 08:58:32 am »
if i remove that how will it work?

The virtual server will listen on wan interface ip.

If you create a nat, the you will have two services "listening" on the same port/ip

Create the virtual server and then create a wan rule to allow traffic to it with no nat.
« Last Edit: February 27, 2012, 09:01:13 am by marcelloc »

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #5 on: February 27, 2012, 09:10:23 am »
i disabled the NAT rule and created 2 rules on the wan interface, first one destination wan address and the second one destination virtual server so i have not blocked package on the FW but still it doesn't work.
from my vpn connection i can access the virtual server but not from internet so i am a bit confused :S
do i need to setup something more?

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 10006
  • Karma: +6/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #6 on: February 27, 2012, 09:15:56 am »
Did you changed pfsense gui port and disabled WebGUI redirect to avoid conflict with your http redirect?


Is 192.168.100.100 your wan address?

Offline podilarius

  • Hero Member
  • *****
  • Posts: 1768
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #7 on: February 27, 2012, 09:18:17 am »
In your network, is the site-to-site a VPN or a point to point connection? They seem to be in different networks, so you are going to have to make sure that your routing and NAT reflect this.

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #8 on: February 27, 2012, 09:27:52 am »
i am accessing pfsense via http and the virtual server is listening to https so i think no conflict there (System: Advanced: Admin Access, protocol http).
how do i disable WebGUI redirection?
192.168.100.100 this is virtual's server ip, my wan address has an internet ip.

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #9 on: February 27, 2012, 09:30:12 am »
it's a vpn site-to-site. there is routing between the 2 networks so the web and web-slave can see each other. do i need an additional routing rule?

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 10006
  • Karma: +6/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #10 on: February 27, 2012, 10:42:24 am »
i am accessing pfsense via http and the virtual server is listening to https so i think no conflict there (System: Advanced: Admin Access, protocol http).
how do i disable WebGUI redirection?
192.168.100.100 this is virtual's server ip, my wan address has an internet ip.

Create another virtual server with wan ip and it will work.

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #11 on: February 27, 2012, 03:54:50 pm »
hey marcelloc thnx a lot, it's working!!
i cannot access the web-slave from internet but i can access it from web's network.
do i have to create some nat or routing about that?

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 10006
  • Karma: +6/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #12 on: February 27, 2012, 04:39:32 pm »
What status you have on loadbalance for the web-slave?

status -> loadbalancer

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #13 on: February 27, 2012, 04:50:04 pm »
the status is enable and accessible (green 100%) that's why i don't understand.

Offline skipper

  • Jr. Member
  • **
  • Posts: 38
  • Karma: +0/-0
    • View Profile
Re: NAT (Port Forwarding) and web failover
« Reply #14 on: February 28, 2012, 09:30:36 am »
i found out that when an https request is going to web-slave through the vpn, then the web-slave is trying to send the package through the wan interface and not back to vpn. can i somehow force this traffic to pass through the vpn connection?