The High-Availability Front End (HFE) node is a public-facing node that allows sub-second switchover between Active and Standby SBC instances of an HA pair, as it negates the need for any IP reassignment.
GCP requires each interface of a instance in a separate Virtual Private Network (VPC). Create a minimum of six VPCs for a full HFE set up (assuming all management interfaces for the SBC and the HFE node are in the same VPC).
HFE 2.0 is an environment that uses a single HFE node with 5 interfaces. All trusted and untrusted traffic use the same node. Each interface's function is described in the following table:
Interfaces for HFE 2.0 Configuration
| | | Requires External IP? |
---|
eth0 / ens4 | nic0 | Public Interface for SBC PKT0 | Yes |
eth1 / ens5 | nic1 | Private interface in for SBC PKT1; only instances in the same subnet can connect. | No |
eth2 / ens6 | nic2 | Management interface to HFE. | Optional |
eth3 / ens7 | nic3 | Interface to SBC PKT0; ensure it is in the same VPC and the subnet as SBC pkt0. | No |
eth4 / ens8 | nic4 | Interface to SBC PKT1; ensure it is in the same VPC and the subnet as SBC pkt1. | No |
HFE 2.1 has two HFE nodes, each responsible for a different type of traffic:
- Untrusted public traffic to the SBC (for PKT0). In this document, such a HFE node is referred to as "PKT0 HFE node".
- Trusted traffic from the SBC to other trusted networks (from PKT1). In this document, such a HFE node is referred to as the "PKT1 HFE node".
Both HFE nodes require three interfaces, as follows:
Interfaces for HFE 2.1 Configuration
| | | PKT1 HFE node Function | Requires External IP? |
---|
eth0 / ens4 | nic0 | Public Interface for SBC PKT0 | Private interface in for SBC PKT1; only instances in the same subnet can connect. | Yes (only on PKT0 HFE node) |
eth1 / ens5 | nic1 | Management interface to HFE. | Management interface to HFE. | Optional |
eth2 / ens6 | nic2 | Interface to SBC PKT0; ensure that the interface is in the same VPC and subnet as SBC pkt0. | Interface to SBC PKT1; ensure that the interface is in the same VPC and subnet as SBC pkt1. | No |
For HFE nodes, Ribbon supports the following operating systems:
- Ubuntu 18.04 LTS, 19.xx
- Debian 9/10
- CentOS 8
- Red Hat Enterprise Linux 8
Ensure that the following are configured before creating the HFE node:
This section describes the manual creation of HFE nodes.
- Navigate to Compute Engine > VM instances.
- Click CREATE INSTANCE.
- Select Name, Region, and Zone.
- Select Machine Configuration:
- General-purpose
- Series - N1
- Machine type:
HFE 2.0 - Basic Configuration
- To configure the OS, select Boot Disk - Change:
- Select a supported OS (for example, Ubuntu 19.04).
Set the Size as 10 (GB).
- In Identity and API access - Service account, select the Service account created earlier.
- In the Security tab, update the SSH Keys as to include:
- SSH Key for user: Insert
ssh-rsa ... <user-name>
. Check Block project-wide SSH keys.
- Update the Metadata to include the startup script for the HFE. For HFE 2.0, a copy of the startup script is available in GCE - HFE 2.0 Startup Script, with appropriate values for the following variables:
- HFE_SCRIPT_LOCATION - The location of the HFE script stored in Google storage. For more information, refer to Create a Bucket in Google Cloud Storage for HFE Script Upload.
- ACTIVE_SBC_NAME - Instance name of the Active SBC.
- STANDBY_SBC_NAME - Instance name of the Standby SBC.
- REMOTE_SSH_MACHINE_IP - The IP address of the remote machine to SSH from on the Management Interface. You can provide multiple IP addresses as a comma separated list. For example, 10.0.0.1,10.0.0.2,10.0.0.3.
- ZONE - The Zone in which the SBCs are configured.
- Update the Network Interfaces on the HFE by selecting the Networking tab.
- Update the Network interfaces by configuring the five interfaces described in HFE 2.0 Network Set-up:
- Add Network interface for the Public Interface to receive traffic for SBC PKT0:
- Select the VPC created for the HFE 'Public' facing for PKT0 traffic.
- Select the Subnet created for the HFE 'Public' facing for PKT0 traffic.
- Set the Primary internal IP as
Ephemeral (Automatic)
. - Set the External IP as one of the static External IPs created earlier.
Set IP forwarding to On
.
HFE 2.0 - Public Interface - Network Interface - PKT0
- Add Network interface for Private interface to receive traffic for SBC PKT1:
- Select the VPC created for the HFE 'Private' facing for PKT1 traffic.
- Select the Subnet created for the HFE 'Private' facing for PKT1 traffic.
- Set the Primary internal IP as
Ephemeral (Automatic)
. Set External IP as None
.
HFE 2.0 - Private Interface - Network Interface - PKT1
- Add Network interface for Management interface to HFE:
- Select the VPC created for SBC MGT0.
- Select Subnet which was created for SBC MGT0.
- Set the Primary internal IP as
Ephemeral (Automatic)
. If using external IP, set the External IP as Ephemeral (Automatic)
.
HFE 2.0 - Management Interface - Network Interface - MGT0
- Add Network interface for Interface to communicate with SBC PKT0:
- Select the VPC created for SBC PKT0.
- Select the Subnet created for SBC PKT0.
- Set the Primary internal IP as
Ephemeral (Automatic)
. Set the External IP as None
.
HFE 2.0 - Network Interface - PKT0
- Add Network interface for Interface to communicate with SBC PKT1:
- Select the VPC created for SBC PKT1.
- Select the Subnet created for SBC PKT1.
- Set the Primary internal IP as
Ephemeral (Automatic)
. Set the External IP as None
.
HFE 2.0 - Network Interface - PKT1
- Click CREATE.
- Navigate to Compute Engine > VM instances.
- Click CREATE INSTANCE.
- Select Name, Region, and Zone.
- Select Machine Type:
- General-purpose
- Series - N1
n1-standard-4
HFE 2.1 - Basic Configuration
- To configure the OS, select Boot Disk - Change:
- Select a supported OS (for example, Ubuntu 19.04).
Set the Size as 10 (GB).
- In Identity and API access - Service account, select the Service account created earlier.
- In the Security tab, update the SSH Keys as to include:
- SSH Key for user: Insert
ssh-rsa ... <user-name>
. Check Block project-wide SSH keys.
- Update the Metadata to include the startup script for the HFE. For HFE 2.1, a copy of the startup script is available in GCE - HFE 2.1 Startup Script, with appropriate values for the following variables:
- HFE_SCRIPT_LOCATION - The location of the HFE script stored in Google storage. For more information, refer to Create a Bucket in Google Cloud Storage for HFE Script Upload.
- ACTIVE_SBC_NAME - Instance name of the Active SBC.
- STANDBY_SBC_NAME - Instance name of the Standby SBC.
- REMOTE_SSH_MACHINE_IP - The IP address of the remote machine to SSH from on the Management Interface. You can provide multiple IP addresses as a comma separated list. For example, 10.0.0.1,10.0.0.2,10.0.0.3.
- ZONE - The Zone in which the SBCs are configured.
- SBC_PKT_PORT_NAME - This tells the HFE if it is handling traffic for PKT0 or PKT1. The accepted values are PKT0 and PKT1. Use this variable only for HFE 2.1; remove for HFE 2.0.
- Update the Network Interfaces on the HFE by selecting the Networking tab.
- Update the Network interfaces by configuring the three interfaces described in HFE 2.1 Network Set-up:
- For HFE PKT0 node, add Network interface for the Public Interface to receive traffic for SBC PKT0:
- Select the VPC created for the HFE 'Public' facing for PKT0 traffic.
- Select the Subnet created for the HFE 'Public' facing for PKT0 traffic.
- Set the Primary internal IP as
Ephemeral (Automatic)
. - Set the External IP as one of the static External IPs created earlier.
Set IP forwarding to On
.
HFE 2.1 - HFE PKT0 Node - Public Interface - Network Interface - PKT0
- For HFE PKT1 node, add Network interface for Private interface to receive traffic for SBC PKT1:
- Select the VPC created for the HFE 'Private' facing for PKT1 traffic.
- Select the Subnet created for the HFE 'Private' facing for PKT1 traffic.
- Set the Primary internal IP as
Ephemeral (Automatic)
. - Set External IP as
None
. Set IP forwarding to On
.
HFE 2.1 - HFE PKT1 Node - Private Interface - Network Interface - PKT1
- Add Network interface for Management interface to HFE:
- Select the VPC created for SBC MGT0.
- Select Subnet which was created for SBC MGT0.
- Set the Primary internal IP as
Ephemeral (Automatic)
. Set the External IP as Ephemeral (Automatic)
.
HFE 2.1 - Management Interface - Network Interface - MGT0
- For PKT0 HFE node, add Network interface for Interface to communicate with SBC PKT0
- Select the VPC created for SBC PKT0.
- Select the Subnet created for SBC PKT0.
- Set the Primary internal IP as
Ephemeral (Automatic)
. Set the External IP as None
.
HFE 2.1 - HFE PKT0 Node - Network Interface - PKT0
- For PKT1 HFE node, add Network interface for Interface to communicate with SBC PKT1
- Select the VPC created for SBC PKT1.
- Select the Subnet created for SBC PKT1.
- Set the Primary internal IP as
Ephemeral (Automatic)
. Set the External IP as None
.
HFE 2.1 - HFE PKT1 Node - Network Interface - PKT1
- Click CREATE.
Warning
As the the SBCs are not yet configured, errors are logged in the file HFE.log. After the HFE node instance is created, stop the instance from running until the SBCs are created and configured.
Warning
The HFE_GCE.sh
script fails and SSH to mgmt interface does not work until the SBCs are created (due to the inability to read the information from the SBC); the HFE node is accessed via NIC0.
Below is an example of the with complete user-data. Use it to fill the Metadata while creating a node.
#!/bin/bash
HFE_DIR="/opt/HFE"
HFE_LOG_DIR="$HFE_DIR/log"
HFE_FILE="$HFE_DIR/HFE_GCE.sh"
LOG_FILE="$HFE_LOG_DIR/cloud-init-nat.log"
NAT_VAR="$HFE_DIR/natVars.input"
timestamp()
{
date +"%Y-%m-%d %T"
}
if [ ! -d $HFE_LOG_DIR ]; then
mkdir -p $HFE_LOG_DIR;
fi;
/bin/echo
$(timestamp) " ========================= cloud-init configuration
for HFE ==========================================" >>
$LOG_FILE
if [ $(grep -c 169.254.169.254 /etc/resolv.conf) -eq 0 ]; then
sed -i.orig '/^nameserver.*/i nameserver 169.254.169.254' /etc/resolv.conf
fi
gsutil cp gs://rbbn-hfe-script/HFE_GCE.sh $HFE_FILE
if [ $? -ne 0 ]; then
/bin/echo $(timestamp) "Error:Could not copy HFE script from Google Storage." >> $LOG_FILE
else
/bin/echo $(timestamp) "Copied HFE script from Google Storage." >> $LOG_FILE
fi;
/bin/echo > $NAT_VAR
/bin/echo "ACTIVE_SBC_VM_NAME=\"rbbn-hfe-split-sbc1\"" >> $NAT_VAR
/bin/echo "STANDBY_SBC_VM_NAME=\"rbbn-hfe-split-sbc2\"" >> $NAT_VAR
/bin/echo "REMOTE_SSH_MACHINE_IP=\"92.41.249.151\"">> $NAT_VAR
/bin/echo "ZONE=\"europe-west2-c\"">> $NAT_VAR
/bin/echo "SBC_PKT_PORT_NAME=\"PKT0\"" >> $NAT_VAR
/bin/echo $(timestamp) "Copied natVars.input" >> $LOG_FILE
sudo chmod 744 $HFE_FILE
/bin/echo "Configured using HFE script - $HFE_FILE" >> $LOG_FILE
/bin/echo $(timestamp) " ========================= Done ==========================================" >> $LOG_FILE
nohup $HFE_FILE setup > /dev/null 2>&1 &
To use the HFE, add specific extra rules at the Google Network level. Ensure that routes and firewall rules are configured on the VPC networks containing the subnets in which PKT0 and PKT1 interfaces on the SBC are located.
Create routes to send the traffic from PKT0 and PKT1 interfaces return through the HFE:
- Go to VPC Networks.
- Click on the VPC used for the PKT0 interface, and click Routes.
- Click Add route:
- Provide a Name.
- Set Destination IP range to 0.0.0.0/0.
- Set Priority to anything under 1000 (The priority value for the default routes created).
Set an Instance tag. This is used to specify which instances use this rule.
- Set the Next Hop using one of the following options:
Specify an instance - Use an instance already created with an interface in this VPC. However, if the instance is deleted and another is created with the same name, traffic is routed to the new instance.
Specify an IP address - Specify the private IP address of nic3 / nic4 (for the VPCs of PKT0 and PKT1 respectively) interface on the HFE.
- Repeat for the VPC used for the SBC PKT1 interface.
By default, the Google network drops all packets unless firewall rules are configured. Ensure that rules are set for the VPCs to allow traffic from specific locations to reach the instances.
- Go to VPC networks.
- Click on the VPCs used for the PKT0 port on the SBCs, and click Firewall Rules.
- There are two types of firewall required for using the HFE:
- An ingress and egress rule to allow all traffic (protocol and port) types from the source IP(s) of the traffic.
- Set Targets to "All instances in the network".
- The Source filter should be "IP ranges".
- Set Source IP ranges as the source IPs for the traffic.
Set Protocols and ports as "Allow all".
- An ingress and egress rule to allow all traffic from within the subnet to communicate (default):
- Set Targets to "All instances in the network".
- The Source filter should be "IP ranges".
- Set Source IP ranges as the "subnet CIDR".
- Set Protocols and ports as "Allow all".
Repeat for the VPC used for the SBC PKT1 interface.
The HFE generates the following logs under /opt/HFE/log/
:
- cloud-init-nat.log: Logs generated from the commands in the user-data script.
- HFE_conf.log: Logs generated from the set up of the HFE node. They contain information about:
- SBC instance names
- IPs for allowing SSH access of the HFE node
- The configured zone
- SBC IPs used to forward traffic
- IP Tables rules
- Routing rules
- HFE_conf.log.prev: A copy of the previous
HFE_conf.log
. - HFE.log:
- Logs containing messages about any switchover action and connection errors. The logs generated are as follows:
- Connection error detected to Active SBC: <<IP>>. Attempting switchover.
- Lost connection to the SBC. HFE node performs switchover action .
- Connection error ongoing - No connection to SBC PKT ports from HFE
- This error means that the HFE node attempted a switchover, but no connection is established with new SBC.
- The HFE node then continually switches between the SBCs until a connection is established.
- This usually means there is a network issue or a configuration issue on the SBCs.
- Switchover from old Active <<Old Active SBC IP>> to new Active <<New Active SBC IP>> complete. Connection established.
- The switchover action is complete and connection is established to the Active SBC.
- This log is rotated when it reaches 250 MB.
- A maximum of four previous logs are saved.
- The previous logs are compressed to save disk space.
Ribbon tested the following upgrade scenarios on the HFE node, using ICMP packets to contact the PKT0/PKT1 ports on the SBC:
Create a cloud NAT gateway for the VPC used by nic0 on the PKT1 HFE node. This allows the PKT1 HFE node to access the Google servers to retrieve the script and query instance information, and also prevents the instance from getting exposed to the outer world.
To create a cloud NAT gateway, perform the following steps:
- In the GCP Console, navigate to Networking > Network services > Cloud NAT.
- Click CREATE NAT GATEWAY.
- Enter a Gateway name.
- Select the VPC.
- Select the Region
- For Cloud Router, select Create New Router.
- Enter Name.
- Optionally, enter a Description.
Click Create.
- Retain the default NAT mapping.
Click Create.