How to Use Network Load Balancer to Connect to OCI Instances

Anil Bhagavatula
Oracle Developers
Published in
5 min readAug 17, 2021

Oracle Cloud Network Load Balancer Features

The Oracle Network Load Balancer is a non-proxy load balancing solution that performs pass-through load balancing of layer 3 and layer 4 (TCP/UDP/ICMP) workloads. In addition, it offers an elastically scalable regional VIP address that can scale up or down based on client traffic with no minimum or maximum bandwidth configuration requirement.

It also provides the benefits of flow high availability, source and destination IP address, and port preservation. It’s designed to handle volatile traffic patterns and millions of flows, offering high throughput while maintaining ultra-low latency. This ideal load balancing solution for latency-sensitive workloads includes real-time streaming, VoIP, Internet of Things, and trading platforms. The Network Load Balancer is optimized for long-running connections in the order of days or months, which makes it best suited for your database or WebSocket-type applications.

The Network Load Balancer operates at the connection level and balances incoming client connections to healthy backend servers based on IP protocol data. The load balancing policy uses a hashing algorithm to distribute the client flows. The default load balancing distribution policy is based on a 5-tuple hash of the source and destination IP address, port, and IP protocol information. This 5-tuple hash policy provides session affinity within a given TCP or UDP session, where packets in the same session are directed to the same backend server behind the Network Load Balancer. In addition, you can use a 3-tuple (source IP, destination IP, and protocol) or 2-tuple (source and destination IPs) load balancing policy to provide session affinity beyond the lifetime of a given session.

Note: If you haven’t already done so, you can sign up for an Oracle Cloud Free Tier account today.

The benefit of a Network Load Balancer

Layer 4 load balancers forward network packets to and from the upstream server without inspecting the content of the packets, which makes them more secure. They don’t need to decrypt the content of the packets; they can merely forward them. Stream only a single connection between the client and the servers so the network load balancer can serve a maximum number of connections. Overall, the Network Load Balancer is built for speed and efficiency.

Features Oracle Cloud Network Load Balancer

Layer 4 Load Balancing: Yes

HA: Yes

Bandwidth: Flexible

Client Header Preservation: Yes

Note: Wide Opening (Open to any IP on the internet 0.0.0.0/0)of the Port SSH, RDP and DB Port is not recommended best security Guide Design Lines. Please refer below Security Guide Lines and Best Practices.

Oracle Cloud Security Best Practices Guide Lines,

Oracle Cloud Infrastructure Security Guide,

Best practices framework for Oracle Cloud Infrastructure

Steps

  1. Create the Network Load Balancer under the Networking Section select Load Balancers. Ensure you are in your desired OCI region and compartment.

2. Click Create Load Balancer.

2a. Select Network Load Balancer.

2b. Provide the Load Balancer Name and Visibility Type Public. The Public IP can be Ephemeral IP Address or Reserved IP Address.

Select the VCN and Subnet which is public Subnet.

2c. Select the Network Security Group.

Network Security Group allows the Ingress and Egress for the Load Balancer. Using Network Load Balancer we can Whitelist your corporate network Public IPs only to Allow Access to Load Balancer

2d. Create the Backend to the desired VM from which we need the SSH Connectivity.

Uncheck the Preserve Source IP.

Specify the Health Check Options on port number 22 for TCP.

2e. Add the Backend server to which you want the SSH Connection.

Once the Network Load Balancer is created, the status of LBaaS and Health should be green.

Using the LBaaS Public IP, you can access the Linux VM.

Ensure that you have whitelisted your public IP (Corporate or Internet Public IP) in Network Security Group of the Network Load Balancer.

Also configure the Egress from the Network Security Group to Specific IP.

We can also connect to Windows RDP, DB Port or any TCP or UDP Port using the Network Load Balancer.

Oracle Cloud Network Load Balancer Service is not chargeable.

Summary

For more information, see OCI Network Load Balancer or the OCI Load Balancer in the OCI documentation. We want you to experience these new features and all the enterprise-grade capabilities that Oracle Cloud Infrastructure offers.

Note — Free Tier users may experience changes to services included with their account.

--

--