In this section...
The HFE node is a public-facing node which allows subsecond switchover to occur on the SBCs, as it negates the need for any IP reassignment.
GCP requires each Interface on a instance to be in a separate VPCs. A minimum of six VPCs need to be created for a full HFE set up (assuming all Mgmt interfaces for SBC and HFE node are in the same VPC).
The HFE must be configured with the five Interfaces:
Standard interface Name | NIC | Function | Requires External IP? |
---|---|---|---|
ens4 | nic0 | Public Interface for SBC PKT0 | Yes |
ens5 | nic1 | Private interface in for SBC PKT1 (Can only be connected to from instances in same subnet) | No |
ens6 | nic2 | Management interface to HFE | Yes |
ens7 | nic3 | Interface to SBC PKT0 (must be in the same VPC and subnet as SBC pkt0) | No |
ens8 | nic4 | Interface to SBC PKT1 (must be in the same VPC and subnet as SBC pkt1) | No |
The following configuration options must be set before creating the HFE node
The following steps are required to set up a GCE HFE instance with five interfaces to interact to communicate with PKT0 and PKT1.
Select six CPUs with 15GB RAM.
Set the Size as 10 (GB).
Select the Block project-wide SSH keys.
Update the Metadata to include the user-datafor the HFE. The user data is can be found here: GCE_HFE_userdata.txt, with the following variables populated appropriately:
Variable | Description |
---|---|
HFE_SCRIPT_LOCATION | The location of the HFE script stored in Google storage (See Creating a Bucket in Cloud Storage for the 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 | IP address of the remote machine to SSH from on the Management Interface. This can be a comma-separated list. |
ZONE | The Zone in which the SBCs are configured, |
An example of User Data can be found in User Data Example
9. Update the Network Interfaces on the HFE by selecting the Networking tab - Update the Network interfaces:
Add a Network interface for the Public Interface to receive traffic for SBC PKT0:
Set IP forwarding to On.
Add a Network interface for the Private interface to receive traffic for SBC PKT1:
Add a Network interface for the Management interface to HFE:
Select VPC which was created for SBC MGT0.
Add a Network interface for the interface to communicate with SBC PKT0.
Select VPC which was created for SBC PKT0.
Add a Network interface for the interface to communicate with SBC PKT1.
Select VPC which was created for SBC PKT1.
As the the SBCs are not yet configured, there will be error messages occurring in the HFE.log. After the HFE node instance is created, to stop the instance from running until the SBCs are created and configured.
The GCE HFE script will fail until the SBCs have been created (due to the inability to read the information from the SBC). This means SSH to mgmt interface will not work until the SBCs have been created. The HFE node will be able to be accessed via NIC0.
Below is an example of the user data for the HFE node with data completed:
Content-Type: multipart/mixed; boundary="//" MIME-Version: 1.0 --// Content-Type: text/cloud-config; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cloud-config.txt" #cloud-config cloud_final_modules: - [scripts-user, always] --// Content-Type: text/x-shellscript; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="userdata.txt" #!/bin/bash HFE_DIR="/home/ubuntu/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-sbc/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-sbc1\"" >> $NAT_VAR /bin/echo "STANDBY_SBC_VM_NAME=\"rbbn-sbc2\"" >> $NAT_VAR /bin/echo "REMOTE_SSH_MACHINE_IP=\"10.27.178.4\"" >> $NAT_VAR /bin/echo "ZONE=\"us-central1-a\"" >> $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 set up > /dev/null 2>&1 &
Specific extra rules need to be added at the Google Network level to allow use of the HFE. Both routes and firewall rules must be configured on the VPC networks which contain the subnets in which PKT0 and PKT1 interfaces on the SBC are located.
Routes must be created to send all of the traffic that leaves the PKT0 and PKT1 interfaces return through the HFE:
Set an Instance tag. This is used to specify which instances use this rule.
This tag must be set as Network Tag when creating an instance.
Specify an IP address - Specify the private IP address of nic3 / nic4 (for the VPCs for PKT0, PKT1 respectively) interface on the HFE.
To use the Specify instance method, the HFE instance must be created first.
VPC route rules cannot be edited in GCP.
By default, the Google network will drop all packets unless firewall rules are configured. Rules must be set up 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.
The HFE will generate the following logs under /home/ubuntu/HFE/log/: