久久96国产精品久久久-久久发布国产伦子伦精品-久久精品国产精品青草-久久天天躁夜夜躁狠狠85麻豆

技術員聯盟提供win764位系統下載,win10,win7,xp,裝機純凈版,64位旗艦版,綠色軟件,免費軟件下載基地!

當前位置:主頁 > 教程 > 服務器類 >

阿里云如何添加端口轉發規則

來源:技術員聯盟┆發布時間:2017-05-02 17:30┆點擊:

  添加端口轉發規則

  描述

  在指定的端口轉發表中添加端口轉發規則。

  每一條端口轉發規則,由一個五元組組成:[ExternalIp,ExternalPort,Protocal,InternalIp,InternalPort];

  端口轉發規則的效果是:將ExternalIp:ExternalPort上收到的指定協議的消息,站發給InternalIp:InternalPort,并將回復消息原路返回;

  每一條端口轉發規則有一個唯一ID,用于進行規則修改或者規則刪除;

  ExternalIp相關的約束:

  必須是該NatGateway上的某個帶寬包中的公網IP。

  端口轉發規則可以指定協議,目前暫時只支持TCP和UDP兩種協議,也可以指定為Any

  InternalIp相關的約束

  InternalIp必需屬于本VPC CIDR范圍。

  該IP地址可以是一個存在的ECS私網IP地址,也可以是一個不存在的IP地址(可以先創建規則再創建ECS實例),或被其他非ECS資源占用的地址;

  只有當InternalIp被一個ECS實例使用、且該實例沒有綁定EIP時,端口轉發才能生效;若該IP地址被HaVip/SLB/RDS等非ECS資源使用,則轉發功能無效,外來流量無法轉發到該IP上;

  ExternalPort、InternalPort和IpProtocol,必須同時為Any或者同時不為Any;

  最多支持40條端口轉發規則

  規則的唯一性要求:

  所有端口轉發規則的[源IP, 源端口,協議]三個字段組成的組合必須是互不重復的。即,不允許將同一個源IP、同一個端口、同一個協議的消息轉發到多個目標。

  所有端口轉發規則的[目標IP,目標端口,協議]三個字段組成的組合也必須是互不重復的。

  一個ExternalIp不能同時存在指定端口規則和All端口規則

  每條端口轉發規則都有狀態,取值為Available |Pending |Modifying;當端口裝發表中任意一條規則的狀態處于Pending 或 Modifying時,不允許對端口轉發表進行規則>添加

  請求參數

名稱 類型 是否必須 描述
Action   String     系統規定參數,取值:CreateForwardEntry  
RegionId   String     Region ID  
ForwardTableId   String     ForwardTableId  
ExternalIp   String     端口轉發規則中的源IP;該IP必須是該端口轉發表所屬NatGateway上的共享帶寬包中的IP。  
ExternalPort   String     源端口;取值范圍:1~65535|Any  
IpProtocol   String     IpProtocol類型,可選TCP|UDP|Any  
InternalIp   String     端口轉發規則中的目標IP,是一個私網IP地址。  
InternalPort   String     目標端口;取值范圍為1~65535|Any。  

  返回參數

名稱 類型 描述
ForwardEntryId   String   系統分配轉發表條目ID  

  錯誤碼

錯誤代碼 描述 Http 狀態碼 語義
InvalidRegionId.NotFound   The specified RegionId is not found in our record.   404   指定的Region ID不存在  
InvalidForwardTableId.NotFound   Specified forward table does not exist.   404   指定的轉發表不存在  
InvalidExternalIp.NotFound   Specified Source Ip address does not found on the VRouter   404   指定的源IP地址在NatGatway上沒有找到  
QuotaExceeded.ForwardEntry   Forward entry quota exceeded in this route table.   400   同一個轉發表條目不能超過 40條  
IncorretForwardEntryStatus   Some Forward entry status blocked this operation.   400   同一個 VPC 下面的轉發表中的任一個轉發條目處在中間狀態(添加中,修改中,刪除中),不能創建轉發條目  
InvalidProtocal.ValueNotSupportedc   The specified IpProtocol does not exist or IpProtocol and ExternalPort or InternalPort do not match.   400   指定協議不支持  
InvalidInternalIp.Malformed   The specified InternalIp is not a valid IP address.   400   指定的目的IP地址不合法  
InvalidExternalIp.Malformed   The specified ExternalIp is not a valid IP address.   400   指定的源IP地址不合法  
InvalidExternalPort.Malformed   The specified ExternalPort is not a valid port.   400   指定的源端口號不合法  
InvalidInternalPort.Malformed   The specified InternalPort is not a valid port.   400   指定的目的端口號不合法  
Forbidden.PortsAndIpProtocol   ExternalPort/InternalPort/IpProtocol must be all Any or all not Any.   400   ExternalPort/InternalPort/IpProtocol必須同時為Any或者同時不為Any  
ForwardEntry.Duplicated.Source   The specified is duplicated   400   與某條已存在的條目存在<源IP, 源端口號,協議>的沖突  
ForwardEntry.Duplicated.Destination   The specified is duplicated   400   與某條已存在的條目存在<目標IP, 目標端口號,協議>的沖突  
Forbidden.DestnationIpOutOfVpcCIDR   The specified Destination Ip is Out of VPC CIDR   400   指它目的IP地址不在本VPC CIDR  

  示例

  請求示例