In this section:
For reference, a copy of the script HFE_GCE.sh
is available here.
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
Standard/Ubuntu Interface Name | NIC | Function | 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 |
To use a HFE 2.0 environment, the startup-script for the SBCs requires the field HfeInstanceName
. For more information, refer to the table in the section "User Data" of the page Configure SBCs in GCP.
HFE 2.1 has two HFE nodes, each responsible for a different type of traffic:
Both HFE nodes require three interfaces, as follows:
Interfaces for HFE 2.1 Configuration
Standard/Ubuntu Interface Name | NIC | PKT0 HFE node Function | 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 |
To use a HFE 2.1 environment, the startup-script for the SBCs requires the fields Pkt0HfeInstanceName
and Pkt1HfeInstanceName
. For more information, refer to the table in the section "User Data" of the page Configure SBCs in GCP.
For HFE nodes, Ribbon supports the following operating systems:
The mandatory requirement for supported OS are as follows:
apt
or yum
. If any required packages are not in the repository, the HFE script fails with message "Required packages <Package Name> is missing" in the HFE_conf.log
.https://cloud.google.com/compute/docs/startupscript
.Ensure that the following are configured before creating the HFE node:
This section describes the manual creation of HFE nodes.
Memory: 15GB
The values for Cores and Memory are for illustration only. For recommended configurations, refer to 7.2.3S400 Supported and Recommended Instance Sizes - SBC and HFE.
HFE 2.0 - Basic Configuration
Set the Size as 10 (GB).
HFE 2.0 - Boot Disk
ssh-rsa ... <user-name>
.Check Block project-wide SSH keys.
HFE 2.0 - Security
Ephemeral (Automatic)
.Set IP forwarding to On
.
HFE 2.0 - Public Interface - Network Interface - PKT0
Ephemeral (Automatic)
.Set External IP as None
.
HFE 2.0 - Private Interface - Network Interface - PKT1
Ephemeral (Automatic)
.If using external IP, set the External IP as Ephemeral (Automatic)
.
HFE 2.0 - Management Interface - Network Interface - MGT0
Ephemeral (Automatic)
.Set the External IP as None
.
HFE 2.0 - Network Interface - PKT0
Ephemeral (Automatic)
.Set the External IP as None
.
HFE 2.0 - Network Interface - PKT1
n1-standard-4
The value for Machine Type are for illustration only. For recommended configurations, refer to 7.2.3S400 Supported and Recommended Instance Sizes - SBC and HFE.
HFE 2.1 - Basic Configuration
Set the Size as 10 (GB).
HFE 2.1 - Boot Disk
ssh-rsa ... <user-name>
.Check Block project-wide SSH keys.
HFE 2.1 - Security
Ephemeral (Automatic)
.Set IP forwarding to On
.
HFE 2.1 - HFE PKT0 Node - Public Interface - Network Interface - PKT0
Ephemeral (Automatic)
.None
.Set IP forwarding to On
.
HFE 2.1 - HFE PKT1 Node - Private Interface - Network Interface - PKT1
Ephemeral (Automatic)
.Set the External IP as Ephemeral (Automatic)
.
HFE 2.1 - Management Interface - Network Interface - MGT0
Ephemeral (Automatic)
.Set the External IP as None
.
HFE 2.1 - HFE PKT0 Node - Network Interface - PKT0
Ephemeral (Automatic)
.Set the External IP as None
.
HFE 2.1 - HFE PKT1 Node - Network Interface - PKT1
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.
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.
The term "user-data" is deprecated; use the term "startup script" to refer to the code snippet below.
For reference:
Below is an example of the startup script for the HFE node with complete user-data. Use it to fill the Metadata while creating a node.
This example corresponds to HFE 2.1.
For HFE 2.0, remove the line /bin/echo "SBC_PKT_PORT_NAME=\"PKT0\"" >> $NAT_VAR
.
#!/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:
Set an Instance tag. This is used to specify which instances use this rule.
When creating an instance, set this tag as the Network Tag.
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.
To use the "Specify Instance" method, create the HFE instance before specifying it.
Specify an IP address - Specify the private IP address of nic3 / nic4 (for the VPCs of PKT0 and PKT1 respectively) interface on the HFE.
You cannot edit VPC route rules on the Goggle Cloud Platform.
Create a route
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.
Set Protocols and ports as "Allow all".
Repeat for the VPC used for the SBC PKT1 interface.
VPC network details
The HFE generates the following logs under /opt/HFE/log/
:
HFE_conf.log
.
Ribbon tested the following upgrade scenarios on the HFE node, using ICMP packets to contact the PKT0/PKT1 ports on the SBC:
Ubuntu 19.04 > 19.10
While updating Google-specific packages, the routes are removed. To restore them, reboot the instance after update.
Ribbon recommends rebooting the HFE instance after installation or update of any package that affects networking.
Installation of all updates available on CentOS 8.
Ribbon does not support full OS upgrades on CentOS.
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:
Click Create.
Create a router
Click Create.
Create a NAT gateway