question

DavidEspinel-1318 avatar image
0 Votes"
DavidEspinel-1318 asked SaiKishor-MSFT answered

ExpressRoute gateway doesn't allow custom routes

Hi,

I have an ExpressRoute circuit and the following peering among networks:

VnetA (ExpressRoute) <===(peering)===> VnetB <===(peering)===> VnetC

I wanted to advertise a custom route belonging to VnetC which is not directly peered with VnetA. Routing between VnetA and VnetC is possible using a network gateway deployed in VnetB (this is somehow a hub & (hub & spoke)) architecture.

When I tried to add the custom route to the virtual network gateway of type ExpressRoute using PowerShell, I received the following error message:

Custom routes are not allowed to be specified for gateway ... of type ExpressRoute.
StatusCode: 400
ReasonPhrase: Bad Request

Is there another way to propagate this route to the on-prem ?

Thanks!

azure-virtual-networkazure-expressroute
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SaiKishor-MSFT avatar image
0 Votes"
SaiKishor-MSFT answered

@DavidEspinel-1318 Thank you for reaching out to Microsoft Q&A. I understand that you want to advertise a custom route to the Express Route gateway and while you are doing the same you are getting the above error.

As mentioned here in this document, You cannot create user-defined routes to force traffic to the ExpressRoute virtual network gateway if you deploy a virtual network gateway deployed as type: ExpressRoute. You can use user-defined routes for forcing traffic from the Express Route to, for example, a Network Virtual Appliance.

I would suggest you to either Peer Vnet A with Vnet C directly or setup Gateway Transit as shown below:
127774-peering.png

Hope this helps. Please let us know if you need any further assistance and we will be glad to assist further. Thank you!



peering.png (103.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.