大网数据广告活动
服务器运维问答

How do I find if I am exhausting Cloud NAT ports

· 52CE 我爱测

I am curious to know if I need to increase the min (Minimum ports per VM instance) port numbers I have configured for my GCP cloud NAT configuration. I am noticing some connection issue. Just to give you more context I am using G…

问题原文

原帖链接 · userX · CC BY-SA 4.0

I am curious to know if I need to increase the min (Minimum ports per VM instance) port numbers I have configured for my GCP cloud NAT configuration. I am noticing some connection issue.

Just to give you more context I am using Google Cloud Platform's Cloud NAT.

VMs doesn't have external IP going to use Cloud NAT's IP to communicate with internet.

已采纳解答

原帖链接 · user536627 · CC BY-SA 4.0

I believe the number of port requirement depends on the number of connection that is being opened by services using the Cloud NAT to communicate with an external endpoint. If you would like to know if you are exhausting allocated ports, you might want to enable logging from

Go to "NAT gateway details" Click on EDIT then expand "Logging, minimum ports, timeout" and select logging options

Export Cloud NAT logs to Stackdriver:

  • No logging --disable logging
  • Translation and errors -- Will log Translation and error both
  • Translation only ---Will log Translation only
  • Errors only ---Will log error only.

When the logging is enabled, all collected logs are sent to Stackdriver by default. NAT flow logs provide two types of logs:

  • Translation: a VM instance initiates a connection that is successfully allocated to a NAT IP and port and traverses to the internet
  • Error: a VM instance attempts to connect to the internet by sending a packet over the connection, but the NAT gateway can't allocate a NAT IP and port due to port exhaustion

You can also find the details of gcloud command in Configuring logging section under Cloud NAT logging.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-08-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。