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 |
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
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 |
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
Since 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.
Refer to the following pages for startup script examples:
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.
For specialized deployments, users may need to add specific custom static routes to the HFE at the OS level. The HFE script supports this by using the HFE variable CUSTOM_ROUTES
. It enables the HFE script to add these routes as part of its start-up process and verify these routes continue to be on the HFE throughout the uptime.
CUSTOM_ROUTES
is a comma separated list of values in the form <DESTINATION_IP_CIDR>_<INTERFACE_NAME>. For example: 1.1.1.0/26_eth1, 2.2.2.0/28_eth2, 3.3.3.4/32_eth3.
To add the CUSTOM_ROUTES to the HFE startup-script, add the following line below /bin/echo "SBC_PKT_PORT_NAME=\"<SBC_PKT_PORT_NAME>\"" >> $NAT_VAR
. For example:
/bin/echo "SBC_PKT_PORT_NAME=\"<SBC_PKT_PORT_NAME>\"" >> $NAT_VAR
/bin/echo "CUSTOM_ROUTES=\"<DESTINATION_IP_CIDR>_<INTERFACE_NAME>, <DESTINATION_IP_CIDR>_<INTERFACE_NAME>\"" >> $NAT_VAR
/bin/echo $(timestamp) "Copied natVars.input" >> $LOG_FILE
The HFE_GCE.sh script can create an archive of useful logs to help with debugging (similar to the SBC sysdump). Run the following command to collect the logs:
sudo /opt/HFE/HFE_GCE.sh sysdump
The following details are collected:
- Output of:
- Interfaces
- Routes
- IPtables
- dmesg
- conntrack count
- conntrack extended list
- The VM GCE metadata
- journalctl errors
- dhclient logs
- System-networkd logs
- The logs:
- syslog
- GCE startup-script
- cloud-init logs
/opt/HFE/*
(without previous sysdumps)- All user bash history
The sysdumps archives are stored in the .tar.gz
format under /opt/HFE/sysdump/
.
The DNS queries on the SBC PKT port are sent using the primary IP. The HFE variable ENABLE_PKT_DNS_QUERY
is used to enable the support for the HFE to forward these requests.
To enable it on a new HFE setup, add "ENABLE_PKT_DNS_QUERY=1
" to the startup-script, below the SBC_PKT_PORT_NAME
. For example:
/bin/echo "SBC_PKT_PORT_NAME=\"<SBC_PKT_PORT_NAME>\"" >> $NAT_VAR
/bin/echo "ENABLE_PKT_DNS_QUERY=1" >> $NAT_VAR
/bin/echo $(timestamp) "Copied natVars.input" >> $LOG_FILE
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.