Prevent Azure Expressroute from learning routes from VPN Gateway - azure

How can I prevent Azure Expressroute from learning routes from VPN gateway? We're setting up a IPsec over Azure Expressroute. We want the Azure Expressroute just be a circuit. Right now Azure Expressroute is advertising the routes that's learned from VPN Gateway to the Edge routers.
Is there a way to prevent Azure Expressroute from learning routes from VPN gateway?

Another tough question John!
I have never actually had to verify or look into this.
However, if I just go by what I know from the VPN Gateway: If it is route-based, you need to make routes in order for traffic to go where it needs to go.
So my guess is: https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-vpn-faq#what-should-i-specify-as-my-address-prefixes-for-the-local-network-gateway-when-i-use-bgp
That page also mentions that when you route 0.0.0.0 to the Azure VPN Gateway all traffic goes egress to the 'on-premise' site. So if you would only route the traffic you want the rest of your VNET wouldn't be known to the S2S tunnel.

Related

Azure P2S and S2S connectivity without BGP

In my setup, I have an on-prem environment that is connected to my Azure environment using S2S VPN connection. We, developers, use P2S connection to access Azure environment.
Our setup looks like on the image below:
We'd also like to access on-prem resources, however that only works when BGP is enabled. Would it be possible to somehow manually adjust routes, so that we do not need to enable BGP ? If yes, how can I do that ?
We'd also like to access on-prem resources, however that only works when BGP is enabled. Would it be possible to somehow manually adjust routes, so that we do not need to enable BGP ? If yes, how can I do that ?
Unfortunately, there’s no workaround to connect to your Site-to-Site VPN from your Point to Site VPN connected to same V-net without BGP.
You can use BGP and route your traffic to communicate between your On-prem site connected to S2S and your client machines connected via P2S to Azure V-Net.
The Clients can only connect to Vnet without BGP, and the client can connect to on prem Site given S2S has BGP enabled.
References:
Azure VPN Gateway: About P2S routing - Azure VPN Gateway | Microsoft Learn
Azure routing | from p2s client VPN to s2s network on-prem - Microsoft Q&A by Sai Kishore

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 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.

P2S connections with Azure Express Route

A question regarding P2S and Express Route connectivity co-existence in same virtual gateway. At Azure portal, there is an option to configure P2S connections to virtual gateway that is Express Route gateway type. But generally, when setting up VPN (S2S) and ER co-existence, MSFT recommends that separate virtual GW is built for VPN GW. MSFT documentation only talks about S2S and ER co-existence in vNet, nothing about P2S and ER.
So my questions are, does P2S connections work if you setup those to ER VGW? And does anyone know, what is MSFT recommended best practice in this scenario?
I'm not aware of any P2S support within the ExpressRoute Gateway. The ExpressRoute circuits are essentially virtual leased lines, and the configuration for ExpressRoute is about circuits, connections, ports, routing.
The VPN Gateways do support both S2S and P2S. You can also effectively combine VPN and ExpressRoute Gateways, so if you want belt and braces you can have a S2S VPN connection traverse the ExpressRoute link so it will be encrypted as well as private.
If there is an option for P2S in your ExpressRoute perhaps you could screenshot it and paste it in here? I can see nothing for it in the documentation or in the ARM template reference area.
ExpressRoute gateways are not supposed to show the option of adding P2S configuration. You would need to configure a coexistent VPN GW that has P2S configured. If you're still seeing this option on your ExR GW, that's likely a bug.
https://learn.microsoft.com/en-us/azure/expressroute/expressroute-howto-coexist-resource-manager#to-add-point-to-site-configuration-to-the-vpn-gateway

Securing Azure PaaS (api apps) using NSG

Trying to secure an API apps endpoint without Azure Active Directory. I have seen examples of NSG for securing SQL Server endpoints.
But with PaaS services (web apps / api apps/ logic apps) since they dont have VNETS I am bit confused as to how NSG will restrict traffic.
On Api app blade I see a "Networking" option and clicking that takes me into setting up VNET integration. When I click VNet setup starts gateway setup and configuration.
Has anyone done something similar where they secure backend api services using NSG and not API Gateway or AAD authentication.
Thanks !!
If you integrate the app service with a vnet, you can use NSGs to restrict the traffic, but only for the traffic connecting via the private network. vnet integration works with a vpn connection, hence the required deployment of a gateway on the vnet.
In this setup, the api app will still be accessible on the internet and that traffic will not be affected by the NSG, since it does not touch the vnet.
If you want to secure incoming traffic based on network origin you could implement that in application, but I would recommend against relying solely on that for security.

Resources