Back to Blog
OCI Dynamic Routing Gateway Setup Step-by-Step for Hybrid Networking

OCI Dynamic Routing Gateway Setup Step-by-Step for Hybrid Networking

   Mariusz Antonik    Oracle Cloud (OCI)    3 min read    2,103 views

1. Introduction

The Dynamic Routing Gateway (DRG) is the heart of hybrid networking in OCI.
If you're connecting an on-prem network, another cloud provider, or multiple VCNs — the DRG is the router that ties it all together.

In this guide, I’ll show you exactly how to set it up, test it, and validate routing end-to-end.


2. What Problem This Solves

Without the DRG:

❌ On-prem cannot reach OCI
❌ Site-to-site VPN won’t work
❌ FastConnect can’t attach
❌ Cross-VCN routing becomes messy
❌ VCN peering becomes inconsistent

With a DRG:

✅ Centralized routing
✅ Multiple VCN attachments
✅ VPN or FastConnect integration
✅ Inspection and monitoring

Let's build it properly.


3. Step-by-Step Guide


Step 1 — Create DRG

OCI Console → Networking → Dynamic Routing Gateways → Create DRG

CLI:

 
oci network drg create \ --compartment-id <COMPARTMENT_OCID> \ --display-name "main-drg"

Step 2 — Attach VCN to DRG

Console → DRG → Attachments → Create Attachment

CLI:

 
oci network drg-attachment create \ --drg-id <DRG_OCID> \ --vcn-id <VCN_OCID> \ --display-name "vcn-attachment"

Step 3 — Create and Configure Route Tables

VCN → Route Tables → Create New Route Table

Add rule:

 
Destination Type: DRG Destination: <ON_PREM_CIDR> Target: DRG Attachment

CLI:

 
oci network route-table update \ --rt-id <RT_OCID> \ --route-rules '[ {"cidrBlock":"192.168.0.0/16","networkEntityId":"<DRG_ATTACHMENT_OCID>"} ]'

Step 4 — Configure IPSec VPN (Optional)

Create Customer-Premise Equipment (CPE):

 
oci network cpe create \ --display-name "my-cpe" \ --ip-address <ON_PREM_PUBLIC_IP>

Create IPSec tunnel:

 
oci network ip-sec-connection create \ --cpe-id <CPE_OCID> \ --drg-id <DRG_OCID> \ --static-routes '["0.0.0.0/0"]'

Step 5 — Validate Routing with Traceroute

From on-prem:

 
traceroute 10.0.2.10

From OCI compute:

 
sudo traceroute 192.168.1.10

4. Architecture Diagram

(Generated in next message)

Placeholder:

 
On-Prem Network ---- IPSec ---- DRG ---- VCN A \---- VCN B

5. Best Practices

  • Use separate DRG route tables for each VCN attachment

  • Avoid overlapping CIDRs

  • Use HA VPN (tunnel 1 + tunnel 2)

  • Consider FastConnect for production

  • Enable logging on the DRG

  • Use Network Path Analyzer for troubleshooting


6. Troubleshooting

Issue Cause Fix
Ping not working ICMP blocked Enable ICMP in NSG
VPN down Phase 1 mismatch Adjust IKE settings
Route unreachable Wrong RT target Point to DRG attachment
Slow performance MTU mismatch Adjust MTU to 1500/1400

7. Summary

The DRG allows you to build reliable hybrid networks in OCI.
With the configuration above, you can connect multiple VCNs and even full on-prem infrastructure using VPN or FastConnect.

👉 Download the free guide: “7 OCI Networking Mistakes to Avoid”
https://dmcloudarchitect.com/c/7_oci_mistakes_to_avoid.html

About the Author
Mariusz Antonik

Oracle Cloud Infrastructure expert and consultant specializing in database management and automation.

All Tags
#Advanced #agent-visibility #alerts #amazon-linux-2023 #argo-cd #auditd #automation #backend-infrastructure #backup-verification #backups #bandwidth-monitoring #bare-metal-server #Bash #bash cpu monitoring script #bash monitoring #bash scripting #bash-automation #bash-scripts #Beginner #Best Practices #block volume backup #Capacity Planning #centos-ftp-migration #centralized-logging #chromebook-linux #cloud backup strategy #cloud-costs #cloud-database-setup #cloud-networking #cloudflare-workers #compute #container-monitoring #control-panel-security #cpu bottleneck #CPU Monitoring #cpu monitoring linux #cpu monitoring script linux #cpu trends #cpu usage trends #cpu usage trends linux #cpu-monitoring-script #cpu-monitoring-without-tools #cpu-performance-decline-server #cpu-performance-degradation-linux #cpu-usage-history-linux #create oracle db system in oci #cron #cron cpu monitoring #cron cpu monitoring linux #cron jobs #cron-monitoring #custom-linux-distribution #cve-advisory #database #database monitoring #database performance #database-health #database-setup #debian #detect slow queries mysql #devops #devops-checklist #devops-help #devops-learning #disk capacity planning server #disk forecasting linux #disk growth trend linux #Disk Monitoring #disk usage #disk usage script linux #disk usage trends #disk-capacity #disk-growth #disk-saturation-detection-linux #disk-usage-history-linux #Early Detection #easy infrastructure monitoring #egress-monitoring #elasticsearch #exposed-port-monitoring #fail2ban #field-server-checklist #firewall-rules #fleet-ops #free-tier #gitops-security #Guide #health dashboards #Health Reporting #historical server monitoring #historical-monitoring #home-lab #how to monitor cpu usage linux #https-certificates #infrastructure #infrastructure health #infrastructure health dashboard #infrastructure health reporting #infrastructure monitoring #infrastructure monitoring report #infrastructure trends #infrastructure trends monitoring #Infrastructure Visibility #infrastructure-automation #infrastructure-checklist #infrastructure-reporting #interview-prep #ip-allowlist #journald #kubernetes-security #latency-checks #lightweight linux monitoring #lightweight monitoring #lightweight-monitoring-solution #linux #linux administration #linux cpu monitoring #linux cpu usage #linux disk capacity planning #linux disk usage #Linux monitoring #linux monitoring setup #linux monitoring tools #linux performance #linux performance monitoring #linux server #linux server monitoring #linux servers #linux storage #linux tools #linux-admin #linux-disk-monitoring #linux-hardening #linux-hotspot #linux-monitoring-for-small-business #linux-networking #linux-performance-tuning #linux-remote-desktop #linux-security #linux-server-health #local-dns #local-network #log-management #log-retention #logrotate #loki #low maintenance monitoring #mkcert #monitor cpu usage over time linux #monitor linux server health #monitor server trends #monitor small production server #monitor-server-trends-over-time #monitoring #monitoring without complexity #monitoring-without-devops-team #MySQL #mysql health reporting #MySQL monitoring #mysql optimization #MySQL Performance #mysql performance degradation #mysql performance monitoring #mysql performance trends #mysql query performance issues #mysql server monitoring #mysql slow queries #mysql slow query analysis #mysql slow query monitoring #mysql trends #mysql-health #mysql-heatwave #mysql-monitoring-lightweight #mysql-slow-query #mysql-workload-trends #network-monitoring #networking #networkpolicy #node-express #nsg #OCI #oci backup #oci bastion tutorial #oci block volume #oci infrastructure as code #OCI monitoring #oci networking #oci oracle database private subnet setup #oci oracle database tutorial #oci security #oci setup guide #oci terraform tutorial #oci tutorial for beginners #oci vcn terraform #oci virtual machine db system guide #oci-database #oci-mysql-heatwave #oci-mysql-heatwave-tutorial #oci-subnets #offline-pwa #operations-checklist #oracle base database service tutorial #oracle cloud bastion #oracle cloud free tier tutorial #oracle cloud infrastructure step by step #oracle cloud infrastructure tutorial #oracle cloud storage #oracle database on oci setup #oracle-cloud #oracle-cloud-mysql-database-service #oracle-cloud-mysql-setup #oracle-cloud-vcn-setup #outbound-connections #patch-management #path-mtu-discovery #Performance #Performance Degradation #performance monitoring #performance trend monitoring #performance trends #ping-monitoring #plan disk growth server #plesk #practical server monitoring #predict disk usage growth #private instance access #process-monitoring #production-troubleshooting #proxmox #query optimization #query-trends #remote-workstation-security #rhel-tuned #rollback #route-tables #rsyslog #Security #security lists #security-monitoring #selinux #server #server health #server health reporting #server health weekly report #server monitoring #Server Performance #server trend analysis #server-audit #server-checklist #server-hardening #server-health-checklist #server-health-insights #server-security #server-security-audit #server-security-checklist #server-throughput #server-trends #server-troubleshooting #servers #service-worker #siem #simple cpu monitoring linux #simple linux monitoring #simple monitoring small business #simple monitoring system #simple ops monitoring #slow queries #slow query reporting mysql #slow-query-log #small business infrastructure #small business IT #small business servers #small infrastructure monitoring #small server monitoring #small-business-monitoring #small-business-security #small-business-tech #source-built-linux #ssh #ssh bastion #ssh-security #storage capacity planning linux #storage monitoring #subnets #sysadmin-checklist #sysadmin-lab #syscall-monitoring #System Health #system health reporting #systemd #tcp-mtu-probing #tcp-tuning #terraform oci compute #terraform oracle cloud infrastructure #track-disk-growth-linux #Trend Monitoring #trend-analysis #trends #tuned-adm #Tutorial #uptime-checks #uptime-monitoring #vcn #vcn-design #vector #vps-management #vsftpd #vulnerability-response #wazuh #weekly-reports #weekly-server-report #windows-agent #xrdp