Solved

pfsense failover webservers

Posted on 2013-05-16
5
967 Views
Last Modified: 2013-05-22
Pfsense version: 2.0.1-RELEASE  (amd64)

We are testing setting up fail-over webservers via pfsense.

Current setup: 2  working test webservers "A" an "B" on the lan, port 80.

(2 WAN connections)
2 pools: pool1 includes only "A", pool2 includes only "B".
1 virtual server, tried both with external ip as well as lan ip. Lists A as pool, B as fall back.

Working monitor, using http.

Test1:
setup virtual server with external address, listening to port 83, duplicate virtual server for second external ip, also port 83.
Added firewall rules to allow traffic ports 83 on external ips for both wan ip's/adapters;
allow port 83 to virtual server; allow port 80 to webservers A & B.

Result:
When connecting externally to external ips port 83, it works at first. When turning off A, pfsense loadbalancing status shows A correctly to be offline, B still online.
Externally now unable to connect external ips port 83. Deleted webbrowser cache etc. same result. Disable sticky connection same result.

Test 2:

setup virtual server with internal address, listening to port 83, NAT for external ips port 83 forward to virtual server.
Added firewall rules to allow traffic ports 83 on external ips for both wan ip's/adapters;
allow port 83 to virtual server; allow port 80 to webservers A & B.

Result:
When connecting externally to external ips port 83, it doesn't work. Error in browser: "nc: getaddrinfo: hostnamenor servname provided or not known".

Deleted webbrowser cache etc. same result. Disable sticky connection same result.

What am I missing?
0
Comment
Question by:miarch
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:skullnobrains
Comment Utility
provide better information about your config

"Externally now unable to connect external ips port 83"

if this is true, stopping one of the web servers willdefinitely not prevent the othe one from working using the previously working private address

"nc: getaddrinfo: hostnamenor servname provided or not known"

this cannot be related to a firewall problem. most likely you are using a dead or stale dns entry to access your machines
0
 

Author Comment

by:miarch
Comment Utility
More detailed config:

Test 1
pool 1: contains 1 server 10.0.10.2:80
pool 2: contains 1 server 10.0.10.3:80

virtual server 1 on external ip 173.194.66.94:83 - points to pool1 with pool2 as fall back.
virtual server 2 on external ip 74.125.132.94:83 - points to pool 1 with pool2 as fall back.

Firewall allows 173.194.66.94:83, 74.125.132.94:83, 10.0.10.3:80, 10.0.10.2:80 from anywhere.

Sticky connection is turned off.

On start of test, both pools are up. Can access the website from outside of my network on either virtual server.
Once I turn off pool1, pfsense correctly displays pool1 to be down. But I am unable to then access the website outside of my network, on port 83, on either virtual server, so there appears to be no automatic fall back.

Yes, I can then still access pool2 on it's internal ip:80 from inside my network.

Test 2: Yes, that error having to do with dns makes sense. Not sure how to address it, though. I think I will focus on test 1.
0
 
LVL 26

Accepted Solution

by:
skullnobrains earned 500 total points
Comment Utility
thanks for the info

test 1 : you cleared out yourself that fallback on server 2 does not work. i'd like to make sure that server 2 does work. can you set one ip with pool2 as the main pool and pool1 as the fallback ? or even pool2 alone just to confirm it does work in the first place. maybe something about starting in down state and/or a non working health check... or simply a misconfiguration.

test 2 : if the same netcat worked previously, it is very weird you would get this error unless you are using a dns name dynamically created by the load balancer when it does work. try using the IP, and maybe check wether it does work when pool1 is up
0
 

Author Comment

by:miarch
Comment Utility
ok will have to continue after the long weekend here in Alberta :-)
0
 

Author Comment

by:miarch
Comment Utility
Thanks, I got it working after a long fight with my apache2 and iptables on the machines itself. Had to also remove the complete website and make a simple index.html.

Yes, testing it the other way around totally helped, as with that I could really test every element until I got it finally working.

btw, I ended up going with test2, where the virtual server has the external ip.
Now when I put pool 2 as fallback and then turn off pool1 it indeed automagically falls over to pool2.

Cool stuff
Ruben
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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