mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
36 lines
1.4 KiB
Plaintext
36 lines
1.4 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * cloud_experts_osd_tutorials/cloud-experts-osd-limit-egress-ngfw.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="cloud-experts-osd-limit-egress-ngfw-create-a-cloud-router_{context}"]
|
|
= Creating a Cloud Router and a Cloud Network Address Translation gateway
|
|
The Network Address Translation (NAT) gateway enables internet connectivity for your private VMs by masquerading all their traffic under a single public IP address. As the designated exit point, it translates their internal IPs for any outbound requests, such as fetching updates. This process effectively grants them access to the internet without ever exposing their private addresses.
|
|
|
|
. Reserve an IP address for Cloud NAT by running the following command:
|
|
+
|
|
|
|
[source,terminal]
|
|
----
|
|
$ gcloud compute addresses create ${prefix}-${region}-cloudnatip \
|
|
--region=${region}
|
|
----
|
|
+
|
|
. Create a Cloud Router by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ gcloud compute routers create ${prefix}-router \
|
|
--region=${region} \
|
|
--network=${prefix}-vpc
|
|
----
|
|
+
|
|
. Create a Cloud NAT by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ gcloud compute routers nats create ${prefix}-cloudnat-${region} \
|
|
--router=${prefix}-router --router-region ${region} \
|
|
--nat-all-subnet-ip-ranges \
|
|
--nat-external-ip-pool=${prefix}-${region}-cloudnatip
|
|
---- |