Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

pfsense failover webservers

Posted on 2013-05-16
5
Medium Priority
?
1,032 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 27

Expert Comment

by:skullnobrains
ID: 39175576
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
ID: 39175929
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 27

Accepted Solution

by:
skullnobrains earned 2000 total points
ID: 39177270
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
ID: 39177447
ok will have to continue after the long weekend here in Alberta :-)
0
 

Author Comment

by:miarch
ID: 39189099
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

963 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