Getting BGP peers of an ExpressRoute gateway - azure

I am trying to pull the IP addresses of BGP speakers that establish a peering with an ExpressRoute gateway. For instance, if I create a VirtualNetworkGatewayConnection between my ExpressRoute circuit and an ER gateway, how do I get the IP addresses of the BGP endpoints on the circuit that peer with my gateway?

You could take a look at ExpressRoute REST API and Virtual Network Gateways API
For example, you could get all peerings information in a specified express route circuit here via clicking the Green Try it on that page. Or try to retrieve a list of routes the virtual network gateway has learned, including routes learned from BGP peers here. It might display the IP address of BGP endpoints in the routing table.

Related

What is the use of Expressroute gateway and VPN Gateway?

We're setting up IPSEC Over Express route. I was wondering what's the need of VPN gateway and Express Route gateway?
My understanding is that with VPN gateway we can connect over the internet and establish a IPSec Tunnel. But why is it mandatory to create a VPN gateway (when the case is that I want to connect to site-to-site vpn over Express route).
Without creating a VPN gateway, we can't create VPN sites and links. I'm wondering why it's like that.
Expressroute gateway needs to be created in order to establish a connection to Express route circuits. But here also I don't understand the use of Gateway in general.
Is the gateway purpose is just to establish a connection between Azure cloud and Site-to-site or Azure cloud to Expressroute circuits?
The Gateway is used to setup the connection to an ExpressRoute Circuit.
The Gateway can be used for both the purpose of establishing a connection to an ExpressRoute Circuit, and a S2S connection.
It's just a device. The way you configure it determines if it is a S2S over internet, or a S2S via expressroute.
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-about-vpngateways
When you configure a virtual network gateway, you configure a setting that specifies the gateway type. The gateway type determines how the virtual network gateway will be used and the actions that the gateway takes. The gateway type 'Vpn' specifies that the type of virtual network gateway created is a 'VPN gateway'. This distinguishes it from an ExpressRoute gateway, which uses a different gateway type. A virtual network can have two virtual network gateways; one VPN gateway and one ExpressRoute gateway.
I hope that's a clear enough answer to your question.

Azure VPN Gateway BGP APIPA Addresses

I'm working with a supplier to implement Active/Active Site-to-Site IPSec tunnels to two different regions in the same geography. The supplier is using Palo Alto firewalls.
We've managed to establish both tunnels just fine - IKE and IPSec parameters are configured correctly and I can route bidirectionally between Azure and the supplier premises.
Now we're trying to get the route preferences configured so that if the primary tunnel goes down then traffic will automatically be sent over the second tunnel to the second region.
The supplier has requested that we use APIPA addresses for probing whether the tunnels are up are not. No problem, Azure supports APIPA addresses for BGP - but do they respond to ICMP?
What I'm not clear on - despite reading all the MS documentation - is whether the APIPA address configured in the VPN Gateway resource BGP settings is the receiver address or the neighbor address. I'm assuming it's the receiver, and the peer address is configured in the BGP settings of the Local Network Gateway. Correct me if this isn't correct.
The Microsoft documentation says:
Azure VPN Gateway will choose the custom APIPA address if the corresponding local network gateway resource (on-premises network) has an APIPA address as the BGP peer IP.
Does this suggest I can leave the VPN Gateway APIPA empty and Azure will choose one for me? If so, this could be a problem, since the supplier has to specify 2 x /30 address spaces, one for each tunnel and is depending on Azure having a specific address, and the Palo Alto having a specific one. I guess this means I need to configure the address in the VPN first, then configure the peer address in the local gateway?
Aside from that, the supplier only wants to use these addresses for probing by pinging them. I've created BGP configurations in ExpressRoute circuits and can confirm the B-End (Azure) BGP neighbor addresses do respond to ICMP Echo, but I do believe that is only once a successful BGP session has been established.
So my question is, is it possible to specify in an Azure VPN Resource, for example, an APIPA address of 169.254.21.2, a peer address of 169.254.21.1, and without an actual BGP session being established get a ping response from 169.254.21.2. I know it should have TCP 179 open for BGP establishment, but I don't think the Palo Altos can do a port test instead of ping.
I checked with the Azure VPN Product Group team and below is their response on this query:
While Azure VPN gateways allow specific APIPA addresses for each VPN instance, we cannot utilize a prefix-based approach (/30 with fixed allocation). We are looking into allowing more APIPA addresses on the Azure VPN side to workaround this constraint. But we are still in the design phase right now.
At present, the VPN gateway will initiate BGP peering sessions to the on-premises BGP peer IP addresses specified in the local network gateway resources using the private IP addresses on the VPN gateways. This is irrespective of whether the on-premises BGP IP addresses are in the APIPA range or regular private IP addresses.
Reference : https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-bgp-overview#do-azure-vpn-gateways-initiate-bgp-peering-sessions-or-connections
We can have multi APIPA (support in-works) created and configured on the gateway without actually have the BGP peers connected but the requirement for Ping is something that we do not support/recommend.

Azure expressroute and VPN with Third Party NVA

I have a pair of FortiGate NVAs that will act as a termination point for IPSec VPN tunnels as well as serve as a backup connection for remote sites that are using expressroute.
The examples online from Microsoft show a similar solution but using the native VPN gateway. I need some help understanding how I can handle routing and failover when I am not using the native VPN gateway.
The parter is providing the expressroute as a spoke off of the existing MPLS network. Routes will be exchanged with Azure that way. I have never worked with expressroute before but I would assume that if the circuit fails or the remote site is unable to access the circuit, that specific route would be removed from the table in Azure via the eBGP relationship from the partner. I am not fully understanding how failover would occur.
A bit more about the architecture:
Two Vnets. One Vnet is the 'gateway' vnet. This would house all of the subnets for the FortiGate NVAs as well as a subnet for the expressroute object. There would be a single UDR for this Vnet. There would then be a second Vnet where shared services would live. This Vnet would be peered with the gateway Vnet. Access to the Internet would exit via the NVAs and remote site traffic would exit via the expressroute object. Where in this scenario would traffic be diverted if the expressroute failed? At the UDR?
Thanks!
If you have express route deployed in a VNET and you start advertising routes from On-Premises,then when see the effective routes of your NVA you can see On-Premises routes next hop as Express route MSEE IP.
When the circuit goes down, those routes will be revoked.
If you have VPN gateway and Express route which is a co-existence setup, where in Express route you are advertising the On-Prem route and with VPN you have declared the routes of On-Premises in Local Network Gateway, and if you see the effective routes in your NVA's NIC, you will have 2 routes to On-Premises, one with Express route and another with VPN. Express route will be the preferred route than VPN. And if Express route fails, the other route which is in place will be acting as a failover.
In your case, if express route fails, the route to On-Prem via Express route will be revoked and you need add a route to forward the traffic via the tunnel.Or else traffic gets dropped in your NVA.

Routing traffic between VNets in Azure

If two vnets are connected to each other via multiple set of peering vnets, how does azure route the traffic? Fo example, lets consider the below: A, B, C, D are 5 VNets and the they are peered (bi-directionally with traffic forwarding allowed).
Now if A wants to send a packet to D, how it is determined whether it will take the A-B-C-D path or the A-E-D path?
Any docs will be helpful.
As far as I know, VNet Peering connections are non-transitive. It seems that it's still on the roadmap. See the feedback here.
From your picture, If only VNet Peering connections between them, then A could not reach D, also A could not reach C. A only could reach direct-connected B and E.
If you want to allow much VNets communication. You could implement a hub-spoke network topology in Azure. As the hub network, you could deploy a VPN gateway then enable allow gateway transit to other spoke VNets and enable use remote gateways in each spoke VNets. If you require connectivity between spokes, consider implementing an NVA for routing in the hub, and using UDR(custom routes) in the spoke to forward traffic to the hub. In this scenario, you must configure the peering connections to allow forwarded traffic.
VNet Peering enables you to connect VNets through the Azure backbone network. Azure automatically creates a route table for each subnet within an Azure VNet and adds system default routes to the table. You can also override some of Azure's system routes with custom routes.
If multiple routes contain the same address prefix, Azure selects the
route type, based on the following priority:
User-defined
route BGP route
System route
You could get more details about Virtual network traffic routing
According to this article you'd need an NVA somewhere, vnet peering is non transitive.
At the beggining of the same article they talk a bit more about this.
To sum it up. packet wont reach D from A unless you fix your networking setup
Some years ago but i think service chaining allows that as far as i understand the documentation
To enable service chaining, configure user-defined routes that point
to virtual machines in peered virtual networks as the next hop IP
address. User-defined routes could also point to virtual network
gateways to enable service chaining.

When is NAT-T natting performed on Azure policy based basic VNet gateway, IKEv1 site-to-site connection

I have a strange requirement for IKEv1 VPN to a Cisco ASA and Checkpoint system with Azure.
We setup two Azure policy based VNet gateways, virtual networks and associated virtual machines.
The connection has to be IKEv1 AES-256-SHA1-DHGroup2 site-to-site connection per their test and production environments so we setup one for test and production.
The third party system does not support RFC1918 addressing within VPN
tunnels (encryption domain) and/or Peers. There must be publicly
assigned IP addresses for the VPN tunnel, as well as a publicly routed
IP address for the peer.
They recommend using subnets within the tunnel negotiations, and using
your access-lists to narrow this down to specific hosts (subnet SA’s
vs. host SA’s). In the event you need to “hide” multiple hosts behind
a single IP address, you should PAT using a publicly assigned address
to be included in the VPN tunnel. NAT-T (UDP Encapsulation of IPSEC)
is not supported due to global configuration items which affect
multiple customers.
My question is when is NAT-T performed when connecting to an Azure virtual network gateway in policy-based (IKEv1) mode on site-to-site (S2S) connections? Is it done at all or when is it performed? Is it only performed if there is a load balancer out front?
I think I tried to answer the same questions on the MSDN forum. Just re-iterate the answers:
NAT-T is performed on the outer packets/addresses of IPsec packets.
Azure VPN gateway does NOT perform any NAT/PAT functionality on the inner packets in/out of IPsec tunnels. So if you use public IP addresses inside of your on-premises network and your Azure virtual network they will stay the same to/from the Azure VPN gateways and IPsec tunnels.
You can use public IP address spaces as "private" IP addresses on your Azure VMs / Azure virtual network. These will be treated like "private" addresses by the Azure VPN gateways. We will not NAT those inner packets.
Hope this helps.
Thanks,
Yushun [MSFT]
To clarify: Have you gone through this suggestion :
Site-to-Site – VPN connection over IPsec (IKE v1 and IKE v2). This type of connection requires a VPN device or RRAS. For more information, see Site-to-Site:
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-portal
Point-to-Site – VPN connection over SSTP (Secure Socket Tunneling Protocol). This connection does not require a VPN device. For more information, see Point-to-Site:
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-point-to-site-resource-manager-portal
VNet-to-VNet – This type of connection is the same as a Site-to-Site configuration. VNet to VNet is a VPN connection over IPsec (IKE v1 and IKE v2). It does not require a VPN device. For more information, see VNet-to-VNet:
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-resource-manager-portal
Multi-Site – This is a variation of a Site-to-Site configuration that allows you to connect multiple on-premises sites to a virtual network.
Only the traffic that has a destination IP that is contained in the virtual network Local Network IP address ranges that you specified will go through the virtual network gateway. Traffic has a destination IP located within the virtual network stays within the virtual network. Other traffic is sent through the load balancer to the public networks, or if forced tunneling is used, sent through the Azure VPN gateway

Resources