10.3.1. Example of firewall / load balancer configuration on web site publication (two-arm)¶
Operation Confirmed Version: | |
---|---|
Brocade 5600vRouter Version4.2R1S1 | |
Operation Confirmed Version: | |
Citrix Netscaler VPX Version11.0 Build67.12 Standard Edition |
10.3.1.1. Prerequisites¶
Firewall
We will use two VRRP redundant configurations. We will build VRRP on all segments.
The FW rule rejects all basic from the external segment and allows only specific HTTP / HTTPS access. All trusted segments are allowed.
From the external segment, let's access the global IP of FW, not IP of LB's virtual server, and convert the destination to IP of virtual server by NAT translation.
Load Balancer
We will use two VRRP redundant configurations. Configure VRRP on the FW segment.
We set up a virtual server for HTTP / HTTPS and distribute communication round robin to two WEB servers. HTTPS performs SSL offloading.
ECL 2.0 load balancer (NetScaler VPX) has one VRRP setting (pair of virtual IP address and VRRP group ID) that can be registered for one interface. Therefore, it is not possible to register multiple VRRP groups. As an alternative, it is possible to make multiple VIPs redundant by registering a virtual IP address in a segment different from the virtual IP registered for VRRP and setting it as the sorting target IP address. This configuration uses redundant configuration using this method.
Image of setting concept
System diagram¶
Note
"Windows Server 2012R2" is used as OS of Client/Server.
"CentOS 7.1.1503" is used as Server OS.
"Apache 2.2.32" is used as Web server.
Configuration of Firewall¶
Firewall Interface setting
Note
Interface settings can not be set except by customer portal.
- FW-01
set interfaces dataplane dp0s4 address '1.X.X.253/24'
set interfaces dataplane dp0s5 address '192.168.0.253/24'
set interfaces dataplane dp0s6 address '192.168.10.253/24'
- FW-02
set interfaces dataplane dp0s4 address '1.X.X.252/24'
set interfaces dataplane dp0s5 address '192.168.0.252/24'
set interfaces dataplane dp0s6 address '192.168.10.252/24'
VRRP Setting
- FW-01
set interfaces dataplane dp0s4 vrrp vrrp-group 10 advertise-interval '20'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 preempt 'true'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 priority '150'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 'rfc-compatibility'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 sync-group 'test'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 virtual-address '1.X.X.254'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 advertise-interval '20'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 preempt 'true'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 priority '150'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 'rfc-compatibility'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 sync-group 'test'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 virtual-address '192.168.0.254'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 advertise-interval '20'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 preempt 'true'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 priority '150'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 'rfc-compatibility'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 sync-group 'test'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 virtual-address '192.168.10.254'
- FW-02
set interfaces dataplane dp0s4 vrrp vrrp-group 10 advertise-interval '20'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 preempt 'true'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 priority '20'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 'rfc-compatibility'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 sync-group 'test'
set interfaces dataplane dp0s4 vrrp vrrp-group 10 virtual-address '1.X.X.254'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 advertise-interval '20'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 preempt 'true'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 priority '20'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 'rfc-compatibility'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 sync-group 'test'
set interfaces dataplane dp0s5 vrrp vrrp-group 20 virtual-address '192.168.0.254'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 advertise-interval '20'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 preempt 'true'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 priority '20'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 'rfc-compatibility'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 sync-group 'test'
set interfaces dataplane dp0s6 vrrp vrrp-group 30 virtual-address '192.168.10.254'
Note
Asymmetric communication is not supported in this configuration. When using VRRP with multiple interfaces, synchronize the switching of VRRP by sync-group setting.
The VRRP advertise interval was recommended to be 20 seconds or longer because VRRP communication was rarely unstable on the base side in the initial setting (as of December 2016). Please design according to your system configuration (as of August 2017). (When a hello packet is not received three times in succession, a disconnection is detected). If you want to change this setting, change it from the firewall on the Backup side. When changing from the Master side, the Hello packet transmission interval to the Backup side changes, so the Backup side is also promoted to Master and both devices may become Master.
Resource group setting
FW-01/02 Common
set resources group port-group HTTP-HTTPS port '80'
set resources group port-group HTTP-HTTPS port '443'
FW rule settings
FW-01/02 Common
set security firewall global-state-policy 'icmp'
set security firewall global-state-policy 'tcp'
set security firewall global-state-policy 'udp'
- FW-01
set security firewall name Untrust-to-HTTP default-action 'drop'
set security firewall name Untrust-to-HTTP rule 1 action 'accept'
set security firewall name Untrust-to-HTTP rule 1 source address '1.X.X.252'
set security firewall name Untrust-to-HTTP rule 10 action 'accept'
set security firewall name Untrust-to-HTTP rule 10 destination address '1.X.X.254'
set security firewall name Untrust-to-HTTP rule 10 destination port 'HTTP-HTTPS'
set security firewall name Untrust-to-HTTP rule 10 protocol 'tcp'
set security firewall name all_accept default-action 'accept'
- FW-02
set security firewall name Untrust-to-HTTP default-action 'drop'
set security firewall name Untrust-to-HTTP rule 1 action 'accept'
set security firewall name Untrust-to-HTTP rule 1 source address '1.X.X.253'
set security firewall name Untrust-to-HTTP rule 10 action 'accept'
set security firewall name Untrust-to-HTTP rule 10 destination address '1.X.X.254'
set security firewall name Untrust-to-HTTP rule 10 destination port 'HTTP-HTTPS'
set security firewall name Untrust-to-HTTP rule 10 protocol 'tcp'
set security firewall name all_accept default-action 'accept'
FW-01/02 Common
set interfaces dataplane dp0s4 firewall in 'Untrust-to-HTTP'
set interfaces dataplane dp0s6 firewall out 'all_accept'
FW-01/02 Common
set service nat destination rule 10 destination address '1.X.X.254'
set service nat destination rule 10 destination port '80'
set service nat destination rule 10 inbound-interface 'dp0s4'
set service nat destination rule 10 protocol 'tcp'
set service nat destination rule 10 translation address '172.16.100.100'
set service nat destination rule 11 destination address '1.X.X.254'
set service nat destination rule 11 destination port '443'
set service nat destination rule 11 inbound-interface 'dp0s4'
set service nat destination rule 11 protocol 'tcp'
set service nat destination rule 11 translation address '172.16.100.200'
set service nat destination rule 11 translation port '443'
set protocols static route 172.16.100.0/24 next-hop '192.168.10.251'
Confirmation of setting contents
- FW-01
user-admin@FW-01# show interfaces
interfaces {
dataplane dp0s4 {
address 1.X.X.253/24
firewall {
in Untrust-to-HTTP
}
vrrp {
vrrp-group 10 {
advertise-interval 20
preempt true
priority 150
rfc-compatibility
sync-group test
virtual-address 1.X.X.254
}
}
}
dataplane dp0s5 {
address 192.168.0.253/24
vrrp {
vrrp-group 20 {
advertise-interval 20
preempt true
priority 150
rfc-compatibility
sync-group test
virtual-address 192.168.0.254
}
}
}
dataplane dp0s6 {
address 192.168.10.253/24
firewall {
out all_accept
}
vrrp {
vrrp-group 30 {
advertise-interval 20
preempt true
priority 150
rfc-compatibility
sync-group test
virtual-address 192.168.10.254
}
}
}
loopback lo
}
user-admin@FW-01# show resources
resources {
group {
port-group HTTP-HTTPS {
port 80
port 443
}
}
}
user-admin@FW-01# show security firewall
firewall {
global-state-policy {
icmp
tcp
udp
}
name Untrust-to-HTTP {
default-action drop
rule 1 {
action accept
source {
address 1.X.X.252
}
}
rule 10 {
action accept
destination {
address 1.X.X.254
port HTTP-HTTPS
}
protocol tcp
}
}
name all_accept {
default-action accept
}
}
user-admin@FW-01# show service nat destination
destination {
rule 10 {
destination {
address 1.X.X.254
port 80
}
inbound-interface dp0s4
protocol tcp
translation {
address 172.16.100.100
}
}
rule 11 {
destination {
address 1.X.X.254
port 443
}
inbound-interface dp0s4
protocol tcp
translation {
address 172.16.100.200
port 443
}
}
}
user-admin@FW-01# show protocols static
static {
route 172.16.100.0/24 {
next-hop 192.168.10.251
}
}
- FW-02
user-admin@FW-02# show interfaces
interfaces {
dataplane dp0s4 {
address 1.X.X.252/24
firewall {
in Untrust-to-HTTP
}
vrrp {
vrrp-group 10 {
advertise-interval 20
preempt true
priority 20
rfc-compatibility
sync-group test
virtual-address 1.X.X.254
}
}
}
dataplane dp0s5 {
address 192.168.0.252/24
vrrp {
vrrp-group 20 {
advertise-interval 20
preempt true
priority 20
rfc-compatibility
sync-group test
virtual-address 192.168.0.254
}
}
}
dataplane dp0s6 {
address 192.168.10.252/24
firewall {
out all_accept
}
vrrp {
vrrp-group 30 {
advertise-interval 20
preempt true
priority 20
rfc-compatibility
sync-group test
virtual-address 192.168.10.254
}
}
}
loopback lo
}
user-admin@FW-02# show resources
resources {
group {
port-group HTTP-HTTPS {
port 80
port 443
}
}
}
user-admin@FW-02# show security firewall
firewall {
global-state-policy {
icmp
tcp
udp
}
name Untrust-to-HTTP {
default-action drop
rule 1 {
action accept
source {
address 1.X.X.253
}
}
rule 10 {
action accept
destination {
address 1.X.X.254
port HTTP-HTTPS
}
protocol tcp
}
}
name all_accept {
default-action accept
}
}
user-admin@FW-02# show service nat destination
destination {
rule 10 {
destination {
address 1.X.X.254
port 80
}
inbound-interface dp0s4
protocol tcp
translation {
address 172.16.100.100
}
}
rule 11 {
destination {
address 1.X.X.254
port 443
}
inbound-interface dp0s4
protocol tcp
translation {
address 172.16.100.200
port 443
}
}
}
user-admin@FW-02# show protocols static
static {
route 172.16.100.0/24 {
next-hop 192.168.10.251
}
}
Load Balancer setting¶
Load balancer interface setting
Note
Interface settings can not be set except by customer portal.
Setting Items |
Setting Parameter (LB 01) |
Setting Parameter (LB 02) |
Interface 1/1 | 192.168.10.250/24 | 192.168.10.249/24 |
Interface 1/2 | 172.16.10.250/24 | 172.16.10.249/24 |
Configuration Check
- LB01
- LB02
VRRP settings(Interface 1/1)
Setting Items |
Setting Parameter (LB 01) |
Setting Parameter (LB 02) |
VRID | 40 | 40 |
Priority value |
200 | 100 |
Preemption | Check |
Check |
Setting Items |
Setting Parameter (LB 01) |
Setting Parameter (LB 02) |
VirtualIP | 192.168.10.251/24 | 192.168.10.251/24 |
Netmask | 255.255.255.0 | 255.255.255.0 |
IP Type | Virtual IP | Virtual IP |
Virtual Router ID | 40 | 40 |
Traffic Domain | 10 | 10 |
Configuration Check(Virtual IP)
- LB01
- LB02
Configuration Check(VRRP)
- LB01
- LB02
Rooting Settings
Setting Items |
Setting Parameter (LB 01) |
Setting Parameter (LB 02) |
Destination |
0.0.0.0 | 0.0.0.0 |
Subnet mask |
0.0.0.0 | 0.0.0.0 |
Gateway address |
192.168.10.254 | 192.168.10.254 |
Traffic Domain | 10 | 10 |
Note
The default gateway setting cannot be set except for the customer portal.
Configuration Check
LB01 LB02 Common Configuration Items
Virtual Web Server Registration
Setting Items |
Setting Parameter (LB 01, LB02 common) |
Setting Parameter (LB 01, LB02 common) |
Name | Web-server-01 | Web-server-02 |
IPAddress | 172.16.10.11/24 | 172.16.10.12/24 |
Traffic Domain | 10 | 10 |
Configuration Check
LB01 LB02 Common Configuration Items
Service group setting
Setting Items |
Setting Parameter (LB 01) |
Setting Parameter (LB 02) |
Service Name | HTTP | HTTP |
EXisting Server | Web-server-01(172.16.10.11)
Web-server-02(172.16.10.12)
|
Web-server-01(172.16.10.11)
Web-server-02(172.16.10.12)
|
Protocol | HTTP | HTTP |
Port | 80 | 80 |
Monitors | http | http |
Traffic Domain | 10 | 10 |
Configuration Check
LB01 LB02 Common Configuration Items
Note
The IP address of the client is SNAT converted to the load balancer IP address when balancing is done. This setting is enabled by default.
If you want to notify the web server of the client's IP address, please use `X-Forwarded-For function. This setting is disabled by default.
Virtual Server setting
Setting Items |
Setting Parameter (LB 01) |
Setting Parameter (LB 02) |
Name | http-vserver | http-vserver |
Protocol | HTTP | HTTP |
IP Address Type | IP Address | IP Address |
IP Address | 172.16.100.100 | 172.16.100.100 |
Port | 80 | 80 |
Traffic Domain | 10 | 10 |
Configuration Check
LB01 LB02 Common Configuration Items
Setting Items |
Setting Parameter (LB 01) |
Setting Parameter (LB 02) |
Name | ssl-vserver | ssl-vserver |
Protocol | SSL | SSL |
IP Address Type | IP Address | IP Address |
IP Address | 172.16.100.200 | 172.16.100.200 |
Port | 443 | 443 |
Server Certificate | ia-example.jp | ia-example.jp |
CA Certificate | example.jp | example.jp |
Traffic Domain | 10 | 10 |
Note
Please use SSL server certificate issued by certificate authority.
Please refer to How to register a certificate and SSL offload setting .
Configuration Check
LB01 LB02 Common Configuration Items
Flow of traffic¶
Status check at normal state
VRRP status
user-admin@FW-01:~$ show vrrp
RFC Addr Last Sync
Interface Group State Compliant Owner Transition Group
--------- ----- ----- --------- ----- ---------- -----
dp0s4 10 MASTER dp0vrrp1 no 1h30m26s test
dp0s5 20 MASTER dp0vrrp2 no 1h30m26s test
dp0s6 30 MASTER dp0vrrp3 no 1h30m26s test
user-admin@FW-02:~$ show vrrp
RFC Addr Last Sync
Interface Group State Compliant Owner Transition Group
--------- ----- ----- --------- ----- ---------- -----
dp0s4 10 BACKUP dp0vrrp2 no 1h59m15s test
dp0s5 20 BACKUP dp0vrrp3 no 1h59m15s test
dp0s6 30 BACKUP dp0vrrp1 no 1h59m15s test
VRRP status
Virtual Server status
Client Connection check
HTTP / HTTPS access (accessed twice each) [OK]
HTTP / HTTPS access (accessed twice each) [OK]
Flow of communication when a firewall failure occurs¶
Note
Check Status When a Failure Occurs
VRRP status
user-admin@FW-01:~$ show vrrp
RFC Addr Last Sync
Interface Group State Compliant Owner Transition Group
--------- ----- ----- --------- ----- ---------- -----
Note
The status is not displayed since VRRP of FW-01 is stopped.
user-admin@FW-02:~$ show vrrp
RFC Addr Last Sync
Interface Group State Compliant Owner Transition Group
--------- ----- ----- --------- ----- ---------- -----
dp0s4 10 MASTER dp0vrrp2 no 5m4s test
dp0s5 20 MASTER dp0vrrp3 no 5m4s test
dp0s6 30 MASTER dp0vrrp1 no 4m30s test
Note
The way to check status of loadbalancer is same as normal.
Client Connection check
HTTP / HTTPS access (accessed twice each) [OK]
HTTP / HTTPS access (accessed twice each) [OK]
This completes the confirmation at firewall failure.
Flow of traffic when a load balancer failure occurs¶
Note
Disable all of Virtual IP, and delete VMAC configuration.
Restarting the instance (If Preemption is enabled, a revert will occur according to Priority)
Check Status When a Failure Occurs
VRRP status
Virtual Server status
Client Connection check
HTTP / HTTPS access (accessed twice each) [OK]
HTTP / HTTPS access (accessed twice each) [OK]