Solved

pfsense failover webservers

Posted on 2013-05-16
5
975 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
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 26

Accepted Solution

by:
skullnobrains earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

808 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