Hi Joe,
Let's say the VM Vnet is 10.100.10.0/24. DHCP in this Vnet is handing out 10.100.10.1 as its default gateway, but I can't assign that IP to the inside interface of my firewall as it says .1 falls within the reserved IP range of the 10.100.10.0/24 subnet. From what I've seen, this IP is reserved by Microsoft in the subnet.
First 4 + last IP address in each subnet are reserved. You cannot change this. Excerpt from Virtual Networks FAQ:
Are there any restrictions on using IP addresses within these subnets? Yes. Azure reserves the first four addresses and the last address, for a total of five IP addresses within each subnet. For example, the IP address range of 192.168.1.0/24 has the following reserved addresses:
- 192.168.1.0: Network address.
- 192.168.1.1: Reserved by Azure for the default gateway.
- 192.168.1.2, 192.168.1.3: Reserved by Azure to map the Azure DNS IP addresses to the virtual network space.
- 192.168.1.255: Network broadcast address.
What you can do in your example is assign your firewall 10.100.10.4 as static in the network interface config, and associate a route table with the subnet so that all traffic will flow to this firewall IP. Please take a look at article below:
Virtual appliance scenario
https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-scenario-udr-gw-nva
Additionally, below article will be useful as well:
Virtual network traffic routing
https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview
Please review above and then add a comment below if you are unsure about something and/or you are seeing unexpected results, etc., and I'll assist further.
Please click Accept Answer and upvote if the above was helpful.
Thanks.
-TP