weizhouapache commented on code in PR #10081:
URL: https://github.com/apache/cloudstack/pull/10081#discussion_r1879754457
##########
server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java:
##########
@@ -3402,6 +3402,15 @@ public boolean isSrcNatIpRequired(long vpcOfferingId) {
&&
vpcOffSvcProvidersMap.get(Service.Gateway).contains(Network.Provider.VPCVirtualRouter));
}
+ @Override
+ public boolean isSrcNatIpRequiredForVpcVr(long vpcOfferingId) {
+ final Map<Network.Service, Set<Network.Provider>>
vpcOffSvcProvidersMap = getVpcOffSvcProvidersMap(vpcOfferingId);
+ return
(Objects.nonNull(vpcOffSvcProvidersMap.get(Network.Service.SourceNat))
+ &&
vpcOffSvcProvidersMap.get(Network.Service.SourceNat).contains(Network.Provider.VPCVirtualRouter))
+ ||
(Objects.nonNull(vpcOffSvcProvidersMap.get(Network.Service.Gateway))
+ &&
vpcOffSvcProvidersMap.get(Service.Gateway).contains(Network.Provider.VPCVirtualRouter));
+ }
Review Comment:
for isolated networks (NATTED mode by default), it uses VR as SourceNat
for Routed networks, it uses VR as Gateway
in both cases, the VR needs a public IP (as Source NAT or Gateway)
For Static NAT, I think we do not need to add a public interface to the VR
when VR is created.
when Static NAT is enabled, it may add a public interface if needed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]