Azure Gateway VPN IP different from actual Public IP - azure

I have a Virtual Network Gateway setup on my Azure subscription, and a number of VMs which connect to it.
The VN Gateway created a Public IP automatically, and has it listed in the 'Overview' screen.
However going onto any website to check my IP (e.g. whatsmyip.org) gives me an entirely different Public IP. Anyone know why this is?
My configuration of the Virtual Network Gateway is very basic with mostly defaults and the VpnGw1 SKU.

The public IP assigned to the virtual network gateway is a public IP to let you connect Azure VPN gateway from your on-premises network or the Internet.
However, by default, there is a default route to make that Azure VM can continue to accept and respond to requests from the Internet directly. If VM has been assigned a public IP address to the NIC, the outbound traffic from VM will use this IP address. If the VM does not have a public IP address, Azure translates the private source IP address of the outbound flow to a public source IP address. This public IP address is not configurable, cannot be reserved, and does not count against the subscription's public IP resource limit. Read Outbound connections scenario overview.
So the outbound public IP of Azure VM is different than the virtual network gateway public IP.

Related

Where can I found the configuration of my VNet with my Web-App on Azure?

The scenario in here is that I have created a WebApp which has Dynamic Outbound IPs, and we needed those IPs to get whitelisted on the DB side, Since there were too many IPs, we created a NAT Gateway, VNet and a single Public IP address through which we will communicate to the DB.
I need to know where lies the configuration for VNet with my Azure web app?
You need to whitelist the public IP address to your firewall of DB because NAT provides source network address translation (SNAT) for a subnet.
NAT gateway resources specify which static IP addresses virtual
machines use when creating outbound flows. Static IP addresses come
from public IP address resources, public IP prefix resources, or both.
If a public IP prefix resource is used, all IP addresses of the entire
public IP prefix resource are consumed by a NAT gateway resource. A
NAT gateway resource can use a total of up to 16 static IP addresses
from either.
If you have enabled web app with VNet Integration, By default, BGP routes affect only your RFC1918 destination traffic. If WEBSITE_VNET_ROUTE_ALL is set to 1, all outbound traffic can be affected by your BGP routes.

Outgoing ip using ACI in a VNET

I'm using the ACI in a private VNET. My problem is, the outgoing ip from this container is not my public IP used in Azure Gateway, is some random ip.
There's some way to fix somehow this outgoing ip from some container using ACI?
OBS: I tested with a public container, I had a public ip to incoming, but for outgoing was different :|
Thanks!
For your issue, when you create the ACI in the VNET, you just can access the resources inside the VNET and the outgoing IP is a private IP of the VNET, so the IP is static if you do not delete the ACI.
When you create a public ACI, it can access the Internet. This time, as I think, the ACI has two public IP, one is the public IP or the FQDN of the ACI to access from the Internet. And another is the public IP of the host machine that the ACI deploy in. When you access the ACI from the Internet, you need to use the public IP or the FQDN which Azure provide you. But when you access the Internet inside the ACI, the outgoing IP is the host machine's public IP. You cannot decide which host machine you can use, so does public IP of the host machine.
If you need to decide the outgoing IP and must be a static one. You can install the docker server in the VM with a static public IP, then create containers in the VM. Then the outgoing IP is the public IP of the VM.
Or you can use the AKS, create the pod and associated with a service that uses the Load Balancer type. Then the outgoing IP is also static and it's the service public IP.

Do Azure virtual networks allow public addressing to sources in the VPN domain after connecting to the peer or Azure virtual network gateway

We have a client that does not support NAT or RFC1918 addressing within VPN tunnels (encryption domain) and/or Peers.
The Azure virtual network gateways setup without a load balancer appear to not do NAT unless you have a load balancer out front which is good, correct me if I am wrong.
But can internal virtual machines in the virtual network at Azure have public ips only? Or does Azure require private virtual network addressing but you can also associate the public IP? We have set it up with the gateway public ip, virtual network with a 10.x.x.x subnet and associated public IPs to the sources or virtual machines.
Can virtual network machines only have a public IP at Azure? Or can you reach instances by public IP when connected to the Azure virtual network public IP even with private addressing in addition to the public IP binding?
But can internal virtual machines in the virtual network at Azure have
public ips only? Or does Azure require private virtual network
addressing but you can also associate the public IP?
Every Azure VM create by a private IP address, then we can associate a public IP address to it.
Or can you reach instances by public IP when connected to the Azure
virtual network public IP even with private addressing in addition to
the public IP binding?
Yes, we can connect that VM with public IP address directly.

Azure Vnet peering with public IP load balancer

I got two Vnets:
Vnet #1: 1 VM with Public (internet facing) IP load balancer - internet connected App VMs.
Vnet #2: 3 VMs with public (internet facing) IP load balancer - internet and private DB servers (the load balancer is using public ip so that I could access the DBs).
I set up a peering between Vnet1 & Vnet2 so that the communication between them will be private/internal and fast with no internet routing.
I want to access the DBs (using a load balancer) in Vnet2 from Vnet1 - so in the VM located in Vnet1 I use Vnet2 public IP load balancer.
It works...
But the question is -
will the communication be routed through the internet or will it be internal?
will Azure route the that internally because the Vnets are peered or should I set up another load balancer with Private IP?
will the communication be routed through the internet or will it be
internal? will Azure route the that internally because the Vnets are
peered or should I set up another load balancer with Private IP?
If you want to route the network traffic through the private network, we should create another load balancer with private IP, then use private IP address to access it.
Update:
After test in my lab, according to the result, it seems if we use public IP, the traffic network will not be internal.
Here is the tracert before set peering:
Here is the tracert after set peering:
14 hops, same as not set peering, so I think peering will not change the public IP traffic to internal.
By the way, two public IP addresses of Azure, I guess he mean that all traffic will internal, means that public IP traffic will in Azure data centers, will not go to the Internet.

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.

Resources