Solved

pfsense failover webservers

Posted on 2013-05-16
5
1,002 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RHEL6 + dockers - No route to host 7 102
Websites pages will not open in any browser 7 57
Reverse Proxy problem 3 35
swp file in unix 16 42
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…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

734 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