{"id":8514,"date":"2013-08-18T17:31:32","date_gmt":"2013-08-18T22:31:32","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=8514"},"modified":"2014-03-18T21:43:48","modified_gmt":"2014-03-19T02:43:48","slug":"layer7-configre-a-gateway-cluster-with-pfsense","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=8514","title":{"rendered":"Layer7: Configure a Gateway Cluster with pfSense"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#Overview\">Overview<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Architecture\">Architecture<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#System_Requirements\">System Requirements<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Overview_of_Creating_a_new_Gateway_Cluster\">Overview of Creating a new Gateway Cluster<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Configure_DB_Replication\">Configure DB Replication<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#System_Requirements_1\">System Requirements<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_Replication\">Configure Replication<\/a>\n\t\t\t\t<ol class='toc-odd level-3'>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#Run_add_slave_user.sh_Script\">Run add_slave_user.sh Script<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#Run_create_slave.sh_Script\">Run create_slave.sh Script<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#Verify_replication_has_started\">Verify replication has started<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t<\/ol>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Monitor_Replication_Failure\">Monitor Replication Failure<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Restart_Replication\">Restart Replication<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Configure_Nodes\">Configure Nodes<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_First_Node:_layer701\">Configure First Node: layer701<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_Additional_Node\">Configure Additional Node<\/a>\n\t\t\t\t<ol class='toc-odd level-3'>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#layer702\">layer702<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t<\/ol>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_Name_Resolution\">Configure Name Resolution<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Start_Cluster\">Start Cluster<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_a_CA_Key_for_the_Cluster\">Configure a CA Key for the Cluster<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Deactivating_a_Cluster_Node\">Deactivating a Cluster Node<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Configure_Layer_7_Nodes\">Configure Layer 7 Nodes<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_Node_1\">Configure Node 1<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Configure_Node_2\">Configure Node 2<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Configure_LB_with_pfSense\">Configure LB with pfSense<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Install_pfSense\">Install pfSense<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Overview_1\">Overview<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Turn_on_Layer_7_pingServlet.mode\">Turn on Layer 7 pingServlet.mode<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Config_pfSense_Load_Balancer\">Config pfSense Load Balancer<\/a>\n\t\t\t\t<ol class='toc-odd level-3'>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#Add_Monitors\">Add Monitors<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#Add_Pools\">Add Pools<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t<\/ol>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Add_Virtual_Monitors\">Add Virtual Monitors<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Check_Load_Balancer_Status\">Check Load Balancer Status<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Open_WAN_Firewalls_for_Port_8080_and_8443\">Open WAN Firewalls for Port 8080 and 8443<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Open_LAN_Firewalls_for_both_Port_8080_and_8443\">Open LAN Firewalls for both Port 8080 and 8443<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Check_that_Load_Balancer_is_Listening_on_both_Port_8080_and_8443\">Check that Load Balancer is Listening on both Port 8080 and 8443<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Point_Layer_7_Policy_Manager_to_Load_Balance_IP\">Point Layer 7 Policy Manager to Load Balance IP<\/a>\n\t\t\t<\/li>\n<\/ol>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"Overview\"><h2>Overview<\/h2><\/span>\n<p>* Gateway cluster nodes share:<br \/>\n&#8211; service policies<br \/>\n&#8211; identity providers<br \/>\n&#8211; configuration settings<\/p>\n<span id=\"Architecture\"><h3>Architecture<\/h3><\/span>\n<span id=\"\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/layer7_cluster_architecture.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/layer7_cluster_architecture-300x181.jpg\" alt=\"\" title=\"layer7_cluster_architecture\" width=\"300\" height=\"181\" class=\"aligncenter size-medium wp-image-8515\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/layer7_cluster_architecture-300x181.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/layer7_cluster_architecture.jpg 749w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"System_Requirements\"><h3>System Requirements<\/h3><\/span>\n<p>* Load Balancer device to provide TCP-level load balancing and failover<br \/>\n* Each node must possess its own host name, IP, and original node address within the LB<br \/>\n* Cluster must possess a host name and IP in LB<br \/>\n* Two nodes of the cluster must be installed and configured with the MySQL database with known root user names and root user passwords<\/p>\n<span id=\"Overview_of_Creating_a_new_Gateway_Cluster\"><h3>Overview of Creating a new Gateway Cluster<\/h3><\/span>\n<p>* Configure db replication on both Gateway db nodes<br \/>\n* Configure the first node<br \/>\n* Configure subsequent nodes<br \/>\n* Start cluster<br \/>\n* Create CA key for the cluster<br \/>\n* Install and configure LB on the network<\/p>\n<span id=\"Configure_DB_Replication\"><h2>Configure DB Replication<\/h2><\/span>\n<p>* Maximum two MySQL db servers can be configured in a cluster<br \/>\n* Each peered db unit becomes both a slave and master to the other unit, i.e. master-master replication<\/p>\n<span id=\"System_Requirements_1\"><h3>System Requirements<\/h3><\/span>\n<p>* Both db servers have host names and IPs in DNS or \/etc\/hosts<br \/>\n* Both MySQL services are running<br \/>\n* Both Gateway services stopped<br \/>\n* Time synchronized among all Gateway nodes<\/p>\n<span id=\"Configure_Replication\"><h3>Configure Replication<\/h3><\/span>\n<span id=\"Run_add_slave_user.sh_Script\"><h4>Run add_slave_user.sh Script<\/h4><\/span>\n<p>Run the following script against the local db on each node to add permissions for the users to MySQL:<\/p>\n<pre lang=\"bash\">\r\nservice ssg stop\r\n\/opt\/SecureSpan\/Appliance\/bin\/add_slave_user.sh\r\n<\/pre>\n<p>You need to enter:<br \/>\n* For layer701:<br \/>\n&#8211; hostname or IP for the <target>: <strong>layer702.pfsense.local<\/strong> # Note that this is the other node<br \/>\n&#8211; replication user (defaults to repluser): <strong>repluser<\/strong><br \/>\n&#8211; replication password: <strong>Welcome1<\/strong><br \/>\n&#8211; MySQL root user: <strong>root<\/strong><br \/>\n&#8211; MySQL root password: <strong>7layer<\/strong><br \/>\n&#8211; Is this the primary (1) or Secondary database node? <strong>1<\/strong><\/p>\n<span id=\"_1\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_1-300x202.jpg\" alt=\"\" title=\"pfsense01_layer701_dbRepl_1\" width=\"300\" height=\"202\" class=\"aligncenter size-medium wp-image-8556\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_1-300x202.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_1.jpg 616w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* For layer702:<br \/>\n&#8211; hostname or IP for the <target>: <strong>layer701.pfsense.local<\/strong> # Note that this is the other node<br \/>\n&#8211; replication user (defaults to repluser): <strong>repluser<\/strong><br \/>\n&#8211; replication password: <strong>Welcome1<\/strong><br \/>\n&#8211; MySQL root user: <strong>root<\/strong><br \/>\n&#8211; MySQL root password: <strong>7layer<\/strong><br \/>\n&#8211; Is this the primary (1) or Secondary database node? <strong>2<\/strong><\/p>\n<span id=\"_2\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_1-300x198.jpg\" alt=\"\" title=\"pfsense01_layer702_dbRepl_1\" width=\"300\" height=\"198\" class=\"aligncenter size-medium wp-image-8557\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_1-300x198.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_1.jpg 622w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Run_create_slave.sh_Script\"><h4>Run create_slave.sh Script<\/h4><\/span>\n<p>Run the following script against each db node to setup the replication to run between the two databases, using the user configured in the previous <em>add_slave_user.sh<\/em> script. This sets up the other db as master:<\/p>\n<pre lang=\"bash\">\r\n\/opt\/SecureSpan\/Appliance\/bin\/create_slave.sh\r\n<\/pre>\n<p>* For layer701:<br \/>\n&#8211; hostname or IP for the MASTER: <strong>layer702.pfsense.local<\/strong><br \/>\n&#8211; replication user: <strong>repluser<\/strong><br \/>\n&#8211; replication password: <strong>Welcome1<\/strong><br \/>\n&#8211; MySQL root user: <strong>root<\/strong><br \/>\n&#8211; MySQL root pass: <strong>7layer<\/strong><br \/>\n&#8211; Do you want to clone a database? <strong>no<\/strong><\/p>\n<span id=\"_3\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_2-300x88.jpg\" alt=\"\" title=\"pfsense01_layer701_dbRepl_2\" width=\"300\" height=\"88\" class=\"aligncenter size-medium wp-image-8554\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_2-300x88.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_2.jpg 698w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* For layer702:<br \/>\n&#8211; hostname or IP for the MASTER: <strong>layer701.pfsense.local<\/strong><br \/>\n&#8211; replication user: <strong>repluser<\/strong><br \/>\n&#8211; replication password: <strong>Welcome1<\/strong><br \/>\n&#8211; MySQL root user: <strong>root<\/strong><br \/>\n&#8211; MySQL root pass: <strong>7layer<\/strong><br \/>\n&#8211; Do you want to clone a database? <strong>no<\/strong><\/p>\n<span id=\"_4\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_2-300x85.jpg\" alt=\"\" title=\"pfsense01_layer702_dbRepl_2\" width=\"300\" height=\"85\" class=\"aligncenter size-medium wp-image-8558\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_2-300x85.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_2.jpg 702w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Verify_replication_has_started\"><h4>Verify replication has started<\/h4><\/span>\n<pre lang=\"bash\">\r\nmysql\r\npager less\r\nshow slave status\\G\r\n<\/pre>\n<p>* For layer701:<\/p>\n<span id=\"_5\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_3_mysqlStatus.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_3_mysqlStatus-300x207.jpg\" alt=\"\" title=\"pfsense01_layer701_dbRepl_3_mysqlStatus\" width=\"300\" height=\"207\" class=\"aligncenter size-medium wp-image-8559\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_3_mysqlStatus-300x207.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_3_mysqlStatus.jpg 588w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"_6\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_4_mysqlStatus.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_4_mysqlStatus-254x300.jpg\" alt=\"\" title=\"pfsense01_layer701_dbRepl_4_mysqlStatus\" width=\"254\" height=\"300\" class=\"aligncenter size-medium wp-image-8560\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_4_mysqlStatus-254x300.jpg 254w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer701_dbRepl_4_mysqlStatus.jpg 347w\" sizes=\"auto, (max-width: 254px) 100vw, 254px\" \/><\/a><\/h6><\/span>\n<p>* Forlayer702:<\/p>\n<span id=\"_7\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_3_mysqlStatus.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_3_mysqlStatus-300x206.jpg\" alt=\"\" title=\"pfsense01_layer702_dbRepl_3_mysqlStatus\" width=\"300\" height=\"206\" class=\"aligncenter size-medium wp-image-8561\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_3_mysqlStatus-300x206.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_3_mysqlStatus.jpg 584w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"_8\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_4_mysqlStatus.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_4_mysqlStatus-300x211.jpg\" alt=\"\" title=\"pfsense01_layer702_dbRepl_4_mysqlStatus\" width=\"300\" height=\"211\" class=\"aligncenter size-medium wp-image-8562\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_4_mysqlStatus-300x211.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_layer702_dbRepl_4_mysqlStatus.jpg 597w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* If not, you can re-create replication process:<\/p>\n<pre lang=\"bash\">\r\n\/opt\/SecureSpan\/Appliance\/bin\/create_slave.sh\r\n<\/pre>\n<span id=\"Monitor_Replication_Failure\"><h3>Monitor Replication Failure<\/h3><\/span>\n<p>* Cluster properties for minitoring of replication delays or failures:<br \/>\n&#8211; <em>db.replicationDelayThreshold<\/em>: threshod before Gateway audits a warning for slow or failed replication. Defaults to 60 sec<br \/>\n&#8211; <em>db.replicationErrorAuditInterval<\/em>: minimum interval between db replication failure audits. Defaults to 60 min<br \/>\n* Replication events being audited:<br \/>\n&#8211; Replication failure<br \/>\n&#8211; Replication recovery<br \/>\n&#8211; Database failure<\/p>\n<span id=\"Restart_Replication\"><h3>Restart Replication<\/h3><\/span>\n<p>* Run against local db on each node:<\/p>\n<pre lang=\"bash\">\r\n\/opt\/SecureSpan\/Appliance\/bin\/restart_replication.sh\r\n<\/pre>\n<p>and enter:<br \/>\n&#8211; hostname or IP for the MASTER: # the other node<br \/>\n&#8211; replication user: <strong>repluser<\/strong><br \/>\n&#8211; replication password: <strong>Welcome1<\/strong><br \/>\n&#8211; MySQL root user: <strong>root<\/strong><br \/>\n&#8211; MySQL root password: <strong>7layer<\/strong><\/p>\n<span id=\"Configure_Nodes\"><h2>Configure Nodes<\/h2><\/span>\n<p>* Make sure db replication has been configured correctly!<br \/>\n* Reboot?<\/p>\n<span id=\"Configure_First_Node:_layer701\"><h3>Configure First Node: layer701<\/h3><\/span>\n<p>* Login first node as <strong>ssgconfig<\/strong><br \/>\n* Select option <strong>2 (Display Gateway configuration menu)<\/strong><br \/>\n* Select option <strong>2 (Create a new Gateway database)<\/strong><br \/>\n* Restart appliance<\/p>\n<span id=\"Configure_Additional_Node\"><h3>Configure Additional Node<\/h3><\/span>\n<span id=\"layer702\"><h4>layer702<\/h4><\/span>\n<p>* Login node as <strong>ssgconfig<\/strong><br \/>\n* Select option <strong>2 (Display Gateway configuration menu)<\/strong><br \/>\n* Select option <strong>3 (Configure the Gateway)<\/strong><br \/>\n&#8211; Database Host: enter hostname for db server 1: <strong>layer701.pfsense.local<\/strong><br \/>\n&#8211; Database Port [<strong>3306<\/strong>]:<br \/>\n&#8211; Database Name: use value for the first node: <strong>ssg<\/strong><br \/>\n&#8211; Database username and database password: use values for first node: <strong>gateway\/welcome1<\/strong><br \/>\n&#8211; Cluster password: use value for first node: <strong>welcome1<\/strong><br \/>\n* Ensure the node is enabled and then press [Enter] at the configuration summary.<br \/>\n* Restart appliance<\/p>\n<span id=\"Configure_Name_Resolution\"><h3>Configure Name Resolution<\/h3><\/span>\n<p>* It is expected that each node of the Gateway cluster can resolve the IP address of the cluster and all other nodes by DNS.<br \/>\n* If DNS is not configured to provide this, then each node must do so via the \u201c\/etc\/hosts\u201d file.<\/p>\n<span id=\"Start_Cluster\"><h3>Start Cluster<\/h3><\/span>\n<p>* Start primary node<br \/>\n* Start other nodes<\/p>\n<span id=\"Configure_a_CA_Key_for_the_Cluster\"><h3>Configure a CA Key for the Cluster<\/h3><\/span>\n<span id=\"Deactivating_a_Cluster_Node\"><h3>Deactivating a Cluster Node<\/h3><\/span>\n<span id=\"Configure_Layer_7_Nodes\"><h2>Configure Layer 7 Nodes<\/h2><\/span>\n<span id=\"Configure_Node_1\"><h3>Configure Node 1<\/h3><\/span>\n<p>IP: <strong>192.168.2.61<\/strong><br \/>\nNet mask: <strong>255.255.255.0<\/strong><br \/>\nGateway: <strong>192.168.2.1<\/strong><br \/>\nName server: <strong>192.168.2.1<\/strong><br \/>\nNTP server: <strong>pool.ntp.org<\/strong><\/p>\n<span id=\"Configure_Node_2\"><h3>Configure Node 2<\/h3><\/span>\n<p>IP: <strong>192.168.2.62<\/strong><br \/>\nNet mask: <strong>255.255.255.0<\/strong><br \/>\nGateway: <strong>192.168.2.1<\/strong><br \/>\nName server: <strong>192.168.2.1<\/strong><br \/>\nNTP server: <strong>pool.ntp.org<br \/>\n<\/strong><\/p>\n<span id=\"Configure_LB_with_pfSense\"><h2>Configure LB with pfSense<\/h2><\/span>\n<span id=\"Install_pfSense\"><h3>Install pfSense<\/h3><\/span>\n<p>* See <a href=\"?p=8518\">this post<\/a> to install pfSense.<\/p>\n<span id=\"Overview_1\"><h3>Overview<\/h3><\/span>\n<p>* IP addresses:<br \/>\n&#8211; Cluster IP: <strong>192.168.1.60<\/strong><br \/>\n&#8211; Node IP addresses: <strong>192.168.2.61, 192.168.2.62<\/strong><br \/>\n* Configure the virtual server<br \/>\n* Configure session persistence<br \/>\n&#8211; Ensure LB session timeout limit is set to 30 min<br \/>\n* Configure service availability determination<br \/>\n&#8211; Set check frequency to 120 sec<br \/>\n&#8211; Set response timeout to 120 sec<br \/>\n&#8211; For port 8080, set communication type to &#8220;Normal&#8221;<br \/>\n&#8211; For port 8443, set communication type to &#8220;SSL&#8221;<br \/>\n&#8211; Configure ports 8080 and 8443 to check the URL &#8220;\/ssg\/ping&#8221; (defaults to 8443 SSL with HTTP basic credentials in the request)<br \/>\n&#8211; An &#8220;OK&#8221; message for successful ping<br \/>\nNote: you need to set <em>pingServlet.mode<\/em> to <em>OPEN<\/em> from Layer 7 Policy Manager in order to get an <em>OK<\/em> message by hitting <em>\/ssg\/ping<\/em><\/p>\n<span id=\"Turn_on_Layer_7_pingServlet.mode\"><h3>Turn on Layer 7 pingServlet.mode<\/h3><\/span>\n<p>* Log in Layer 7 Policy Manager<br \/>\n* Go to <em>Tasks > Manage Clust-Wide Properties<\/em><br \/>\n* Set<br \/>\n&#8211; <em>pingServlet.mode<\/em> to <strong>OPEN<\/strong><\/p>\n<span id=\"Config_pfSense_Load_Balancer\"><h3>Config pfSense Load Balancer<\/h3><\/span>\n<p>* Log in pfSense web console<\/p>\n<span id=\"Add_Monitors\"><h4>Add Monitors<\/h4><\/span>\n<p>* Go to: <em>Services > Load Balancer > Monitors<\/em><br \/>\n* Add a new monitor:<br \/>\n&#8211; Name: <strong>Layer7Mon8080<\/strong><br \/>\n&#8211; Description: <strong>Layer 7 cluster monitor on port 8080.<\/strong><br \/>\n&#8211; Type: <strong>TCP<\/strong><\/p>\n<span id=\"_9\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8080.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8080-300x150.jpg\" alt=\"\" title=\"pfsense01_lb_monitor-8080\" width=\"300\" height=\"150\" class=\"aligncenter size-medium wp-image-8564\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8080-300x150.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8080.jpg 410w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Add another new monitor:<br \/>\n&#8211; Name: <strong>Layer7Mon8443<\/strong><br \/>\n&#8211; Description: <strong>Layer 7 cluster monitor on port 8443.<\/strong><br \/>\n&#8211; Type: <strong>TCP<\/strong><\/p>\n<span id=\"_10\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8443.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8443-300x154.jpg\" alt=\"\" title=\"pfsense01_lb_monitor-8443\" width=\"300\" height=\"154\" class=\"aligncenter size-medium wp-image-8565\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8443-300x154.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_monitor-8443.jpg 401w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Add_Pools\"><h4>Add Pools<\/h4><\/span>\n<p>* Go to: <em>Services > Load Balancer > Pools<\/em><br \/>\n* Add a new pool<br \/>\n&#8211; Name: <strong>Layer7Pool_8080<\/strong><br \/>\n&#8211; Mode: <em>Load Balance<\/em><br \/>\n&#8211; Port: <strong>8080<\/strong><br \/>\n&#8211; Monitor: <strong>Layer7Mon8080<\/strong><br \/>\n&#8211; Members: <strong>192.168.2.61, 192.168.2.62<\/strong><\/p>\n<span id=\"_11\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8080.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8080-207x300.jpg\" alt=\"\" title=\"pfsense01_lb_pool-8080\" width=\"207\" height=\"300\" class=\"aligncenter size-medium wp-image-8566\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8080-207x300.jpg 207w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8080.jpg 443w\" sizes=\"auto, (max-width: 207px) 100vw, 207px\" \/><\/a><\/h6><\/span>\n<p>* Add another pool<br \/>\n&#8211; Name: <strong>Layer7Pool_8443<\/strong><br \/>\n&#8211; Mode: <strong>Load Balance<\/strong><br \/>\n&#8211; Port: <strong>8443<\/strong><br \/>\n&#8211; Monitor: <em>Layer7Mon8080<\/em><br \/>\n&#8211; Members: <strong>192.168.2.61, 192.168.2.62<\/strong><\/p>\n<span id=\"_12\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8443.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8443-200x300.jpg\" alt=\"\" title=\"pfsense01_lb_pool-8443\" width=\"200\" height=\"300\" class=\"aligncenter size-medium wp-image-8567\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8443-200x300.jpg 200w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_pool-8443.jpg 440w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/h6><\/span>\n<span id=\"Add_Virtual_Monitors\"><h3>Add Virtual Monitors<\/h3><\/span>\n<p>* Go to: <em>Services > Load Balancer > Virtual Servers<\/em><br \/>\n* Add a new virtual server:<br \/>\n&#8211; Name: <strong>Layer7vs8080<\/strong><br \/>\n&#8211; Description: <strong>Layer 7 virtual srever on port 8080.<\/strong><br \/>\n&#8211; IP Address: <strong>192.168.1.60<\/strong> (This is the WAN public IP)<br \/>\n&#8211; Port: <strong>8080<\/strong><br \/>\n&#8211; Virtual Server Pool: <strong>Layer7Pool_8080<\/strong><\/p>\n<span id=\"_13\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8080.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8080-300x265.jpg\" alt=\"\" title=\"pfsense01_lb_virtualSvr-8080\" width=\"300\" height=\"265\" class=\"aligncenter size-medium wp-image-8568\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8080-300x265.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8080.jpg 423w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Add another virtual server for port 8443:<br \/>\n&#8211; Name: <strong>Layer7vs8443<\/strong><br \/>\n&#8211; Description: <strong>Layer 7 virtual srever on port 8443.<\/strong><br \/>\n&#8211; IP Address: <strong>192.168.1.60<\/strong> (This is the WAN public IP)<br \/>\n&#8211; Port: <strong>8443<\/strong><br \/>\n&#8211; Virtual Server Pool: <em>Layer7Pool_8443<\/em><\/p>\n<span id=\"_14\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8443.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8443-295x300.jpg\" alt=\"\" title=\"pfsense01_lb_virtualSvr-8443\" width=\"295\" height=\"300\" class=\"aligncenter size-medium wp-image-8569\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8443-295x300.jpg 295w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_virtualSvr-8443.jpg 407w\" sizes=\"auto, (max-width: 295px) 100vw, 295px\" \/><\/a><\/h6><\/span>\n<span id=\"Check_Load_Balancer_Status\"><h3>Check Load Balancer Status<\/h3><\/span>\n<p>* Login pfSense console<br \/>\n* Go to: <em>Status > Load Balancer<\/em><br \/>\n* Check all pools are green:<\/p>\n<span id=\"_15\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_pools.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_pools-300x143.jpg\" alt=\"\" title=\"pfsense01_lb_status_pools\" width=\"300\" height=\"143\" class=\"aligncenter size-medium wp-image-8570\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_pools-300x143.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_pools.jpg 502w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Check all virtual servers are green:<\/p>\n<span id=\"_16\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_virtualSvr.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_virtualSvr-300x140.jpg\" alt=\"\" title=\"pfsense01_lb_status_virtualSvr\" width=\"300\" height=\"140\" class=\"aligncenter size-medium wp-image-8571\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_virtualSvr-300x140.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_status_virtualSvr.jpg 407w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Open_WAN_Firewalls_for_Port_8080_and_8443\"><h3>Open WAN Firewalls for Port 8080 and 8443<\/h3><\/span>\n<p>* Go to <em>Firewall > Rules<\/em><br \/>\n* Open port 8080:<\/p>\n<span id=\"_17\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan_8080.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan_8080-199x300.jpg\" alt=\"\" title=\"pfsense01_lb_rules_wan_8080\" width=\"199\" height=\"300\" class=\"aligncenter size-medium wp-image-8572\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan_8080-199x300.jpg 199w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan_8080.jpg 547w\" sizes=\"auto, (max-width: 199px) 100vw, 199px\" \/><\/a><\/h6><\/span>\n<p>* Do the same to open port 8443:<\/p>\n<span id=\"_18\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan-300x54.jpg\" alt=\"\" title=\"pfsense01_lb_rules_wan\" width=\"300\" height=\"54\" class=\"aligncenter size-medium wp-image-8573\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan-300x54.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_wan.jpg 535w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Open_LAN_Firewalls_for_both_Port_8080_and_8443\"><h3>Open LAN Firewalls for both Port 8080 and 8443<\/h3><\/span>\n<span id=\"_19\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan_8080.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan_8080-167x300.jpg\" alt=\"\" title=\"pfsense01_lb_rules_lan_8080\" width=\"167\" height=\"300\" class=\"aligncenter size-medium wp-image-8574\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan_8080-167x300.jpg 167w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan_8080.jpg 458w\" sizes=\"auto, (max-width: 167px) 100vw, 167px\" \/><\/a><\/h6><\/span>\n<span id=\"_20\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan-300x55.jpg\" alt=\"\" title=\"pfsense01_lb_rules_lan\" width=\"300\" height=\"55\" class=\"aligncenter size-medium wp-image-8575\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan-300x55.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_rules_lan.jpg 516w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Check_that_Load_Balancer_is_Listening_on_both_Port_8080_and_8443\"><h3>Check that Load Balancer is Listening on both Port 8080 and 8443<\/h3><\/span>\n<pre lang=\"bash\">\r\ntelnet 192.168.1.60 8080\r\ntelnet 192.168.1.60 8443\r\n<\/pre>\n<span id=\"Point_Layer_7_Policy_Manager_to_Load_Balance_IP\"><h3>Point Layer 7 Policy Manager to Load Balance IP<\/h3><\/span>\n<span id=\"_21\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_policyMgr_login.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_policyMgr_login-300x282.jpg\" alt=\"\" title=\"pfsense01_lb_policyMgr_login\" width=\"300\" height=\"282\" class=\"aligncenter size-medium wp-image-8576\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_policyMgr_login-300x282.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2013\/08\/pfsense01_lb_policyMgr_login.jpg 351w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n","protected":false},"excerpt":{"rendered":"<p>Overview * Gateway cluster nodes share: &#8211; service policies &#8211; identity providers &#8211; configuration settings Architecture System Requirements * Load Balancer device to provide TCP-level load balancing and failover * Each node must possess its own host name, IP, and &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=8514\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[229],"tags":[630,426,424],"class_list":["post-8514","post","type-post","status-publish","format-standard","hentry","category-firewall","tag-layer7","tag-loadbalancer","tag-pfsense"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-2dk","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/8514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8514"}],"version-history":[{"count":14,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/8514\/revisions"}],"predecessor-version":[{"id":9853,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/8514\/revisions\/9853"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}