Azure app service - routing traffic through vnet - does IP translation take place? - azure

I have an azure app service with a web job that grabs data from a web service. The networking properties show that the webjob has a few outbound IPs, which are public Azure IP addresses.
I know that the web service app can be configured to route traffic through a VNET, however, it's not clear to me if the IP is translated to a local IP in the VNET, or if the Azure public IP remains. This obviously has implictions if there are firewalls on the network that block external IP's. Would this also mean that the return route could be over the internet rather than through the network? (espseically if the traffic end's up going down a VPN and outside of Azure - surely a 40. something public azure address would then force a return over the internet, which may not always be possible).

it's not clear to me if the IP is translated to a local IP in the
VNET, or if the Azure public IP remains.
As far as I know, when we use public IP address to communicate the internet, the public IP address will not translated to a internal IP.
I think this might cause an issue when using this with a VPN as I'm
not sure how the return path would know to use the VPN rather than
route over the internet.
When we use Azure P2S or S2S VPN, we can't force the internet traffic through the VPN tunnel.
Update:

Related

Is there a VPN solution in Azure that can assign a static public IP to the clients connected for me to achieve full tunnelling? may be in P2S VPN?

Is there a VPN solution in Azure that can assign a static public IP to the clients connected for me to achieve full tunnelling? may be in P2S VPN?
P2S VPN does not have full tunneling. Is there any other alternate solution?
• No, you can’t assign a static public IP address to the clients for a VPN solution in Azure as the client address pool that needs to be defined while deploying a VPN gateway in Azure is a subnet of the IP address spaces that the virtual network is created out of.
But you can configure forced tunnelling in your Azure virtual network on your VPN gateway subnets as illustrated below. In the below image, forced tunnelling is shown for Site-to-Site VPN scenario but it can also be implemented for Point-to-Site VPN scenarios in the same way. The Frontend subnet is not force tunneled. The workloads in the Frontend subnet can continue to accept and respond to customer requests from the Internet directly. The Mid-tier and Backend subnets are forced tunneled. Any outbound connections from these two subnets to the Internet will be forced or redirected back to an on-premises site via one of the Site-to-site (S2S) VPN tunnels as shown below.
This allows you to restrict and inspect Internet access from your virtual machines or cloud services in Azure, while continuing to enable your multi-tier service architecture required. If there are no Internet-facing workloads in your virtual networks, you also can apply forced tunneling to the entire virtual networks.: -
• Also, please note that you can *configure the above for your P2S clients by securing the Internet traffic via Firewall Manager and advertising the 0.0.0.0/0 route to your VPN clients. This makes your clients send all internet bound traffic to Azure for inspection. Then, firewall SNATs the packet to the PIP of Azure Firewall for egress to Internet. For this purpose, setup the Azure Firewall Policy to allow P2S traffic to Internet and to advertise all the traffic from 0.0.0.0/0 to your VPN clients, you would need to break them into two smaller subnets 0.0.0.0/1 and 128.0.0.0/1 as mentioned in the below documentation: -
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-p2s-advertise-custom-routes#forced-tunneling
Also, you can add the code below in your ‘azurevpnconfig.xml’ file that can be directly downloaded from the templates section if the above said subnets cannot be added in ‘Default Routes’ on the portal.
<clientconfig>
<includeroutes>
<route>
<destination>0.0.0.0</destination><mask>1</mask>
</route>
<route>
<destination>128.0.0.0</destination><mask>1</mask>
</route>
</includeroutes>
</clientconfig>

Configure Static IP Address for Point-to-site VPN in Azure

How to configure Point-to-Site VPN with a Static IP address as my applications are dependent on a static IP address given out by the VPN Gateway. Is it even possible with Point-to-site? What about options like ExpressRoute and Site-to-Site VPN?
As of now assigning Static IP for P2S is not possible. Please raise your feedback via User Voice: https://feedback.azure.com/forums/217313-networking
If you are using options like Site to Site or Express Route, Azure will not lease IP address and basically it connects to the Peer Address Prefix. So you can deploy your Application on On-Premises Server and make that Server IP static to address your issue.

Control outbound IP address of internal VMSS in Azure

I have a VMSS/svc fabric cluster on internal vnet (not public). The only inbound connections to the VMSS is from on prem through a Azure VPN Gateway.
How do I control the outbound IP address the VMSS go through when accessing the internet? In this case I do not want this traffic routed through a random IP address or through the VPN connection.
Basically I want to secure my Azure SQL so that the outbound internet IPs of the VMSS is whitelisted. And I don't want to add all Azure datacenter IPs.
You could look to use Forced Tunneling which would ensure that your control where the data egress occurs in your on-premises environment, however this would force any data in your Virtual Network back over your VPN connection which may not be desirable (or helpful if you don't control egress from there).
Failing this you could add a software-based firewall running on an Azure VM with a public IP onto the same VNet and then use User Defined Routes (UDRs) to force all traffic bound for the Internet to go via that and then use the public IP address in your SQL firewall.
Longer term you will be able to connect Azure SQL DB to VNets (or at least restrict access to it from one) - see the Uservoice site (and add your vote!)

azure - static outgoing ip for all VMs in a vnet

I have multiple VMs in a vnet. Vnet has a static ip attached to it's interface. The network interfaces attached to individual VMs do not have any public ip associated. My expectation is that all outgoing traffic would get routed through the vnet ip, but it isn't the case. Each VM has a different public going IP. I have tried using curl ipinfo.io to test.
I need to ensure that all of the internet traffic from any VM in the vnet would get routed through a static ip address.
All outgoing traffic from the vnet should go through the same IP. I
want to whitelist this ip in my external services.
If your VMs deploy in ASM module, all the VMs in the same cloud service use the same public IP.
If your VMs deploy in ARM module, and want all VMs in the Vnet outgoing traffic through the same public IP address, we can use internet load balancer.
Also we can deploy S2S VPN between them, so we can add the public IP address to whitelist.

Having on-prem IP to point to Azure VM

I have a case where I want to migrate on-prem servers to Azure, but I should still have the local IPs pointing to these VMs. I mean by the local IPs the country-range of IPs since these VMs should be accessed using country IPs for regulatory reasons.
I heard that this is possible, but I have no idea what type of resources I should use to allow this, VNET, VPN, ExpressRoute ?? And how to do it as I have no experience in networking what so ever.
Regards,
NAT is a method of remapping one IP address space into another by modifying network address information in Internet Protocol (IP) datagram packet headers while they are in transit across a traffic routing device.
You can setup a site-to-site VPN between on-prem and Azure Vnet, then deploy a server on-prem run as the NAT device.
It is possible, but with some complications and constraints:
You can run these servers/VMs in Azure using their public IP addresses. You need to create the Virtual Network using these address ranges, but it is possible. The catch here is that these public IP addresses are only accessible via cross premises connectivity solutions such as Azure VPN gateway or Azure ExpressRoute. You cannon access these VMs using their "public" IP addresses directly over the Internet. For this purpose, these public IP address ranges are really treated as "private addresses".
Once you create the virtual network with the public IP addresses (as private address space) in Azure, you will also need to make sure your routing in the on premises network is configured correctly to forward the traffic to these VMs over the VPN tunnels or MPLS/WAN network if you are using ExpressRoute.
If these servers/VMs need to accept requests directly from the Internet, the traffic from the Internet will still come to your on premises network because that's where your ISPs will direct the traffic. You will need to ensure these traffic will be routed correctly over the cross premises connectivity (VPN/ExpressRoute) to Azure.
Hope this helps a bit. Please let me know if this answers your question.
Thanks,
Yushun [MSFT]

Resources