32 ‐ Routes and Gateways - SanjeevOCI/Ocidocs GitHub Wiki

Routes and Gateways

In networking, routes and gateways control how data moves between different networks and systems.

1. What Are Routes?

Routes define how network traffic is directed from one point to another.

They contain rules (route entries) that specify:

  • Destination (CIDR block) – Where the traffic should go.

  • Target (Next Hop/Gateway) – The device or interface that will forward the traffic.

Types of Routes

  • Static Routes – Manually configured, used in cloud environments and simple networks.
  • Dynamic Routes – Learned automatically via routing protocols (BGP, OSPF, etc.).
  • Default Route (0.0.0.0/0) – Used to send traffic to an external network (like the internet).

📌 Example in OCI: A route table in Oracle Cloud Infrastructure (OCI) may have this entry: 0.0.0.0/0 → Internet Gateway (IGW) This means that all traffic not destined for the VCN stays inside OCI and goes to the internet via IGW.

2. What Are Gateways?

A gateway is a networking device that acts as an entry/exit point between different networks. It enables communication between networks with different routing rules.

Types of Gateways in OCI

Internet Gateway (IGW) – Enables traffic between OCI and the public internet.

NAT Gateway – Allows private subnet instances to access the internet without exposing them.

Dynamic Routing Gateway (DRG) – Connects OCI to on-premises networks via VPN or FastConnect.

Service Gateway – Provides private access to OCI services like Object Storage without internet exposure.

Local Peering Gateway (LPG) – Connects two VCNs within the same OCI region.

Remote Peering Gateway (RPG) – Connects two VCNs across different OCI regions.

3. How Routes and Gateways Work Together

A route table determines where traffic should go. A gateway acts as the entry/exit point for traffic based on the routes.

📌 Example Setup in OCI:

A private subnet with a NAT Gateway will have this route: 0.0.0.0/0 → NAT Gateway (Allows outbound traffic, no inbound) A public subnet with an Internet Gateway will have: 0.0.0.0/0 → Internet Gateway (Allows both inbound and outbound traffic)

Conclusion

Routes = Instructions on where traffic should go. Gateways = Network devices that enable traffic to pass between different networks. OCI uses route tables with gateways to control how traffic moves inside and outside the cloud. 🚀 Would you like help with designing a specific OCI network? 😊