Hi Gabriel Moraes,
Thanks for reaching out to Microsoft Q&A.
To effectively manage external traffic for your VM hosting a public website while utilizing a Fortigate Firewall in Azure, there are several key considerations and configurations to implement:
- Public IP Management
You should not assign a public IP directly to the VM that hosts your website. Instead, configure the Fortigate Firewall with a public IP. This allows the firewall to manage all incoming and outgoing traffic, ensuring better security and control. You can utilize Destination Network Address Translation (DNAT)rules on the Fortigate to route traffic from the public IP to the private IP of the VM hosting the website.
- Virtual Network Setup
It is recommended to keep the VM and the Fortigate Firewall in thesame virtual network (VNet). This simplifies routing and ensures that the firewall can easily manage traffic between the public internet and your internal resources. If you choose to place them in separate VNets, you would need to set up VNet peering, which adds complexity to the configuration.
- Route Table Configuration
You will need to create a route table that directs all outbound traffic through the Fortigate Firewall. This can be done by setting a default route (0.0.0.0/0) in the route table, with the next hop pointing to the private IP of the Fortigate Firewall. This setup ensures that all traffic, both ingress and egress, is routed through the firewall for inspection and security management.
- Firewall Configuration
Ensure that the Fortigate Firewall is configured to allow ICMP (ping) traffic if you want to ping the public IP of the VM. This involves creating appropriate firewall policies that permit ICMP traffic from the firewall's external interface to the internal VM's IP address. Additionally, configure the firewall to handle other necessary protocols and ports required by your web application.
Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.